examples_test.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package configservice_test
  3. import (
  4. "bytes"
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws"
  8. "github.com/aws/aws-sdk-go/aws/session"
  9. "github.com/aws/aws-sdk-go/service/configservice"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleConfigService_DeleteConfigRule() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := configservice.New(sess)
  20. params := &configservice.DeleteConfigRuleInput{
  21. ConfigRuleName: aws.String("StringWithCharLimit64"), // Required
  22. }
  23. resp, err := svc.DeleteConfigRule(params)
  24. if err != nil {
  25. // Print the error, cast err to awserr.Error to get the Code and
  26. // Message from an error.
  27. fmt.Println(err.Error())
  28. return
  29. }
  30. // Pretty-print the response data.
  31. fmt.Println(resp)
  32. }
  33. func ExampleConfigService_DeleteConfigurationRecorder() {
  34. sess, err := session.NewSession()
  35. if err != nil {
  36. fmt.Println("failed to create session,", err)
  37. return
  38. }
  39. svc := configservice.New(sess)
  40. params := &configservice.DeleteConfigurationRecorderInput{
  41. ConfigurationRecorderName: aws.String("RecorderName"), // Required
  42. }
  43. resp, err := svc.DeleteConfigurationRecorder(params)
  44. if err != nil {
  45. // Print the error, cast err to awserr.Error to get the Code and
  46. // Message from an error.
  47. fmt.Println(err.Error())
  48. return
  49. }
  50. // Pretty-print the response data.
  51. fmt.Println(resp)
  52. }
  53. func ExampleConfigService_DeleteDeliveryChannel() {
  54. sess, err := session.NewSession()
  55. if err != nil {
  56. fmt.Println("failed to create session,", err)
  57. return
  58. }
  59. svc := configservice.New(sess)
  60. params := &configservice.DeleteDeliveryChannelInput{
  61. DeliveryChannelName: aws.String("ChannelName"), // Required
  62. }
  63. resp, err := svc.DeleteDeliveryChannel(params)
  64. if err != nil {
  65. // Print the error, cast err to awserr.Error to get the Code and
  66. // Message from an error.
  67. fmt.Println(err.Error())
  68. return
  69. }
  70. // Pretty-print the response data.
  71. fmt.Println(resp)
  72. }
  73. func ExampleConfigService_DeleteEvaluationResults() {
  74. sess, err := session.NewSession()
  75. if err != nil {
  76. fmt.Println("failed to create session,", err)
  77. return
  78. }
  79. svc := configservice.New(sess)
  80. params := &configservice.DeleteEvaluationResultsInput{
  81. ConfigRuleName: aws.String("StringWithCharLimit64"), // Required
  82. }
  83. resp, err := svc.DeleteEvaluationResults(params)
  84. if err != nil {
  85. // Print the error, cast err to awserr.Error to get the Code and
  86. // Message from an error.
  87. fmt.Println(err.Error())
  88. return
  89. }
  90. // Pretty-print the response data.
  91. fmt.Println(resp)
  92. }
  93. func ExampleConfigService_DeliverConfigSnapshot() {
  94. sess, err := session.NewSession()
  95. if err != nil {
  96. fmt.Println("failed to create session,", err)
  97. return
  98. }
  99. svc := configservice.New(sess)
  100. params := &configservice.DeliverConfigSnapshotInput{
  101. DeliveryChannelName: aws.String("ChannelName"), // Required
  102. }
  103. resp, err := svc.DeliverConfigSnapshot(params)
  104. if err != nil {
  105. // Print the error, cast err to awserr.Error to get the Code and
  106. // Message from an error.
  107. fmt.Println(err.Error())
  108. return
  109. }
  110. // Pretty-print the response data.
  111. fmt.Println(resp)
  112. }
  113. func ExampleConfigService_DescribeComplianceByConfigRule() {
  114. sess, err := session.NewSession()
  115. if err != nil {
  116. fmt.Println("failed to create session,", err)
  117. return
  118. }
  119. svc := configservice.New(sess)
  120. params := &configservice.DescribeComplianceByConfigRuleInput{
  121. ComplianceTypes: []*string{
  122. aws.String("ComplianceType"), // Required
  123. // More values...
  124. },
  125. ConfigRuleNames: []*string{
  126. aws.String("StringWithCharLimit64"), // Required
  127. // More values...
  128. },
  129. NextToken: aws.String("String"),
  130. }
  131. resp, err := svc.DescribeComplianceByConfigRule(params)
  132. if err != nil {
  133. // Print the error, cast err to awserr.Error to get the Code and
  134. // Message from an error.
  135. fmt.Println(err.Error())
  136. return
  137. }
  138. // Pretty-print the response data.
  139. fmt.Println(resp)
  140. }
  141. func ExampleConfigService_DescribeComplianceByResource() {
  142. sess, err := session.NewSession()
  143. if err != nil {
  144. fmt.Println("failed to create session,", err)
  145. return
  146. }
  147. svc := configservice.New(sess)
  148. params := &configservice.DescribeComplianceByResourceInput{
  149. ComplianceTypes: []*string{
  150. aws.String("ComplianceType"), // Required
  151. // More values...
  152. },
  153. Limit: aws.Int64(1),
  154. NextToken: aws.String("NextToken"),
  155. ResourceId: aws.String("StringWithCharLimit256"),
  156. ResourceType: aws.String("StringWithCharLimit256"),
  157. }
  158. resp, err := svc.DescribeComplianceByResource(params)
  159. if err != nil {
  160. // Print the error, cast err to awserr.Error to get the Code and
  161. // Message from an error.
  162. fmt.Println(err.Error())
  163. return
  164. }
  165. // Pretty-print the response data.
  166. fmt.Println(resp)
  167. }
  168. func ExampleConfigService_DescribeConfigRuleEvaluationStatus() {
  169. sess, err := session.NewSession()
  170. if err != nil {
  171. fmt.Println("failed to create session,", err)
  172. return
  173. }
  174. svc := configservice.New(sess)
  175. params := &configservice.DescribeConfigRuleEvaluationStatusInput{
  176. ConfigRuleNames: []*string{
  177. aws.String("StringWithCharLimit64"), // Required
  178. // More values...
  179. },
  180. }
  181. resp, err := svc.DescribeConfigRuleEvaluationStatus(params)
  182. if err != nil {
  183. // Print the error, cast err to awserr.Error to get the Code and
  184. // Message from an error.
  185. fmt.Println(err.Error())
  186. return
  187. }
  188. // Pretty-print the response data.
  189. fmt.Println(resp)
  190. }
  191. func ExampleConfigService_DescribeConfigRules() {
  192. sess, err := session.NewSession()
  193. if err != nil {
  194. fmt.Println("failed to create session,", err)
  195. return
  196. }
  197. svc := configservice.New(sess)
  198. params := &configservice.DescribeConfigRulesInput{
  199. ConfigRuleNames: []*string{
  200. aws.String("StringWithCharLimit64"), // Required
  201. // More values...
  202. },
  203. NextToken: aws.String("String"),
  204. }
  205. resp, err := svc.DescribeConfigRules(params)
  206. if err != nil {
  207. // Print the error, cast err to awserr.Error to get the Code and
  208. // Message from an error.
  209. fmt.Println(err.Error())
  210. return
  211. }
  212. // Pretty-print the response data.
  213. fmt.Println(resp)
  214. }
  215. func ExampleConfigService_DescribeConfigurationRecorderStatus() {
  216. sess, err := session.NewSession()
  217. if err != nil {
  218. fmt.Println("failed to create session,", err)
  219. return
  220. }
  221. svc := configservice.New(sess)
  222. params := &configservice.DescribeConfigurationRecorderStatusInput{
  223. ConfigurationRecorderNames: []*string{
  224. aws.String("RecorderName"), // Required
  225. // More values...
  226. },
  227. }
  228. resp, err := svc.DescribeConfigurationRecorderStatus(params)
  229. if err != nil {
  230. // Print the error, cast err to awserr.Error to get the Code and
  231. // Message from an error.
  232. fmt.Println(err.Error())
  233. return
  234. }
  235. // Pretty-print the response data.
  236. fmt.Println(resp)
  237. }
  238. func ExampleConfigService_DescribeConfigurationRecorders() {
  239. sess, err := session.NewSession()
  240. if err != nil {
  241. fmt.Println("failed to create session,", err)
  242. return
  243. }
  244. svc := configservice.New(sess)
  245. params := &configservice.DescribeConfigurationRecordersInput{
  246. ConfigurationRecorderNames: []*string{
  247. aws.String("RecorderName"), // Required
  248. // More values...
  249. },
  250. }
  251. resp, err := svc.DescribeConfigurationRecorders(params)
  252. if err != nil {
  253. // Print the error, cast err to awserr.Error to get the Code and
  254. // Message from an error.
  255. fmt.Println(err.Error())
  256. return
  257. }
  258. // Pretty-print the response data.
  259. fmt.Println(resp)
  260. }
  261. func ExampleConfigService_DescribeDeliveryChannelStatus() {
  262. sess, err := session.NewSession()
  263. if err != nil {
  264. fmt.Println("failed to create session,", err)
  265. return
  266. }
  267. svc := configservice.New(sess)
  268. params := &configservice.DescribeDeliveryChannelStatusInput{
  269. DeliveryChannelNames: []*string{
  270. aws.String("ChannelName"), // Required
  271. // More values...
  272. },
  273. }
  274. resp, err := svc.DescribeDeliveryChannelStatus(params)
  275. if err != nil {
  276. // Print the error, cast err to awserr.Error to get the Code and
  277. // Message from an error.
  278. fmt.Println(err.Error())
  279. return
  280. }
  281. // Pretty-print the response data.
  282. fmt.Println(resp)
  283. }
  284. func ExampleConfigService_DescribeDeliveryChannels() {
  285. sess, err := session.NewSession()
  286. if err != nil {
  287. fmt.Println("failed to create session,", err)
  288. return
  289. }
  290. svc := configservice.New(sess)
  291. params := &configservice.DescribeDeliveryChannelsInput{
  292. DeliveryChannelNames: []*string{
  293. aws.String("ChannelName"), // Required
  294. // More values...
  295. },
  296. }
  297. resp, err := svc.DescribeDeliveryChannels(params)
  298. if err != nil {
  299. // Print the error, cast err to awserr.Error to get the Code and
  300. // Message from an error.
  301. fmt.Println(err.Error())
  302. return
  303. }
  304. // Pretty-print the response data.
  305. fmt.Println(resp)
  306. }
  307. func ExampleConfigService_GetComplianceDetailsByConfigRule() {
  308. sess, err := session.NewSession()
  309. if err != nil {
  310. fmt.Println("failed to create session,", err)
  311. return
  312. }
  313. svc := configservice.New(sess)
  314. params := &configservice.GetComplianceDetailsByConfigRuleInput{
  315. ConfigRuleName: aws.String("StringWithCharLimit64"), // Required
  316. ComplianceTypes: []*string{
  317. aws.String("ComplianceType"), // Required
  318. // More values...
  319. },
  320. Limit: aws.Int64(1),
  321. NextToken: aws.String("NextToken"),
  322. }
  323. resp, err := svc.GetComplianceDetailsByConfigRule(params)
  324. if err != nil {
  325. // Print the error, cast err to awserr.Error to get the Code and
  326. // Message from an error.
  327. fmt.Println(err.Error())
  328. return
  329. }
  330. // Pretty-print the response data.
  331. fmt.Println(resp)
  332. }
  333. func ExampleConfigService_GetComplianceDetailsByResource() {
  334. sess, err := session.NewSession()
  335. if err != nil {
  336. fmt.Println("failed to create session,", err)
  337. return
  338. }
  339. svc := configservice.New(sess)
  340. params := &configservice.GetComplianceDetailsByResourceInput{
  341. ResourceId: aws.String("StringWithCharLimit256"), // Required
  342. ResourceType: aws.String("StringWithCharLimit256"), // Required
  343. ComplianceTypes: []*string{
  344. aws.String("ComplianceType"), // Required
  345. // More values...
  346. },
  347. NextToken: aws.String("String"),
  348. }
  349. resp, err := svc.GetComplianceDetailsByResource(params)
  350. if err != nil {
  351. // Print the error, cast err to awserr.Error to get the Code and
  352. // Message from an error.
  353. fmt.Println(err.Error())
  354. return
  355. }
  356. // Pretty-print the response data.
  357. fmt.Println(resp)
  358. }
  359. func ExampleConfigService_GetComplianceSummaryByConfigRule() {
  360. sess, err := session.NewSession()
  361. if err != nil {
  362. fmt.Println("failed to create session,", err)
  363. return
  364. }
  365. svc := configservice.New(sess)
  366. var params *configservice.GetComplianceSummaryByConfigRuleInput
  367. resp, err := svc.GetComplianceSummaryByConfigRule(params)
  368. if err != nil {
  369. // Print the error, cast err to awserr.Error to get the Code and
  370. // Message from an error.
  371. fmt.Println(err.Error())
  372. return
  373. }
  374. // Pretty-print the response data.
  375. fmt.Println(resp)
  376. }
  377. func ExampleConfigService_GetComplianceSummaryByResourceType() {
  378. sess, err := session.NewSession()
  379. if err != nil {
  380. fmt.Println("failed to create session,", err)
  381. return
  382. }
  383. svc := configservice.New(sess)
  384. params := &configservice.GetComplianceSummaryByResourceTypeInput{
  385. ResourceTypes: []*string{
  386. aws.String("StringWithCharLimit256"), // Required
  387. // More values...
  388. },
  389. }
  390. resp, err := svc.GetComplianceSummaryByResourceType(params)
  391. if err != nil {
  392. // Print the error, cast err to awserr.Error to get the Code and
  393. // Message from an error.
  394. fmt.Println(err.Error())
  395. return
  396. }
  397. // Pretty-print the response data.
  398. fmt.Println(resp)
  399. }
  400. func ExampleConfigService_GetResourceConfigHistory() {
  401. sess, err := session.NewSession()
  402. if err != nil {
  403. fmt.Println("failed to create session,", err)
  404. return
  405. }
  406. svc := configservice.New(sess)
  407. params := &configservice.GetResourceConfigHistoryInput{
  408. ResourceId: aws.String("ResourceId"), // Required
  409. ResourceType: aws.String("ResourceType"), // Required
  410. ChronologicalOrder: aws.String("ChronologicalOrder"),
  411. EarlierTime: aws.Time(time.Now()),
  412. LaterTime: aws.Time(time.Now()),
  413. Limit: aws.Int64(1),
  414. NextToken: aws.String("NextToken"),
  415. }
  416. resp, err := svc.GetResourceConfigHistory(params)
  417. if err != nil {
  418. // Print the error, cast err to awserr.Error to get the Code and
  419. // Message from an error.
  420. fmt.Println(err.Error())
  421. return
  422. }
  423. // Pretty-print the response data.
  424. fmt.Println(resp)
  425. }
  426. func ExampleConfigService_ListDiscoveredResources() {
  427. sess, err := session.NewSession()
  428. if err != nil {
  429. fmt.Println("failed to create session,", err)
  430. return
  431. }
  432. svc := configservice.New(sess)
  433. params := &configservice.ListDiscoveredResourcesInput{
  434. ResourceType: aws.String("ResourceType"), // Required
  435. IncludeDeletedResources: aws.Bool(true),
  436. Limit: aws.Int64(1),
  437. NextToken: aws.String("NextToken"),
  438. ResourceIds: []*string{
  439. aws.String("ResourceId"), // Required
  440. // More values...
  441. },
  442. ResourceName: aws.String("ResourceName"),
  443. }
  444. resp, err := svc.ListDiscoveredResources(params)
  445. if err != nil {
  446. // Print the error, cast err to awserr.Error to get the Code and
  447. // Message from an error.
  448. fmt.Println(err.Error())
  449. return
  450. }
  451. // Pretty-print the response data.
  452. fmt.Println(resp)
  453. }
  454. func ExampleConfigService_PutConfigRule() {
  455. sess, err := session.NewSession()
  456. if err != nil {
  457. fmt.Println("failed to create session,", err)
  458. return
  459. }
  460. svc := configservice.New(sess)
  461. params := &configservice.PutConfigRuleInput{
  462. ConfigRule: &configservice.ConfigRule{ // Required
  463. Source: &configservice.Source{ // Required
  464. Owner: aws.String("Owner"),
  465. SourceDetails: []*configservice.SourceDetail{
  466. { // Required
  467. EventSource: aws.String("EventSource"),
  468. MaximumExecutionFrequency: aws.String("MaximumExecutionFrequency"),
  469. MessageType: aws.String("MessageType"),
  470. },
  471. // More values...
  472. },
  473. SourceIdentifier: aws.String("StringWithCharLimit256"),
  474. },
  475. ConfigRuleArn: aws.String("String"),
  476. ConfigRuleId: aws.String("String"),
  477. ConfigRuleName: aws.String("StringWithCharLimit64"),
  478. ConfigRuleState: aws.String("ConfigRuleState"),
  479. Description: aws.String("EmptiableStringWithCharLimit256"),
  480. InputParameters: aws.String("StringWithCharLimit256"),
  481. MaximumExecutionFrequency: aws.String("MaximumExecutionFrequency"),
  482. Scope: &configservice.Scope{
  483. ComplianceResourceId: aws.String("StringWithCharLimit256"),
  484. ComplianceResourceTypes: []*string{
  485. aws.String("StringWithCharLimit256"), // Required
  486. // More values...
  487. },
  488. TagKey: aws.String("StringWithCharLimit128"),
  489. TagValue: aws.String("StringWithCharLimit256"),
  490. },
  491. },
  492. }
  493. resp, err := svc.PutConfigRule(params)
  494. if err != nil {
  495. // Print the error, cast err to awserr.Error to get the Code and
  496. // Message from an error.
  497. fmt.Println(err.Error())
  498. return
  499. }
  500. // Pretty-print the response data.
  501. fmt.Println(resp)
  502. }
  503. func ExampleConfigService_PutConfigurationRecorder() {
  504. sess, err := session.NewSession()
  505. if err != nil {
  506. fmt.Println("failed to create session,", err)
  507. return
  508. }
  509. svc := configservice.New(sess)
  510. params := &configservice.PutConfigurationRecorderInput{
  511. ConfigurationRecorder: &configservice.ConfigurationRecorder{ // Required
  512. Name: aws.String("RecorderName"),
  513. RecordingGroup: &configservice.RecordingGroup{
  514. AllSupported: aws.Bool(true),
  515. IncludeGlobalResourceTypes: aws.Bool(true),
  516. ResourceTypes: []*string{
  517. aws.String("ResourceType"), // Required
  518. // More values...
  519. },
  520. },
  521. RoleARN: aws.String("String"),
  522. },
  523. }
  524. resp, err := svc.PutConfigurationRecorder(params)
  525. if err != nil {
  526. // Print the error, cast err to awserr.Error to get the Code and
  527. // Message from an error.
  528. fmt.Println(err.Error())
  529. return
  530. }
  531. // Pretty-print the response data.
  532. fmt.Println(resp)
  533. }
  534. func ExampleConfigService_PutDeliveryChannel() {
  535. sess, err := session.NewSession()
  536. if err != nil {
  537. fmt.Println("failed to create session,", err)
  538. return
  539. }
  540. svc := configservice.New(sess)
  541. params := &configservice.PutDeliveryChannelInput{
  542. DeliveryChannel: &configservice.DeliveryChannel{ // Required
  543. ConfigSnapshotDeliveryProperties: &configservice.ConfigSnapshotDeliveryProperties{
  544. DeliveryFrequency: aws.String("MaximumExecutionFrequency"),
  545. },
  546. Name: aws.String("ChannelName"),
  547. S3BucketName: aws.String("String"),
  548. S3KeyPrefix: aws.String("String"),
  549. SnsTopicARN: aws.String("String"),
  550. },
  551. }
  552. resp, err := svc.PutDeliveryChannel(params)
  553. if err != nil {
  554. // Print the error, cast err to awserr.Error to get the Code and
  555. // Message from an error.
  556. fmt.Println(err.Error())
  557. return
  558. }
  559. // Pretty-print the response data.
  560. fmt.Println(resp)
  561. }
  562. func ExampleConfigService_PutEvaluations() {
  563. sess, err := session.NewSession()
  564. if err != nil {
  565. fmt.Println("failed to create session,", err)
  566. return
  567. }
  568. svc := configservice.New(sess)
  569. params := &configservice.PutEvaluationsInput{
  570. ResultToken: aws.String("String"), // Required
  571. Evaluations: []*configservice.Evaluation{
  572. { // Required
  573. ComplianceResourceId: aws.String("StringWithCharLimit256"), // Required
  574. ComplianceResourceType: aws.String("StringWithCharLimit256"), // Required
  575. ComplianceType: aws.String("ComplianceType"), // Required
  576. OrderingTimestamp: aws.Time(time.Now()), // Required
  577. Annotation: aws.String("StringWithCharLimit256"),
  578. },
  579. // More values...
  580. },
  581. }
  582. resp, err := svc.PutEvaluations(params)
  583. if err != nil {
  584. // Print the error, cast err to awserr.Error to get the Code and
  585. // Message from an error.
  586. fmt.Println(err.Error())
  587. return
  588. }
  589. // Pretty-print the response data.
  590. fmt.Println(resp)
  591. }
  592. func ExampleConfigService_StartConfigRulesEvaluation() {
  593. sess, err := session.NewSession()
  594. if err != nil {
  595. fmt.Println("failed to create session,", err)
  596. return
  597. }
  598. svc := configservice.New(sess)
  599. params := &configservice.StartConfigRulesEvaluationInput{
  600. ConfigRuleNames: []*string{
  601. aws.String("StringWithCharLimit64"), // Required
  602. // More values...
  603. },
  604. }
  605. resp, err := svc.StartConfigRulesEvaluation(params)
  606. if err != nil {
  607. // Print the error, cast err to awserr.Error to get the Code and
  608. // Message from an error.
  609. fmt.Println(err.Error())
  610. return
  611. }
  612. // Pretty-print the response data.
  613. fmt.Println(resp)
  614. }
  615. func ExampleConfigService_StartConfigurationRecorder() {
  616. sess, err := session.NewSession()
  617. if err != nil {
  618. fmt.Println("failed to create session,", err)
  619. return
  620. }
  621. svc := configservice.New(sess)
  622. params := &configservice.StartConfigurationRecorderInput{
  623. ConfigurationRecorderName: aws.String("RecorderName"), // Required
  624. }
  625. resp, err := svc.StartConfigurationRecorder(params)
  626. if err != nil {
  627. // Print the error, cast err to awserr.Error to get the Code and
  628. // Message from an error.
  629. fmt.Println(err.Error())
  630. return
  631. }
  632. // Pretty-print the response data.
  633. fmt.Println(resp)
  634. }
  635. func ExampleConfigService_StopConfigurationRecorder() {
  636. sess, err := session.NewSession()
  637. if err != nil {
  638. fmt.Println("failed to create session,", err)
  639. return
  640. }
  641. svc := configservice.New(sess)
  642. params := &configservice.StopConfigurationRecorderInput{
  643. ConfigurationRecorderName: aws.String("RecorderName"), // Required
  644. }
  645. resp, err := svc.StopConfigurationRecorder(params)
  646. if err != nil {
  647. // Print the error, cast err to awserr.Error to get the Code and
  648. // Message from an error.
  649. fmt.Println(err.Error())
  650. return
  651. }
  652. // Pretty-print the response data.
  653. fmt.Println(resp)
  654. }