forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 3
/
api.go
5778 lines (5145 loc) · 211 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sns
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/query"
)
const opAddPermission = "AddPermission"
// AddPermissionRequest generates a "aws/request.Request" representing the
// client's request for the AddPermission operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AddPermission for more information on using the AddPermission
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AddPermissionRequest method.
// req, resp := client.AddPermissionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/AddPermission
func (c *SNS) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput) {
op := &request.Operation{
Name: opAddPermission,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AddPermissionInput{}
}
output = &AddPermissionOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// AddPermission API operation for Amazon Simple Notification Service.
//
// Adds a statement to a topic's access control policy, granting access for
// the specified AWS accounts to the specified actions.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation AddPermission for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// * ErrCodeNotFoundException "NotFound"
// Indicates that the requested resource does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/AddPermission
func (c *SNS) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) {
req, out := c.AddPermissionRequest(input)
return out, req.Send()
}
// AddPermissionWithContext is the same as AddPermission with the addition of
// the ability to pass a context and additional request options.
//
// See AddPermission for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) AddPermissionWithContext(ctx aws.Context, input *AddPermissionInput, opts ...request.Option) (*AddPermissionOutput, error) {
req, out := c.AddPermissionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCheckIfPhoneNumberIsOptedOut = "CheckIfPhoneNumberIsOptedOut"
// CheckIfPhoneNumberIsOptedOutRequest generates a "aws/request.Request" representing the
// client's request for the CheckIfPhoneNumberIsOptedOut operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CheckIfPhoneNumberIsOptedOut for more information on using the CheckIfPhoneNumberIsOptedOut
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CheckIfPhoneNumberIsOptedOutRequest method.
// req, resp := client.CheckIfPhoneNumberIsOptedOutRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOut
func (c *SNS) CheckIfPhoneNumberIsOptedOutRequest(input *CheckIfPhoneNumberIsOptedOutInput) (req *request.Request, output *CheckIfPhoneNumberIsOptedOutOutput) {
op := &request.Operation{
Name: opCheckIfPhoneNumberIsOptedOut,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CheckIfPhoneNumberIsOptedOutInput{}
}
output = &CheckIfPhoneNumberIsOptedOutOutput{}
req = c.newRequest(op, input, output)
return
}
// CheckIfPhoneNumberIsOptedOut API operation for Amazon Simple Notification Service.
//
// Accepts a phone number and indicates whether the phone holder has opted out
// of receiving SMS messages from your account. You cannot send SMS messages
// to a number that is opted out.
//
// To resume sending messages, you can opt in the number by using the OptInPhoneNumber
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation CheckIfPhoneNumberIsOptedOut for usage and error information.
//
// Returned Error Codes:
// * ErrCodeThrottledException "Throttled"
// Indicates that the rate at which requests have been submitted for this action
// exceeds the limit for your account.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOut
func (c *SNS) CheckIfPhoneNumberIsOptedOut(input *CheckIfPhoneNumberIsOptedOutInput) (*CheckIfPhoneNumberIsOptedOutOutput, error) {
req, out := c.CheckIfPhoneNumberIsOptedOutRequest(input)
return out, req.Send()
}
// CheckIfPhoneNumberIsOptedOutWithContext is the same as CheckIfPhoneNumberIsOptedOut with the addition of
// the ability to pass a context and additional request options.
//
// See CheckIfPhoneNumberIsOptedOut for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) CheckIfPhoneNumberIsOptedOutWithContext(ctx aws.Context, input *CheckIfPhoneNumberIsOptedOutInput, opts ...request.Option) (*CheckIfPhoneNumberIsOptedOutOutput, error) {
req, out := c.CheckIfPhoneNumberIsOptedOutRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opConfirmSubscription = "ConfirmSubscription"
// ConfirmSubscriptionRequest generates a "aws/request.Request" representing the
// client's request for the ConfirmSubscription operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See ConfirmSubscription for more information on using the ConfirmSubscription
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the ConfirmSubscriptionRequest method.
// req, resp := client.ConfirmSubscriptionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscription
func (c *SNS) ConfirmSubscriptionRequest(input *ConfirmSubscriptionInput) (req *request.Request, output *ConfirmSubscriptionOutput) {
op := &request.Operation{
Name: opConfirmSubscription,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &ConfirmSubscriptionInput{}
}
output = &ConfirmSubscriptionOutput{}
req = c.newRequest(op, input, output)
return
}
// ConfirmSubscription API operation for Amazon Simple Notification Service.
//
// Verifies an endpoint owner's intent to receive messages by validating the
// token sent to the endpoint by an earlier Subscribe action. If the token is
// valid, the action creates a new subscription and returns its Amazon Resource
// Name (ARN). This call requires an AWS signature only when the AuthenticateOnUnsubscribe
// flag is set to "true".
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation ConfirmSubscription for usage and error information.
//
// Returned Error Codes:
// * ErrCodeSubscriptionLimitExceededException "SubscriptionLimitExceeded"
// Indicates that the customer already owns the maximum allowed number of subscriptions.
//
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// * ErrCodeNotFoundException "NotFound"
// Indicates that the requested resource does not exist.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscription
func (c *SNS) ConfirmSubscription(input *ConfirmSubscriptionInput) (*ConfirmSubscriptionOutput, error) {
req, out := c.ConfirmSubscriptionRequest(input)
return out, req.Send()
}
// ConfirmSubscriptionWithContext is the same as ConfirmSubscription with the addition of
// the ability to pass a context and additional request options.
//
// See ConfirmSubscription for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) ConfirmSubscriptionWithContext(ctx aws.Context, input *ConfirmSubscriptionInput, opts ...request.Option) (*ConfirmSubscriptionOutput, error) {
req, out := c.ConfirmSubscriptionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreatePlatformApplication = "CreatePlatformApplication"
// CreatePlatformApplicationRequest generates a "aws/request.Request" representing the
// client's request for the CreatePlatformApplication operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreatePlatformApplication for more information on using the CreatePlatformApplication
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreatePlatformApplicationRequest method.
// req, resp := client.CreatePlatformApplicationRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformApplication
func (c *SNS) CreatePlatformApplicationRequest(input *CreatePlatformApplicationInput) (req *request.Request, output *CreatePlatformApplicationOutput) {
op := &request.Operation{
Name: opCreatePlatformApplication,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreatePlatformApplicationInput{}
}
output = &CreatePlatformApplicationOutput{}
req = c.newRequest(op, input, output)
return
}
// CreatePlatformApplication API operation for Amazon Simple Notification Service.
//
// Creates a platform application object for one of the supported push notification
// services, such as APNS and GCM, to which devices and mobile apps may register.
// You must specify PlatformPrincipal and PlatformCredential attributes when
// using the CreatePlatformApplication action. The PlatformPrincipal is received
// from the notification service. For APNS/APNS_SANDBOX, PlatformPrincipal is
// "SSL certificate". For GCM, PlatformPrincipal is not applicable. For ADM,
// PlatformPrincipal is "client id". The PlatformCredential is also received
// from the notification service. For WNS, PlatformPrincipal is "Package Security
// Identifier". For MPNS, PlatformPrincipal is "TLS certificate". For Baidu,
// PlatformPrincipal is "API key".
//
// For APNS/APNS_SANDBOX, PlatformCredential is "private key". For GCM, PlatformCredential
// is "API key". For ADM, PlatformCredential is "client secret". For WNS, PlatformCredential
// is "secret key". For MPNS, PlatformCredential is "private key". For Baidu,
// PlatformCredential is "secret key". The PlatformApplicationArn that is returned
// when using CreatePlatformApplication is then used as an attribute for the
// CreatePlatformEndpoint action. For more information, see Using Amazon SNS
// Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
// For more information about obtaining the PlatformPrincipal and PlatformCredential
// for each of the supported push notification services, see Getting Started
// with Apple Push Notification Service (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html),
// Getting Started with Amazon Device Messaging (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-adm.html),
// Getting Started with Baidu Cloud Push (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-baidu.html),
// Getting Started with Google Cloud Messaging for Android (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html),
// Getting Started with MPNS (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-mpns.html),
// or Getting Started with WNS (http://docs.aws.amazon.com/sns/latest/dg/mobile-push-wns.html).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation CreatePlatformApplication for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformApplication
func (c *SNS) CreatePlatformApplication(input *CreatePlatformApplicationInput) (*CreatePlatformApplicationOutput, error) {
req, out := c.CreatePlatformApplicationRequest(input)
return out, req.Send()
}
// CreatePlatformApplicationWithContext is the same as CreatePlatformApplication with the addition of
// the ability to pass a context and additional request options.
//
// See CreatePlatformApplication for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) CreatePlatformApplicationWithContext(ctx aws.Context, input *CreatePlatformApplicationInput, opts ...request.Option) (*CreatePlatformApplicationOutput, error) {
req, out := c.CreatePlatformApplicationRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreatePlatformEndpoint = "CreatePlatformEndpoint"
// CreatePlatformEndpointRequest generates a "aws/request.Request" representing the
// client's request for the CreatePlatformEndpoint operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreatePlatformEndpoint for more information on using the CreatePlatformEndpoint
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreatePlatformEndpointRequest method.
// req, resp := client.CreatePlatformEndpointRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformEndpoint
func (c *SNS) CreatePlatformEndpointRequest(input *CreatePlatformEndpointInput) (req *request.Request, output *CreatePlatformEndpointOutput) {
op := &request.Operation{
Name: opCreatePlatformEndpoint,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreatePlatformEndpointInput{}
}
output = &CreatePlatformEndpointOutput{}
req = c.newRequest(op, input, output)
return
}
// CreatePlatformEndpoint API operation for Amazon Simple Notification Service.
//
// Creates an endpoint for a device and mobile app on one of the supported push
// notification services, such as GCM and APNS. CreatePlatformEndpoint requires
// the PlatformApplicationArn that is returned from CreatePlatformApplication.
// The EndpointArn that is returned when using CreatePlatformEndpoint can then
// be used by the Publish action to send a message to a mobile app or by the
// Subscribe action for subscription to a topic. The CreatePlatformEndpoint
// action is idempotent, so if the requester already owns an endpoint with the
// same device token and attributes, that endpoint's ARN is returned without
// creating a new endpoint. For more information, see Using Amazon SNS Mobile
// Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
//
// When using CreatePlatformEndpoint with Baidu, two attributes must be provided:
// ChannelId and UserId. The token field must also contain the ChannelId. For
// more information, see Creating an Amazon SNS Endpoint for Baidu (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePushBaiduEndpoint.html).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation CreatePlatformEndpoint for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// * ErrCodeNotFoundException "NotFound"
// Indicates that the requested resource does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformEndpoint
func (c *SNS) CreatePlatformEndpoint(input *CreatePlatformEndpointInput) (*CreatePlatformEndpointOutput, error) {
req, out := c.CreatePlatformEndpointRequest(input)
return out, req.Send()
}
// CreatePlatformEndpointWithContext is the same as CreatePlatformEndpoint with the addition of
// the ability to pass a context and additional request options.
//
// See CreatePlatformEndpoint for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) CreatePlatformEndpointWithContext(ctx aws.Context, input *CreatePlatformEndpointInput, opts ...request.Option) (*CreatePlatformEndpointOutput, error) {
req, out := c.CreatePlatformEndpointRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateTopic = "CreateTopic"
// CreateTopicRequest generates a "aws/request.Request" representing the
// client's request for the CreateTopic operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateTopic for more information on using the CreateTopic
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateTopicRequest method.
// req, resp := client.CreateTopicRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopic
func (c *SNS) CreateTopicRequest(input *CreateTopicInput) (req *request.Request, output *CreateTopicOutput) {
op := &request.Operation{
Name: opCreateTopic,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateTopicInput{}
}
output = &CreateTopicOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateTopic API operation for Amazon Simple Notification Service.
//
// Creates a topic to which notifications can be published. Users can create
// at most 100,000 topics. For more information, see http://aws.amazon.com/sns
// (http://aws.amazon.com/sns/). This action is idempotent, so if the requester
// already owns a topic with the specified name, that topic's ARN is returned
// without creating a new topic.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation CreateTopic for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// * ErrCodeTopicLimitExceededException "TopicLimitExceeded"
// Indicates that the customer already owns the maximum allowed number of topics.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopic
func (c *SNS) CreateTopic(input *CreateTopicInput) (*CreateTopicOutput, error) {
req, out := c.CreateTopicRequest(input)
return out, req.Send()
}
// CreateTopicWithContext is the same as CreateTopic with the addition of
// the ability to pass a context and additional request options.
//
// See CreateTopic for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) CreateTopicWithContext(ctx aws.Context, input *CreateTopicInput, opts ...request.Option) (*CreateTopicOutput, error) {
req, out := c.CreateTopicRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteEndpoint = "DeleteEndpoint"
// DeleteEndpointRequest generates a "aws/request.Request" representing the
// client's request for the DeleteEndpoint operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteEndpoint for more information on using the DeleteEndpoint
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteEndpointRequest method.
// req, resp := client.DeleteEndpointRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteEndpoint
func (c *SNS) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Request, output *DeleteEndpointOutput) {
op := &request.Operation{
Name: opDeleteEndpoint,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteEndpointInput{}
}
output = &DeleteEndpointOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteEndpoint API operation for Amazon Simple Notification Service.
//
// Deletes the endpoint for a device and mobile app from Amazon SNS. This action
// is idempotent. For more information, see Using Amazon SNS Mobile Push Notifications
// (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
//
// When you delete an endpoint that is also subscribed to a topic, then you
// must also unsubscribe the endpoint from the topic.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation DeleteEndpoint for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteEndpoint
func (c *SNS) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) {
req, out := c.DeleteEndpointRequest(input)
return out, req.Send()
}
// DeleteEndpointWithContext is the same as DeleteEndpoint with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteEndpoint for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) DeleteEndpointWithContext(ctx aws.Context, input *DeleteEndpointInput, opts ...request.Option) (*DeleteEndpointOutput, error) {
req, out := c.DeleteEndpointRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeletePlatformApplication = "DeletePlatformApplication"
// DeletePlatformApplicationRequest generates a "aws/request.Request" representing the
// client's request for the DeletePlatformApplication operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeletePlatformApplication for more information on using the DeletePlatformApplication
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeletePlatformApplicationRequest method.
// req, resp := client.DeletePlatformApplicationRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeletePlatformApplication
func (c *SNS) DeletePlatformApplicationRequest(input *DeletePlatformApplicationInput) (req *request.Request, output *DeletePlatformApplicationOutput) {
op := &request.Operation{
Name: opDeletePlatformApplication,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeletePlatformApplicationInput{}
}
output = &DeletePlatformApplicationOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// DeletePlatformApplication API operation for Amazon Simple Notification Service.
//
// Deletes a platform application object for one of the supported push notification
// services, such as APNS and GCM. For more information, see Using Amazon SNS
// Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation DeletePlatformApplication for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeletePlatformApplication
func (c *SNS) DeletePlatformApplication(input *DeletePlatformApplicationInput) (*DeletePlatformApplicationOutput, error) {
req, out := c.DeletePlatformApplicationRequest(input)
return out, req.Send()
}
// DeletePlatformApplicationWithContext is the same as DeletePlatformApplication with the addition of
// the ability to pass a context and additional request options.
//
// See DeletePlatformApplication for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) DeletePlatformApplicationWithContext(ctx aws.Context, input *DeletePlatformApplicationInput, opts ...request.Option) (*DeletePlatformApplicationOutput, error) {
req, out := c.DeletePlatformApplicationRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteTopic = "DeleteTopic"
// DeleteTopicRequest generates a "aws/request.Request" representing the
// client's request for the DeleteTopic operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteTopic for more information on using the DeleteTopic
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteTopicRequest method.
// req, resp := client.DeleteTopicRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteTopic
func (c *SNS) DeleteTopicRequest(input *DeleteTopicInput) (req *request.Request, output *DeleteTopicOutput) {
op := &request.Operation{
Name: opDeleteTopic,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteTopicInput{}
}
output = &DeleteTopicOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteTopic API operation for Amazon Simple Notification Service.
//
// Deletes a topic and all its subscriptions. Deleting a topic might prevent
// some messages previously sent to the topic from being delivered to subscribers.
// This action is idempotent, so deleting a topic that does not exist does not
// result in an error.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation DeleteTopic for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// * ErrCodeNotFoundException "NotFound"
// Indicates that the requested resource does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteTopic
func (c *SNS) DeleteTopic(input *DeleteTopicInput) (*DeleteTopicOutput, error) {
req, out := c.DeleteTopicRequest(input)
return out, req.Send()
}
// DeleteTopicWithContext is the same as DeleteTopic with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteTopic for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) DeleteTopicWithContext(ctx aws.Context, input *DeleteTopicInput, opts ...request.Option) (*DeleteTopicOutput, error) {
req, out := c.DeleteTopicRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetEndpointAttributes = "GetEndpointAttributes"
// GetEndpointAttributesRequest generates a "aws/request.Request" representing the
// client's request for the GetEndpointAttributes operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetEndpointAttributes for more information on using the GetEndpointAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetEndpointAttributesRequest method.
// req, resp := client.GetEndpointAttributesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetEndpointAttributes
func (c *SNS) GetEndpointAttributesRequest(input *GetEndpointAttributesInput) (req *request.Request, output *GetEndpointAttributesOutput) {
op := &request.Operation{
Name: opGetEndpointAttributes,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetEndpointAttributesInput{}
}
output = &GetEndpointAttributesOutput{}
req = c.newRequest(op, input, output)
return
}
// GetEndpointAttributes API operation for Amazon Simple Notification Service.
//
// Retrieves the endpoint attributes for a device on one of the supported push
// notification services, such as GCM and APNS. For more information, see Using
// Amazon SNS Mobile Push Notifications (http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Simple Notification Service's
// API operation GetEndpointAttributes for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameter"
// Indicates that a request parameter does not comply with the associated constraints.
//
// * ErrCodeInternalErrorException "InternalError"
// Indicates an internal service error.
//
// * ErrCodeAuthorizationErrorException "AuthorizationError"
// Indicates that the user has been denied access to the requested resource.
//
// * ErrCodeNotFoundException "NotFound"
// Indicates that the requested resource does not exist.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetEndpointAttributes
func (c *SNS) GetEndpointAttributes(input *GetEndpointAttributesInput) (*GetEndpointAttributesOutput, error) {
req, out := c.GetEndpointAttributesRequest(input)
return out, req.Send()
}
// GetEndpointAttributesWithContext is the same as GetEndpointAttributes with the addition of
// the ability to pass a context and additional request options.
//
// See GetEndpointAttributes for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *SNS) GetEndpointAttributesWithContext(ctx aws.Context, input *GetEndpointAttributesInput, opts ...request.Option) (*GetEndpointAttributesOutput, error) {
req, out := c.GetEndpointAttributesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetPlatformApplicationAttributes = "GetPlatformApplicationAttributes"
// GetPlatformApplicationAttributesRequest generates a "aws/request.Request" representing the
// client's request for the GetPlatformApplicationAttributes operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetPlatformApplicationAttributes for more information on using the GetPlatformApplicationAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetPlatformApplicationAttributesRequest method.
// req, resp := client.GetPlatformApplicationAttributesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetPlatformApplicationAttributes
func (c *SNS) GetPlatformApplicationAttributesRequest(input *GetPlatformApplicationAttributesInput) (req *request.Request, output *GetPlatformApplicationAttributesOutput) {
op := &request.Operation{
Name: opGetPlatformApplicationAttributes,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetPlatformApplicationAttributesInput{}
}
output = &GetPlatformApplicationAttributesOutput{}
req = c.newRequest(op, input, output)