~ubuntu-branches/debian/stretch/golang-github-aws-aws-sdk-go/stretch

« back to all changes in this revision

Viewing changes to service/support/examples_test.go

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2015-09-29 12:34:07 UTC
  • Revision ID: package-import@ubuntu.com-20150929123407-7xmll3gdhvb9zh2l
Tags: upstream-0.9.9+dfsg
ImportĀ upstreamĀ versionĀ 0.9.9+dfsg

Show diffs side-by-side

added added

removed removed

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