examples_test.go 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package support_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/support"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleSupport_AddAttachmentsToSet() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := support.New(sess)
  20. params := &support.AddAttachmentsToSetInput{
  21. Attachments: []*support.Attachment{ // Required
  22. { // Required
  23. Data: []byte("PAYLOAD"),
  24. FileName: aws.String("FileName"),
  25. },
  26. // More values...
  27. },
  28. AttachmentSetId: aws.String("AttachmentSetId"),
  29. }
  30. resp, err := svc.AddAttachmentsToSet(params)
  31. if err != nil {
  32. // Print the error, cast err to awserr.Error to get the Code and
  33. // Message from an error.
  34. fmt.Println(err.Error())
  35. return
  36. }
  37. // Pretty-print the response data.
  38. fmt.Println(resp)
  39. }
  40. func ExampleSupport_AddCommunicationToCase() {
  41. sess, err := session.NewSession()
  42. if err != nil {
  43. fmt.Println("failed to create session,", err)
  44. return
  45. }
  46. svc := support.New(sess)
  47. params := &support.AddCommunicationToCaseInput{
  48. CommunicationBody: aws.String("CommunicationBody"), // Required
  49. AttachmentSetId: aws.String("AttachmentSetId"),
  50. CaseId: aws.String("CaseId"),
  51. CcEmailAddresses: []*string{
  52. aws.String("CcEmailAddress"), // Required
  53. // More values...
  54. },
  55. }
  56. resp, err := svc.AddCommunicationToCase(params)
  57. if err != nil {
  58. // Print the error, cast err to awserr.Error to get the Code and
  59. // Message from an error.
  60. fmt.Println(err.Error())
  61. return
  62. }
  63. // Pretty-print the response data.
  64. fmt.Println(resp)
  65. }
  66. func ExampleSupport_CreateCase() {
  67. sess, err := session.NewSession()
  68. if err != nil {
  69. fmt.Println("failed to create session,", err)
  70. return
  71. }
  72. svc := support.New(sess)
  73. params := &support.CreateCaseInput{
  74. CommunicationBody: aws.String("CommunicationBody"), // Required
  75. Subject: aws.String("Subject"), // Required
  76. AttachmentSetId: aws.String("AttachmentSetId"),
  77. CategoryCode: aws.String("CategoryCode"),
  78. CcEmailAddresses: []*string{
  79. aws.String("CcEmailAddress"), // Required
  80. // More values...
  81. },
  82. IssueType: aws.String("IssueType"),
  83. Language: aws.String("Language"),
  84. ServiceCode: aws.String("ServiceCode"),
  85. SeverityCode: aws.String("SeverityCode"),
  86. }
  87. resp, err := svc.CreateCase(params)
  88. if err != nil {
  89. // Print the error, cast err to awserr.Error to get the Code and
  90. // Message from an error.
  91. fmt.Println(err.Error())
  92. return
  93. }
  94. // Pretty-print the response data.
  95. fmt.Println(resp)
  96. }
  97. func ExampleSupport_DescribeAttachment() {
  98. sess, err := session.NewSession()
  99. if err != nil {
  100. fmt.Println("failed to create session,", err)
  101. return
  102. }
  103. svc := support.New(sess)
  104. params := &support.DescribeAttachmentInput{
  105. AttachmentId: aws.String("AttachmentId"), // Required
  106. }
  107. resp, err := svc.DescribeAttachment(params)
  108. if err != nil {
  109. // Print the error, cast err to awserr.Error to get the Code and
  110. // Message from an error.
  111. fmt.Println(err.Error())
  112. return
  113. }
  114. // Pretty-print the response data.
  115. fmt.Println(resp)
  116. }
  117. func ExampleSupport_DescribeCases() {
  118. sess, err := session.NewSession()
  119. if err != nil {
  120. fmt.Println("failed to create session,", err)
  121. return
  122. }
  123. svc := support.New(sess)
  124. params := &support.DescribeCasesInput{
  125. AfterTime: aws.String("AfterTime"),
  126. BeforeTime: aws.String("BeforeTime"),
  127. CaseIdList: []*string{
  128. aws.String("CaseId"), // Required
  129. // More values...
  130. },
  131. DisplayId: aws.String("DisplayId"),
  132. IncludeCommunications: aws.Bool(true),
  133. IncludeResolvedCases: aws.Bool(true),
  134. Language: aws.String("Language"),
  135. MaxResults: aws.Int64(1),
  136. NextToken: aws.String("NextToken"),
  137. }
  138. resp, err := svc.DescribeCases(params)
  139. if err != nil {
  140. // Print the error, cast err to awserr.Error to get the Code and
  141. // Message from an error.
  142. fmt.Println(err.Error())
  143. return
  144. }
  145. // Pretty-print the response data.
  146. fmt.Println(resp)
  147. }
  148. func ExampleSupport_DescribeCommunications() {
  149. sess, err := session.NewSession()
  150. if err != nil {
  151. fmt.Println("failed to create session,", err)
  152. return
  153. }
  154. svc := support.New(sess)
  155. params := &support.DescribeCommunicationsInput{
  156. CaseId: aws.String("CaseId"), // Required
  157. AfterTime: aws.String("AfterTime"),
  158. BeforeTime: aws.String("BeforeTime"),
  159. MaxResults: aws.Int64(1),
  160. NextToken: aws.String("NextToken"),
  161. }
  162. resp, err := svc.DescribeCommunications(params)
  163. if err != nil {
  164. // Print the error, cast err to awserr.Error to get the Code and
  165. // Message from an error.
  166. fmt.Println(err.Error())
  167. return
  168. }
  169. // Pretty-print the response data.
  170. fmt.Println(resp)
  171. }
  172. func ExampleSupport_DescribeServices() {
  173. sess, err := session.NewSession()
  174. if err != nil {
  175. fmt.Println("failed to create session,", err)
  176. return
  177. }
  178. svc := support.New(sess)
  179. params := &support.DescribeServicesInput{
  180. Language: aws.String("Language"),
  181. ServiceCodeList: []*string{
  182. aws.String("ServiceCode"), // Required
  183. // More values...
  184. },
  185. }
  186. resp, err := svc.DescribeServices(params)
  187. if err != nil {
  188. // Print the error, cast err to awserr.Error to get the Code and
  189. // Message from an error.
  190. fmt.Println(err.Error())
  191. return
  192. }
  193. // Pretty-print the response data.
  194. fmt.Println(resp)
  195. }
  196. func ExampleSupport_DescribeSeverityLevels() {
  197. sess, err := session.NewSession()
  198. if err != nil {
  199. fmt.Println("failed to create session,", err)
  200. return
  201. }
  202. svc := support.New(sess)
  203. params := &support.DescribeSeverityLevelsInput{
  204. Language: aws.String("Language"),
  205. }
  206. resp, err := svc.DescribeSeverityLevels(params)
  207. if err != nil {
  208. // Print the error, cast err to awserr.Error to get the Code and
  209. // Message from an error.
  210. fmt.Println(err.Error())
  211. return
  212. }
  213. // Pretty-print the response data.
  214. fmt.Println(resp)
  215. }
  216. func ExampleSupport_DescribeTrustedAdvisorCheckRefreshStatuses() {
  217. sess, err := session.NewSession()
  218. if err != nil {
  219. fmt.Println("failed to create session,", err)
  220. return
  221. }
  222. svc := support.New(sess)
  223. params := &support.DescribeTrustedAdvisorCheckRefreshStatusesInput{
  224. CheckIds: []*string{ // Required
  225. aws.String("String"), // Required
  226. // More values...
  227. },
  228. }
  229. resp, err := svc.DescribeTrustedAdvisorCheckRefreshStatuses(params)
  230. if err != nil {
  231. // Print the error, cast err to awserr.Error to get the Code and
  232. // Message from an error.
  233. fmt.Println(err.Error())
  234. return
  235. }
  236. // Pretty-print the response data.
  237. fmt.Println(resp)
  238. }
  239. func ExampleSupport_DescribeTrustedAdvisorCheckResult() {
  240. sess, err := session.NewSession()
  241. if err != nil {
  242. fmt.Println("failed to create session,", err)
  243. return
  244. }
  245. svc := support.New(sess)
  246. params := &support.DescribeTrustedAdvisorCheckResultInput{
  247. CheckId: aws.String("String"), // Required
  248. Language: aws.String("String"),
  249. }
  250. resp, err := svc.DescribeTrustedAdvisorCheckResult(params)
  251. if err != nil {
  252. // Print the error, cast err to awserr.Error to get the Code and
  253. // Message from an error.
  254. fmt.Println(err.Error())
  255. return
  256. }
  257. // Pretty-print the response data.
  258. fmt.Println(resp)
  259. }
  260. func ExampleSupport_DescribeTrustedAdvisorCheckSummaries() {
  261. sess, err := session.NewSession()
  262. if err != nil {
  263. fmt.Println("failed to create session,", err)
  264. return
  265. }
  266. svc := support.New(sess)
  267. params := &support.DescribeTrustedAdvisorCheckSummariesInput{
  268. CheckIds: []*string{ // Required
  269. aws.String("String"), // Required
  270. // More values...
  271. },
  272. }
  273. resp, err := svc.DescribeTrustedAdvisorCheckSummaries(params)
  274. if err != nil {
  275. // Print the error, cast err to awserr.Error to get the Code and
  276. // Message from an error.
  277. fmt.Println(err.Error())
  278. return
  279. }
  280. // Pretty-print the response data.
  281. fmt.Println(resp)
  282. }
  283. func ExampleSupport_DescribeTrustedAdvisorChecks() {
  284. sess, err := session.NewSession()
  285. if err != nil {
  286. fmt.Println("failed to create session,", err)
  287. return
  288. }
  289. svc := support.New(sess)
  290. params := &support.DescribeTrustedAdvisorChecksInput{
  291. Language: aws.String("String"), // Required
  292. }
  293. resp, err := svc.DescribeTrustedAdvisorChecks(params)
  294. if err != nil {
  295. // Print the error, cast err to awserr.Error to get the Code and
  296. // Message from an error.
  297. fmt.Println(err.Error())
  298. return
  299. }
  300. // Pretty-print the response data.
  301. fmt.Println(resp)
  302. }
  303. func ExampleSupport_RefreshTrustedAdvisorCheck() {
  304. sess, err := session.NewSession()
  305. if err != nil {
  306. fmt.Println("failed to create session,", err)
  307. return
  308. }
  309. svc := support.New(sess)
  310. params := &support.RefreshTrustedAdvisorCheckInput{
  311. CheckId: aws.String("String"), // Required
  312. }
  313. resp, err := svc.RefreshTrustedAdvisorCheck(params)
  314. if err != nil {
  315. // Print the error, cast err to awserr.Error to get the Code and
  316. // Message from an error.
  317. fmt.Println(err.Error())
  318. return
  319. }
  320. // Pretty-print the response data.
  321. fmt.Println(resp)
  322. }
  323. func ExampleSupport_ResolveCase() {
  324. sess, err := session.NewSession()
  325. if err != nil {
  326. fmt.Println("failed to create session,", err)
  327. return
  328. }
  329. svc := support.New(sess)
  330. params := &support.ResolveCaseInput{
  331. CaseId: aws.String("CaseId"),
  332. }
  333. resp, err := svc.ResolveCase(params)
  334. if err != nil {
  335. // Print the error, cast err to awserr.Error to get the Code and
  336. // Message from an error.
  337. fmt.Println(err.Error())
  338. return
  339. }
  340. // Pretty-print the response data.
  341. fmt.Println(resp)
  342. }