examples_test.go 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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/service/support"
  9. )
  10. var _ time.Duration
  11. var _ bytes.Buffer
  12. func ExampleSupport_AddAttachmentsToSet() {
  13. svc := support.New(nil)
  14. params := &support.AddAttachmentsToSetInput{
  15. Attachments: []*support.Attachment{ // Required
  16. { // Required
  17. Data: []byte("PAYLOAD"),
  18. FileName: aws.String("FileName"),
  19. },
  20. // More values...
  21. },
  22. AttachmentSetId: aws.String("AttachmentSetId"),
  23. }
  24. resp, err := svc.AddAttachmentsToSet(params)
  25. if err != nil {
  26. // Print the error, cast err to awserr.Error to get the Code and
  27. // Message from an error.
  28. fmt.Println(err.Error())
  29. return
  30. }
  31. // Pretty-print the response data.
  32. fmt.Println(resp)
  33. }
  34. func ExampleSupport_AddCommunicationToCase() {
  35. svc := support.New(nil)
  36. params := &support.AddCommunicationToCaseInput{
  37. CommunicationBody: aws.String("CommunicationBody"), // Required
  38. AttachmentSetId: aws.String("AttachmentSetId"),
  39. CaseId: aws.String("CaseId"),
  40. CcEmailAddresses: []*string{
  41. aws.String("CcEmailAddress"), // Required
  42. // More values...
  43. },
  44. }
  45. resp, err := svc.AddCommunicationToCase(params)
  46. if err != nil {
  47. // Print the error, cast err to awserr.Error to get the Code and
  48. // Message from an error.
  49. fmt.Println(err.Error())
  50. return
  51. }
  52. // Pretty-print the response data.
  53. fmt.Println(resp)
  54. }
  55. func ExampleSupport_CreateCase() {
  56. svc := support.New(nil)
  57. params := &support.CreateCaseInput{
  58. CommunicationBody: aws.String("CommunicationBody"), // Required
  59. Subject: aws.String("Subject"), // Required
  60. AttachmentSetId: aws.String("AttachmentSetId"),
  61. CategoryCode: aws.String("CategoryCode"),
  62. CcEmailAddresses: []*string{
  63. aws.String("CcEmailAddress"), // Required
  64. // More values...
  65. },
  66. IssueType: aws.String("IssueType"),
  67. Language: aws.String("Language"),
  68. ServiceCode: aws.String("ServiceCode"),
  69. SeverityCode: aws.String("SeverityCode"),
  70. }
  71. resp, err := svc.CreateCase(params)
  72. if err != nil {
  73. // Print the error, cast err to awserr.Error to get the Code and
  74. // Message from an error.
  75. fmt.Println(err.Error())
  76. return
  77. }
  78. // Pretty-print the response data.
  79. fmt.Println(resp)
  80. }
  81. func ExampleSupport_DescribeAttachment() {
  82. svc := support.New(nil)
  83. params := &support.DescribeAttachmentInput{
  84. AttachmentId: aws.String("AttachmentId"), // Required
  85. }
  86. resp, err := svc.DescribeAttachment(params)
  87. if err != nil {
  88. // Print the error, cast err to awserr.Error to get the Code and
  89. // Message from an error.
  90. fmt.Println(err.Error())
  91. return
  92. }
  93. // Pretty-print the response data.
  94. fmt.Println(resp)
  95. }
  96. func ExampleSupport_DescribeCases() {
  97. svc := support.New(nil)
  98. params := &support.DescribeCasesInput{
  99. AfterTime: aws.String("AfterTime"),
  100. BeforeTime: aws.String("BeforeTime"),
  101. CaseIdList: []*string{
  102. aws.String("CaseId"), // Required
  103. // More values...
  104. },
  105. DisplayId: aws.String("DisplayId"),
  106. IncludeCommunications: aws.Bool(true),
  107. IncludeResolvedCases: aws.Bool(true),
  108. Language: aws.String("Language"),
  109. MaxResults: aws.Int64(1),
  110. NextToken: aws.String("NextToken"),
  111. }
  112. resp, err := svc.DescribeCases(params)
  113. if err != nil {
  114. // Print the error, cast err to awserr.Error to get the Code and
  115. // Message from an error.
  116. fmt.Println(err.Error())
  117. return
  118. }
  119. // Pretty-print the response data.
  120. fmt.Println(resp)
  121. }
  122. func ExampleSupport_DescribeCommunications() {
  123. svc := support.New(nil)
  124. params := &support.DescribeCommunicationsInput{
  125. CaseId: aws.String("CaseId"), // Required
  126. AfterTime: aws.String("AfterTime"),
  127. BeforeTime: aws.String("BeforeTime"),
  128. MaxResults: aws.Int64(1),
  129. NextToken: aws.String("NextToken"),
  130. }
  131. resp, err := svc.DescribeCommunications(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 ExampleSupport_DescribeServices() {
  142. svc := support.New(nil)
  143. params := &support.DescribeServicesInput{
  144. Language: aws.String("Language"),
  145. ServiceCodeList: []*string{
  146. aws.String("ServiceCode"), // Required
  147. // More values...
  148. },
  149. }
  150. resp, err := svc.DescribeServices(params)
  151. if err != nil {
  152. // Print the error, cast err to awserr.Error to get the Code and
  153. // Message from an error.
  154. fmt.Println(err.Error())
  155. return
  156. }
  157. // Pretty-print the response data.
  158. fmt.Println(resp)
  159. }
  160. func ExampleSupport_DescribeSeverityLevels() {
  161. svc := support.New(nil)
  162. params := &support.DescribeSeverityLevelsInput{
  163. Language: aws.String("Language"),
  164. }
  165. resp, err := svc.DescribeSeverityLevels(params)
  166. if err != nil {
  167. // Print the error, cast err to awserr.Error to get the Code and
  168. // Message from an error.
  169. fmt.Println(err.Error())
  170. return
  171. }
  172. // Pretty-print the response data.
  173. fmt.Println(resp)
  174. }
  175. func ExampleSupport_DescribeTrustedAdvisorCheckRefreshStatuses() {
  176. svc := support.New(nil)
  177. params := &support.DescribeTrustedAdvisorCheckRefreshStatusesInput{
  178. CheckIds: []*string{ // Required
  179. aws.String("String"), // Required
  180. // More values...
  181. },
  182. }
  183. resp, err := svc.DescribeTrustedAdvisorCheckRefreshStatuses(params)
  184. if err != nil {
  185. // Print the error, cast err to awserr.Error to get the Code and
  186. // Message from an error.
  187. fmt.Println(err.Error())
  188. return
  189. }
  190. // Pretty-print the response data.
  191. fmt.Println(resp)
  192. }
  193. func ExampleSupport_DescribeTrustedAdvisorCheckResult() {
  194. svc := support.New(nil)
  195. params := &support.DescribeTrustedAdvisorCheckResultInput{
  196. CheckId: aws.String("String"), // Required
  197. Language: aws.String("String"),
  198. }
  199. resp, err := svc.DescribeTrustedAdvisorCheckResult(params)
  200. if err != nil {
  201. // Print the error, cast err to awserr.Error to get the Code and
  202. // Message from an error.
  203. fmt.Println(err.Error())
  204. return
  205. }
  206. // Pretty-print the response data.
  207. fmt.Println(resp)
  208. }
  209. func ExampleSupport_DescribeTrustedAdvisorCheckSummaries() {
  210. svc := support.New(nil)
  211. params := &support.DescribeTrustedAdvisorCheckSummariesInput{
  212. CheckIds: []*string{ // Required
  213. aws.String("String"), // Required
  214. // More values...
  215. },
  216. }
  217. resp, err := svc.DescribeTrustedAdvisorCheckSummaries(params)
  218. if err != nil {
  219. // Print the error, cast err to awserr.Error to get the Code and
  220. // Message from an error.
  221. fmt.Println(err.Error())
  222. return
  223. }
  224. // Pretty-print the response data.
  225. fmt.Println(resp)
  226. }
  227. func ExampleSupport_DescribeTrustedAdvisorChecks() {
  228. svc := support.New(nil)
  229. params := &support.DescribeTrustedAdvisorChecksInput{
  230. Language: aws.String("String"), // Required
  231. }
  232. resp, err := svc.DescribeTrustedAdvisorChecks(params)
  233. if err != nil {
  234. // Print the error, cast err to awserr.Error to get the Code and
  235. // Message from an error.
  236. fmt.Println(err.Error())
  237. return
  238. }
  239. // Pretty-print the response data.
  240. fmt.Println(resp)
  241. }
  242. func ExampleSupport_RefreshTrustedAdvisorCheck() {
  243. svc := support.New(nil)
  244. params := &support.RefreshTrustedAdvisorCheckInput{
  245. CheckId: aws.String("String"), // Required
  246. }
  247. resp, err := svc.RefreshTrustedAdvisorCheck(params)
  248. if err != nil {
  249. // Print the error, cast err to awserr.Error to get the Code and
  250. // Message from an error.
  251. fmt.Println(err.Error())
  252. return
  253. }
  254. // Pretty-print the response data.
  255. fmt.Println(resp)
  256. }
  257. func ExampleSupport_ResolveCase() {
  258. svc := support.New(nil)
  259. params := &support.ResolveCaseInput{
  260. CaseId: aws.String("CaseId"),
  261. }
  262. resp, err := svc.ResolveCase(params)
  263. if err != nil {
  264. // Print the error, cast err to awserr.Error to get the Code and
  265. // Message from an error.
  266. fmt.Println(err.Error())
  267. return
  268. }
  269. // Pretty-print the response data.
  270. fmt.Println(resp)
  271. }