1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package sns 4 5import ( 6 "fmt" 7 8 "github.com/aws/aws-sdk-go/aws" 9 "github.com/aws/aws-sdk-go/aws/awsutil" 10 "github.com/aws/aws-sdk-go/aws/request" 11 "github.com/aws/aws-sdk-go/private/protocol" 12 "github.com/aws/aws-sdk-go/private/protocol/query" 13) 14 15const opAddPermission = "AddPermission" 16 17// AddPermissionRequest generates a "aws/request.Request" representing the 18// client's request for the AddPermission operation. The "output" return 19// value will be populated with the request's response once the request completes 20// successfully. 21// 22// Use "Send" method on the returned Request to send the API call to the service. 23// the "output" return value is not valid until after Send returns without error. 24// 25// See AddPermission for more information on using the AddPermission 26// API call, and error handling. 27// 28// This method is useful when you want to inject custom logic or configuration 29// into the SDK's request lifecycle. Such as custom headers, or retry logic. 30// 31// 32// // Example sending a request using the AddPermissionRequest method. 33// req, resp := client.AddPermissionRequest(params) 34// 35// err := req.Send() 36// if err == nil { // resp is now filled 37// fmt.Println(resp) 38// } 39// 40// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/AddPermission 41func (c *SNS) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput) { 42 op := &request.Operation{ 43 Name: opAddPermission, 44 HTTPMethod: "POST", 45 HTTPPath: "/", 46 } 47 48 if input == nil { 49 input = &AddPermissionInput{} 50 } 51 52 output = &AddPermissionOutput{} 53 req = c.newRequest(op, input, output) 54 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 55 return 56} 57 58// AddPermission API operation for Amazon Simple Notification Service. 59// 60// Adds a statement to a topic's access control policy, granting access for 61// the specified AWS accounts to the specified actions. 62// 63// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 64// with awserr.Error's Code and Message methods to get detailed information about 65// the error. 66// 67// See the AWS API reference guide for Amazon Simple Notification Service's 68// API operation AddPermission for usage and error information. 69// 70// Returned Error Codes: 71// * ErrCodeInvalidParameterException "InvalidParameter" 72// Indicates that a request parameter does not comply with the associated constraints. 73// 74// * ErrCodeInternalErrorException "InternalError" 75// Indicates an internal service error. 76// 77// * ErrCodeAuthorizationErrorException "AuthorizationError" 78// Indicates that the user has been denied access to the requested resource. 79// 80// * ErrCodeNotFoundException "NotFound" 81// Indicates that the requested resource does not exist. 82// 83// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/AddPermission 84func (c *SNS) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) { 85 req, out := c.AddPermissionRequest(input) 86 return out, req.Send() 87} 88 89// AddPermissionWithContext is the same as AddPermission with the addition of 90// the ability to pass a context and additional request options. 91// 92// See AddPermission for details on how to use this API operation. 93// 94// The context must be non-nil and will be used for request cancellation. If 95// the context is nil a panic will occur. In the future the SDK may create 96// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 97// for more information on using Contexts. 98func (c *SNS) AddPermissionWithContext(ctx aws.Context, input *AddPermissionInput, opts ...request.Option) (*AddPermissionOutput, error) { 99 req, out := c.AddPermissionRequest(input) 100 req.SetContext(ctx) 101 req.ApplyOptions(opts...) 102 return out, req.Send() 103} 104 105const opCheckIfPhoneNumberIsOptedOut = "CheckIfPhoneNumberIsOptedOut" 106 107// CheckIfPhoneNumberIsOptedOutRequest generates a "aws/request.Request" representing the 108// client's request for the CheckIfPhoneNumberIsOptedOut operation. The "output" return 109// value will be populated with the request's response once the request completes 110// successfully. 111// 112// Use "Send" method on the returned Request to send the API call to the service. 113// the "output" return value is not valid until after Send returns without error. 114// 115// See CheckIfPhoneNumberIsOptedOut for more information on using the CheckIfPhoneNumberIsOptedOut 116// API call, and error handling. 117// 118// This method is useful when you want to inject custom logic or configuration 119// into the SDK's request lifecycle. Such as custom headers, or retry logic. 120// 121// 122// // Example sending a request using the CheckIfPhoneNumberIsOptedOutRequest method. 123// req, resp := client.CheckIfPhoneNumberIsOptedOutRequest(params) 124// 125// err := req.Send() 126// if err == nil { // resp is now filled 127// fmt.Println(resp) 128// } 129// 130// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOut 131func (c *SNS) CheckIfPhoneNumberIsOptedOutRequest(input *CheckIfPhoneNumberIsOptedOutInput) (req *request.Request, output *CheckIfPhoneNumberIsOptedOutOutput) { 132 op := &request.Operation{ 133 Name: opCheckIfPhoneNumberIsOptedOut, 134 HTTPMethod: "POST", 135 HTTPPath: "/", 136 } 137 138 if input == nil { 139 input = &CheckIfPhoneNumberIsOptedOutInput{} 140 } 141 142 output = &CheckIfPhoneNumberIsOptedOutOutput{} 143 req = c.newRequest(op, input, output) 144 return 145} 146 147// CheckIfPhoneNumberIsOptedOut API operation for Amazon Simple Notification Service. 148// 149// Accepts a phone number and indicates whether the phone holder has opted out 150// of receiving SMS messages from your account. You cannot send SMS messages 151// to a number that is opted out. 152// 153// To resume sending messages, you can opt in the number by using the OptInPhoneNumber 154// action. 155// 156// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 157// with awserr.Error's Code and Message methods to get detailed information about 158// the error. 159// 160// See the AWS API reference guide for Amazon Simple Notification Service's 161// API operation CheckIfPhoneNumberIsOptedOut for usage and error information. 162// 163// Returned Error Codes: 164// * ErrCodeThrottledException "Throttled" 165// Indicates that the rate at which requests have been submitted for this action 166// exceeds the limit for your account. 167// 168// * ErrCodeInternalErrorException "InternalError" 169// Indicates an internal service error. 170// 171// * ErrCodeAuthorizationErrorException "AuthorizationError" 172// Indicates that the user has been denied access to the requested resource. 173// 174// * ErrCodeInvalidParameterException "InvalidParameter" 175// Indicates that a request parameter does not comply with the associated constraints. 176// 177// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOut 178func (c *SNS) CheckIfPhoneNumberIsOptedOut(input *CheckIfPhoneNumberIsOptedOutInput) (*CheckIfPhoneNumberIsOptedOutOutput, error) { 179 req, out := c.CheckIfPhoneNumberIsOptedOutRequest(input) 180 return out, req.Send() 181} 182 183// CheckIfPhoneNumberIsOptedOutWithContext is the same as CheckIfPhoneNumberIsOptedOut with the addition of 184// the ability to pass a context and additional request options. 185// 186// See CheckIfPhoneNumberIsOptedOut for details on how to use this API operation. 187// 188// The context must be non-nil and will be used for request cancellation. If 189// the context is nil a panic will occur. In the future the SDK may create 190// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 191// for more information on using Contexts. 192func (c *SNS) CheckIfPhoneNumberIsOptedOutWithContext(ctx aws.Context, input *CheckIfPhoneNumberIsOptedOutInput, opts ...request.Option) (*CheckIfPhoneNumberIsOptedOutOutput, error) { 193 req, out := c.CheckIfPhoneNumberIsOptedOutRequest(input) 194 req.SetContext(ctx) 195 req.ApplyOptions(opts...) 196 return out, req.Send() 197} 198 199const opConfirmSubscription = "ConfirmSubscription" 200 201// ConfirmSubscriptionRequest generates a "aws/request.Request" representing the 202// client's request for the ConfirmSubscription operation. The "output" return 203// value will be populated with the request's response once the request completes 204// successfully. 205// 206// Use "Send" method on the returned Request to send the API call to the service. 207// the "output" return value is not valid until after Send returns without error. 208// 209// See ConfirmSubscription for more information on using the ConfirmSubscription 210// API call, and error handling. 211// 212// This method is useful when you want to inject custom logic or configuration 213// into the SDK's request lifecycle. Such as custom headers, or retry logic. 214// 215// 216// // Example sending a request using the ConfirmSubscriptionRequest method. 217// req, resp := client.ConfirmSubscriptionRequest(params) 218// 219// err := req.Send() 220// if err == nil { // resp is now filled 221// fmt.Println(resp) 222// } 223// 224// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscription 225func (c *SNS) ConfirmSubscriptionRequest(input *ConfirmSubscriptionInput) (req *request.Request, output *ConfirmSubscriptionOutput) { 226 op := &request.Operation{ 227 Name: opConfirmSubscription, 228 HTTPMethod: "POST", 229 HTTPPath: "/", 230 } 231 232 if input == nil { 233 input = &ConfirmSubscriptionInput{} 234 } 235 236 output = &ConfirmSubscriptionOutput{} 237 req = c.newRequest(op, input, output) 238 return 239} 240 241// ConfirmSubscription API operation for Amazon Simple Notification Service. 242// 243// Verifies an endpoint owner's intent to receive messages by validating the 244// token sent to the endpoint by an earlier Subscribe action. If the token is 245// valid, the action creates a new subscription and returns its Amazon Resource 246// Name (ARN). This call requires an AWS signature only when the AuthenticateOnUnsubscribe 247// flag is set to "true". 248// 249// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 250// with awserr.Error's Code and Message methods to get detailed information about 251// the error. 252// 253// See the AWS API reference guide for Amazon Simple Notification Service's 254// API operation ConfirmSubscription for usage and error information. 255// 256// Returned Error Codes: 257// * ErrCodeSubscriptionLimitExceededException "SubscriptionLimitExceeded" 258// Indicates that the customer already owns the maximum allowed number of subscriptions. 259// 260// * ErrCodeInvalidParameterException "InvalidParameter" 261// Indicates that a request parameter does not comply with the associated constraints. 262// 263// * ErrCodeNotFoundException "NotFound" 264// Indicates that the requested resource does not exist. 265// 266// * ErrCodeInternalErrorException "InternalError" 267// Indicates an internal service error. 268// 269// * ErrCodeAuthorizationErrorException "AuthorizationError" 270// Indicates that the user has been denied access to the requested resource. 271// 272// * ErrCodeFilterPolicyLimitExceededException "FilterPolicyLimitExceeded" 273// Indicates that the number of filter polices in your AWS account exceeds the 274// limit. To add more filter polices, submit an SNS Limit Increase case in the 275// AWS Support Center. 276// 277// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscription 278func (c *SNS) ConfirmSubscription(input *ConfirmSubscriptionInput) (*ConfirmSubscriptionOutput, error) { 279 req, out := c.ConfirmSubscriptionRequest(input) 280 return out, req.Send() 281} 282 283// ConfirmSubscriptionWithContext is the same as ConfirmSubscription with the addition of 284// the ability to pass a context and additional request options. 285// 286// See ConfirmSubscription for details on how to use this API operation. 287// 288// The context must be non-nil and will be used for request cancellation. If 289// the context is nil a panic will occur. In the future the SDK may create 290// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 291// for more information on using Contexts. 292func (c *SNS) ConfirmSubscriptionWithContext(ctx aws.Context, input *ConfirmSubscriptionInput, opts ...request.Option) (*ConfirmSubscriptionOutput, error) { 293 req, out := c.ConfirmSubscriptionRequest(input) 294 req.SetContext(ctx) 295 req.ApplyOptions(opts...) 296 return out, req.Send() 297} 298 299const opCreatePlatformApplication = "CreatePlatformApplication" 300 301// CreatePlatformApplicationRequest generates a "aws/request.Request" representing the 302// client's request for the CreatePlatformApplication operation. The "output" return 303// value will be populated with the request's response once the request completes 304// successfully. 305// 306// Use "Send" method on the returned Request to send the API call to the service. 307// the "output" return value is not valid until after Send returns without error. 308// 309// See CreatePlatformApplication for more information on using the CreatePlatformApplication 310// API call, and error handling. 311// 312// This method is useful when you want to inject custom logic or configuration 313// into the SDK's request lifecycle. Such as custom headers, or retry logic. 314// 315// 316// // Example sending a request using the CreatePlatformApplicationRequest method. 317// req, resp := client.CreatePlatformApplicationRequest(params) 318// 319// err := req.Send() 320// if err == nil { // resp is now filled 321// fmt.Println(resp) 322// } 323// 324// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformApplication 325func (c *SNS) CreatePlatformApplicationRequest(input *CreatePlatformApplicationInput) (req *request.Request, output *CreatePlatformApplicationOutput) { 326 op := &request.Operation{ 327 Name: opCreatePlatformApplication, 328 HTTPMethod: "POST", 329 HTTPPath: "/", 330 } 331 332 if input == nil { 333 input = &CreatePlatformApplicationInput{} 334 } 335 336 output = &CreatePlatformApplicationOutput{} 337 req = c.newRequest(op, input, output) 338 return 339} 340 341// CreatePlatformApplication API operation for Amazon Simple Notification Service. 342// 343// Creates a platform application object for one of the supported push notification 344// services, such as APNS and GCM (Firebase Cloud Messaging), to which devices 345// and mobile apps may register. You must specify PlatformPrincipal and PlatformCredential 346// attributes when using the CreatePlatformApplication action. 347// 348// PlatformPrincipal and PlatformCredential are received from the notification 349// service. 350// 351// * For ADM, PlatformPrincipal is client id and PlatformCredential is client 352// secret. 353// 354// * For Baidu, PlatformPrincipal is API key and PlatformCredential is secret 355// key. 356// 357// * For APNS and APNS_SANDBOX, PlatformPrincipal is SSL certificate and 358// PlatformCredential is private key. 359// 360// * For GCM (Firebase Cloud Messaging), there is no PlatformPrincipal and 361// the PlatformCredential is API key. 362// 363// * For MPNS, PlatformPrincipal is TLS certificate and PlatformCredential 364// is private key. 365// 366// * For WNS, PlatformPrincipal is Package Security Identifier and PlatformCredential 367// is secret key. 368// 369// You can use the returned PlatformApplicationArn as an attribute for the CreatePlatformEndpoint 370// action. 371// 372// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 373// with awserr.Error's Code and Message methods to get detailed information about 374// the error. 375// 376// See the AWS API reference guide for Amazon Simple Notification Service's 377// API operation CreatePlatformApplication for usage and error information. 378// 379// Returned Error Codes: 380// * ErrCodeInvalidParameterException "InvalidParameter" 381// Indicates that a request parameter does not comply with the associated constraints. 382// 383// * ErrCodeInternalErrorException "InternalError" 384// Indicates an internal service error. 385// 386// * ErrCodeAuthorizationErrorException "AuthorizationError" 387// Indicates that the user has been denied access to the requested resource. 388// 389// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformApplication 390func (c *SNS) CreatePlatformApplication(input *CreatePlatformApplicationInput) (*CreatePlatformApplicationOutput, error) { 391 req, out := c.CreatePlatformApplicationRequest(input) 392 return out, req.Send() 393} 394 395// CreatePlatformApplicationWithContext is the same as CreatePlatformApplication with the addition of 396// the ability to pass a context and additional request options. 397// 398// See CreatePlatformApplication for details on how to use this API operation. 399// 400// The context must be non-nil and will be used for request cancellation. If 401// the context is nil a panic will occur. In the future the SDK may create 402// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 403// for more information on using Contexts. 404func (c *SNS) CreatePlatformApplicationWithContext(ctx aws.Context, input *CreatePlatformApplicationInput, opts ...request.Option) (*CreatePlatformApplicationOutput, error) { 405 req, out := c.CreatePlatformApplicationRequest(input) 406 req.SetContext(ctx) 407 req.ApplyOptions(opts...) 408 return out, req.Send() 409} 410 411const opCreatePlatformEndpoint = "CreatePlatformEndpoint" 412 413// CreatePlatformEndpointRequest generates a "aws/request.Request" representing the 414// client's request for the CreatePlatformEndpoint operation. The "output" return 415// value will be populated with the request's response once the request completes 416// successfully. 417// 418// Use "Send" method on the returned Request to send the API call to the service. 419// the "output" return value is not valid until after Send returns without error. 420// 421// See CreatePlatformEndpoint for more information on using the CreatePlatformEndpoint 422// API call, and error handling. 423// 424// This method is useful when you want to inject custom logic or configuration 425// into the SDK's request lifecycle. Such as custom headers, or retry logic. 426// 427// 428// // Example sending a request using the CreatePlatformEndpointRequest method. 429// req, resp := client.CreatePlatformEndpointRequest(params) 430// 431// err := req.Send() 432// if err == nil { // resp is now filled 433// fmt.Println(resp) 434// } 435// 436// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformEndpoint 437func (c *SNS) CreatePlatformEndpointRequest(input *CreatePlatformEndpointInput) (req *request.Request, output *CreatePlatformEndpointOutput) { 438 op := &request.Operation{ 439 Name: opCreatePlatformEndpoint, 440 HTTPMethod: "POST", 441 HTTPPath: "/", 442 } 443 444 if input == nil { 445 input = &CreatePlatformEndpointInput{} 446 } 447 448 output = &CreatePlatformEndpointOutput{} 449 req = c.newRequest(op, input, output) 450 return 451} 452 453// CreatePlatformEndpoint API operation for Amazon Simple Notification Service. 454// 455// Creates an endpoint for a device and mobile app on one of the supported push 456// notification services, such as GCM (Firebase Cloud Messaging) and APNS. CreatePlatformEndpoint 457// requires the PlatformApplicationArn that is returned from CreatePlatformApplication. 458// You can use the returned EndpointArn to send a message to a mobile app or 459// by the Subscribe action for subscription to a topic. The CreatePlatformEndpoint 460// action is idempotent, so if the requester already owns an endpoint with the 461// same device token and attributes, that endpoint's ARN is returned without 462// creating a new endpoint. For more information, see Using Amazon SNS Mobile 463// Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 464// 465// When using CreatePlatformEndpoint with Baidu, two attributes must be provided: 466// ChannelId and UserId. The token field must also contain the ChannelId. For 467// more information, see Creating an Amazon SNS Endpoint for Baidu (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePushBaiduEndpoint.html). 468// 469// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 470// with awserr.Error's Code and Message methods to get detailed information about 471// the error. 472// 473// See the AWS API reference guide for Amazon Simple Notification Service's 474// API operation CreatePlatformEndpoint for usage and error information. 475// 476// Returned Error Codes: 477// * ErrCodeInvalidParameterException "InvalidParameter" 478// Indicates that a request parameter does not comply with the associated constraints. 479// 480// * ErrCodeInternalErrorException "InternalError" 481// Indicates an internal service error. 482// 483// * ErrCodeAuthorizationErrorException "AuthorizationError" 484// Indicates that the user has been denied access to the requested resource. 485// 486// * ErrCodeNotFoundException "NotFound" 487// Indicates that the requested resource does not exist. 488// 489// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreatePlatformEndpoint 490func (c *SNS) CreatePlatformEndpoint(input *CreatePlatformEndpointInput) (*CreatePlatformEndpointOutput, error) { 491 req, out := c.CreatePlatformEndpointRequest(input) 492 return out, req.Send() 493} 494 495// CreatePlatformEndpointWithContext is the same as CreatePlatformEndpoint with the addition of 496// the ability to pass a context and additional request options. 497// 498// See CreatePlatformEndpoint for details on how to use this API operation. 499// 500// The context must be non-nil and will be used for request cancellation. If 501// the context is nil a panic will occur. In the future the SDK may create 502// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 503// for more information on using Contexts. 504func (c *SNS) CreatePlatformEndpointWithContext(ctx aws.Context, input *CreatePlatformEndpointInput, opts ...request.Option) (*CreatePlatformEndpointOutput, error) { 505 req, out := c.CreatePlatformEndpointRequest(input) 506 req.SetContext(ctx) 507 req.ApplyOptions(opts...) 508 return out, req.Send() 509} 510 511const opCreateTopic = "CreateTopic" 512 513// CreateTopicRequest generates a "aws/request.Request" representing the 514// client's request for the CreateTopic operation. The "output" return 515// value will be populated with the request's response once the request completes 516// successfully. 517// 518// Use "Send" method on the returned Request to send the API call to the service. 519// the "output" return value is not valid until after Send returns without error. 520// 521// See CreateTopic for more information on using the CreateTopic 522// API call, and error handling. 523// 524// This method is useful when you want to inject custom logic or configuration 525// into the SDK's request lifecycle. Such as custom headers, or retry logic. 526// 527// 528// // Example sending a request using the CreateTopicRequest method. 529// req, resp := client.CreateTopicRequest(params) 530// 531// err := req.Send() 532// if err == nil { // resp is now filled 533// fmt.Println(resp) 534// } 535// 536// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopic 537func (c *SNS) CreateTopicRequest(input *CreateTopicInput) (req *request.Request, output *CreateTopicOutput) { 538 op := &request.Operation{ 539 Name: opCreateTopic, 540 HTTPMethod: "POST", 541 HTTPPath: "/", 542 } 543 544 if input == nil { 545 input = &CreateTopicInput{} 546 } 547 548 output = &CreateTopicOutput{} 549 req = c.newRequest(op, input, output) 550 return 551} 552 553// CreateTopic API operation for Amazon Simple Notification Service. 554// 555// Creates a topic to which notifications can be published. Users can create 556// at most 100,000 standard topics (at most 1,000 FIFO topics). For more information, 557// see https://aws.amazon.com/sns (http://aws.amazon.com/sns/). This action 558// is idempotent, so if the requester already owns a topic with the specified 559// name, that topic's ARN is returned without creating a new topic. 560// 561// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 562// with awserr.Error's Code and Message methods to get detailed information about 563// the error. 564// 565// See the AWS API reference guide for Amazon Simple Notification Service's 566// API operation CreateTopic for usage and error information. 567// 568// Returned Error Codes: 569// * ErrCodeInvalidParameterException "InvalidParameter" 570// Indicates that a request parameter does not comply with the associated constraints. 571// 572// * ErrCodeTopicLimitExceededException "TopicLimitExceeded" 573// Indicates that the customer already owns the maximum allowed number of topics. 574// 575// * ErrCodeInternalErrorException "InternalError" 576// Indicates an internal service error. 577// 578// * ErrCodeAuthorizationErrorException "AuthorizationError" 579// Indicates that the user has been denied access to the requested resource. 580// 581// * ErrCodeInvalidSecurityException "InvalidSecurity" 582// The credential signature isn't valid. You must use an HTTPS endpoint and 583// sign your request using Signature Version 4. 584// 585// * ErrCodeTagLimitExceededException "TagLimitExceeded" 586// Can't add more than 50 tags to a topic. 587// 588// * ErrCodeStaleTagException "StaleTag" 589// A tag has been added to a resource with the same ARN as a deleted resource. 590// Wait a short while and then retry the operation. 591// 592// * ErrCodeTagPolicyException "TagPolicy" 593// The request doesn't comply with the IAM tag policy. Correct your request 594// and then retry it. 595// 596// * ErrCodeConcurrentAccessException "ConcurrentAccess" 597// Can't perform multiple operations on a tag simultaneously. Perform the operations 598// sequentially. 599// 600// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopic 601func (c *SNS) CreateTopic(input *CreateTopicInput) (*CreateTopicOutput, error) { 602 req, out := c.CreateTopicRequest(input) 603 return out, req.Send() 604} 605 606// CreateTopicWithContext is the same as CreateTopic with the addition of 607// the ability to pass a context and additional request options. 608// 609// See CreateTopic for details on how to use this API operation. 610// 611// The context must be non-nil and will be used for request cancellation. If 612// the context is nil a panic will occur. In the future the SDK may create 613// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 614// for more information on using Contexts. 615func (c *SNS) CreateTopicWithContext(ctx aws.Context, input *CreateTopicInput, opts ...request.Option) (*CreateTopicOutput, error) { 616 req, out := c.CreateTopicRequest(input) 617 req.SetContext(ctx) 618 req.ApplyOptions(opts...) 619 return out, req.Send() 620} 621 622const opDeleteEndpoint = "DeleteEndpoint" 623 624// DeleteEndpointRequest generates a "aws/request.Request" representing the 625// client's request for the DeleteEndpoint operation. The "output" return 626// value will be populated with the request's response once the request completes 627// successfully. 628// 629// Use "Send" method on the returned Request to send the API call to the service. 630// the "output" return value is not valid until after Send returns without error. 631// 632// See DeleteEndpoint for more information on using the DeleteEndpoint 633// API call, and error handling. 634// 635// This method is useful when you want to inject custom logic or configuration 636// into the SDK's request lifecycle. Such as custom headers, or retry logic. 637// 638// 639// // Example sending a request using the DeleteEndpointRequest method. 640// req, resp := client.DeleteEndpointRequest(params) 641// 642// err := req.Send() 643// if err == nil { // resp is now filled 644// fmt.Println(resp) 645// } 646// 647// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteEndpoint 648func (c *SNS) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Request, output *DeleteEndpointOutput) { 649 op := &request.Operation{ 650 Name: opDeleteEndpoint, 651 HTTPMethod: "POST", 652 HTTPPath: "/", 653 } 654 655 if input == nil { 656 input = &DeleteEndpointInput{} 657 } 658 659 output = &DeleteEndpointOutput{} 660 req = c.newRequest(op, input, output) 661 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 662 return 663} 664 665// DeleteEndpoint API operation for Amazon Simple Notification Service. 666// 667// Deletes the endpoint for a device and mobile app from Amazon SNS. This action 668// is idempotent. For more information, see Using Amazon SNS Mobile Push Notifications 669// (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 670// 671// When you delete an endpoint that is also subscribed to a topic, then you 672// must also unsubscribe the endpoint from the topic. 673// 674// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 675// with awserr.Error's Code and Message methods to get detailed information about 676// the error. 677// 678// See the AWS API reference guide for Amazon Simple Notification Service's 679// API operation DeleteEndpoint for usage and error information. 680// 681// Returned Error Codes: 682// * ErrCodeInvalidParameterException "InvalidParameter" 683// Indicates that a request parameter does not comply with the associated constraints. 684// 685// * ErrCodeInternalErrorException "InternalError" 686// Indicates an internal service error. 687// 688// * ErrCodeAuthorizationErrorException "AuthorizationError" 689// Indicates that the user has been denied access to the requested resource. 690// 691// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteEndpoint 692func (c *SNS) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) { 693 req, out := c.DeleteEndpointRequest(input) 694 return out, req.Send() 695} 696 697// DeleteEndpointWithContext is the same as DeleteEndpoint with the addition of 698// the ability to pass a context and additional request options. 699// 700// See DeleteEndpoint for details on how to use this API operation. 701// 702// The context must be non-nil and will be used for request cancellation. If 703// the context is nil a panic will occur. In the future the SDK may create 704// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 705// for more information on using Contexts. 706func (c *SNS) DeleteEndpointWithContext(ctx aws.Context, input *DeleteEndpointInput, opts ...request.Option) (*DeleteEndpointOutput, error) { 707 req, out := c.DeleteEndpointRequest(input) 708 req.SetContext(ctx) 709 req.ApplyOptions(opts...) 710 return out, req.Send() 711} 712 713const opDeletePlatformApplication = "DeletePlatformApplication" 714 715// DeletePlatformApplicationRequest generates a "aws/request.Request" representing the 716// client's request for the DeletePlatformApplication operation. The "output" return 717// value will be populated with the request's response once the request completes 718// successfully. 719// 720// Use "Send" method on the returned Request to send the API call to the service. 721// the "output" return value is not valid until after Send returns without error. 722// 723// See DeletePlatformApplication for more information on using the DeletePlatformApplication 724// API call, and error handling. 725// 726// This method is useful when you want to inject custom logic or configuration 727// into the SDK's request lifecycle. Such as custom headers, or retry logic. 728// 729// 730// // Example sending a request using the DeletePlatformApplicationRequest method. 731// req, resp := client.DeletePlatformApplicationRequest(params) 732// 733// err := req.Send() 734// if err == nil { // resp is now filled 735// fmt.Println(resp) 736// } 737// 738// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeletePlatformApplication 739func (c *SNS) DeletePlatformApplicationRequest(input *DeletePlatformApplicationInput) (req *request.Request, output *DeletePlatformApplicationOutput) { 740 op := &request.Operation{ 741 Name: opDeletePlatformApplication, 742 HTTPMethod: "POST", 743 HTTPPath: "/", 744 } 745 746 if input == nil { 747 input = &DeletePlatformApplicationInput{} 748 } 749 750 output = &DeletePlatformApplicationOutput{} 751 req = c.newRequest(op, input, output) 752 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 753 return 754} 755 756// DeletePlatformApplication API operation for Amazon Simple Notification Service. 757// 758// Deletes a platform application object for one of the supported push notification 759// services, such as APNS and GCM (Firebase Cloud Messaging). For more information, 760// see Using Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 761// 762// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 763// with awserr.Error's Code and Message methods to get detailed information about 764// the error. 765// 766// See the AWS API reference guide for Amazon Simple Notification Service's 767// API operation DeletePlatformApplication for usage and error information. 768// 769// Returned Error Codes: 770// * ErrCodeInvalidParameterException "InvalidParameter" 771// Indicates that a request parameter does not comply with the associated constraints. 772// 773// * ErrCodeInternalErrorException "InternalError" 774// Indicates an internal service error. 775// 776// * ErrCodeAuthorizationErrorException "AuthorizationError" 777// Indicates that the user has been denied access to the requested resource. 778// 779// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeletePlatformApplication 780func (c *SNS) DeletePlatformApplication(input *DeletePlatformApplicationInput) (*DeletePlatformApplicationOutput, error) { 781 req, out := c.DeletePlatformApplicationRequest(input) 782 return out, req.Send() 783} 784 785// DeletePlatformApplicationWithContext is the same as DeletePlatformApplication with the addition of 786// the ability to pass a context and additional request options. 787// 788// See DeletePlatformApplication for details on how to use this API operation. 789// 790// The context must be non-nil and will be used for request cancellation. If 791// the context is nil a panic will occur. In the future the SDK may create 792// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 793// for more information on using Contexts. 794func (c *SNS) DeletePlatformApplicationWithContext(ctx aws.Context, input *DeletePlatformApplicationInput, opts ...request.Option) (*DeletePlatformApplicationOutput, error) { 795 req, out := c.DeletePlatformApplicationRequest(input) 796 req.SetContext(ctx) 797 req.ApplyOptions(opts...) 798 return out, req.Send() 799} 800 801const opDeleteTopic = "DeleteTopic" 802 803// DeleteTopicRequest generates a "aws/request.Request" representing the 804// client's request for the DeleteTopic operation. The "output" return 805// value will be populated with the request's response once the request completes 806// successfully. 807// 808// Use "Send" method on the returned Request to send the API call to the service. 809// the "output" return value is not valid until after Send returns without error. 810// 811// See DeleteTopic for more information on using the DeleteTopic 812// API call, and error handling. 813// 814// This method is useful when you want to inject custom logic or configuration 815// into the SDK's request lifecycle. Such as custom headers, or retry logic. 816// 817// 818// // Example sending a request using the DeleteTopicRequest method. 819// req, resp := client.DeleteTopicRequest(params) 820// 821// err := req.Send() 822// if err == nil { // resp is now filled 823// fmt.Println(resp) 824// } 825// 826// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteTopic 827func (c *SNS) DeleteTopicRequest(input *DeleteTopicInput) (req *request.Request, output *DeleteTopicOutput) { 828 op := &request.Operation{ 829 Name: opDeleteTopic, 830 HTTPMethod: "POST", 831 HTTPPath: "/", 832 } 833 834 if input == nil { 835 input = &DeleteTopicInput{} 836 } 837 838 output = &DeleteTopicOutput{} 839 req = c.newRequest(op, input, output) 840 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 841 return 842} 843 844// DeleteTopic API operation for Amazon Simple Notification Service. 845// 846// Deletes a topic and all its subscriptions. Deleting a topic might prevent 847// some messages previously sent to the topic from being delivered to subscribers. 848// This action is idempotent, so deleting a topic that does not exist does not 849// result in an error. 850// 851// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 852// with awserr.Error's Code and Message methods to get detailed information about 853// the error. 854// 855// See the AWS API reference guide for Amazon Simple Notification Service's 856// API operation DeleteTopic for usage and error information. 857// 858// Returned Error Codes: 859// * ErrCodeInvalidParameterException "InvalidParameter" 860// Indicates that a request parameter does not comply with the associated constraints. 861// 862// * ErrCodeInternalErrorException "InternalError" 863// Indicates an internal service error. 864// 865// * ErrCodeAuthorizationErrorException "AuthorizationError" 866// Indicates that the user has been denied access to the requested resource. 867// 868// * ErrCodeNotFoundException "NotFound" 869// Indicates that the requested resource does not exist. 870// 871// * ErrCodeStaleTagException "StaleTag" 872// A tag has been added to a resource with the same ARN as a deleted resource. 873// Wait a short while and then retry the operation. 874// 875// * ErrCodeTagPolicyException "TagPolicy" 876// The request doesn't comply with the IAM tag policy. Correct your request 877// and then retry it. 878// 879// * ErrCodeConcurrentAccessException "ConcurrentAccess" 880// Can't perform multiple operations on a tag simultaneously. Perform the operations 881// sequentially. 882// 883// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/DeleteTopic 884func (c *SNS) DeleteTopic(input *DeleteTopicInput) (*DeleteTopicOutput, error) { 885 req, out := c.DeleteTopicRequest(input) 886 return out, req.Send() 887} 888 889// DeleteTopicWithContext is the same as DeleteTopic with the addition of 890// the ability to pass a context and additional request options. 891// 892// See DeleteTopic for details on how to use this API operation. 893// 894// The context must be non-nil and will be used for request cancellation. If 895// the context is nil a panic will occur. In the future the SDK may create 896// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 897// for more information on using Contexts. 898func (c *SNS) DeleteTopicWithContext(ctx aws.Context, input *DeleteTopicInput, opts ...request.Option) (*DeleteTopicOutput, error) { 899 req, out := c.DeleteTopicRequest(input) 900 req.SetContext(ctx) 901 req.ApplyOptions(opts...) 902 return out, req.Send() 903} 904 905const opGetEndpointAttributes = "GetEndpointAttributes" 906 907// GetEndpointAttributesRequest generates a "aws/request.Request" representing the 908// client's request for the GetEndpointAttributes operation. The "output" return 909// value will be populated with the request's response once the request completes 910// successfully. 911// 912// Use "Send" method on the returned Request to send the API call to the service. 913// the "output" return value is not valid until after Send returns without error. 914// 915// See GetEndpointAttributes for more information on using the GetEndpointAttributes 916// API call, and error handling. 917// 918// This method is useful when you want to inject custom logic or configuration 919// into the SDK's request lifecycle. Such as custom headers, or retry logic. 920// 921// 922// // Example sending a request using the GetEndpointAttributesRequest method. 923// req, resp := client.GetEndpointAttributesRequest(params) 924// 925// err := req.Send() 926// if err == nil { // resp is now filled 927// fmt.Println(resp) 928// } 929// 930// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetEndpointAttributes 931func (c *SNS) GetEndpointAttributesRequest(input *GetEndpointAttributesInput) (req *request.Request, output *GetEndpointAttributesOutput) { 932 op := &request.Operation{ 933 Name: opGetEndpointAttributes, 934 HTTPMethod: "POST", 935 HTTPPath: "/", 936 } 937 938 if input == nil { 939 input = &GetEndpointAttributesInput{} 940 } 941 942 output = &GetEndpointAttributesOutput{} 943 req = c.newRequest(op, input, output) 944 return 945} 946 947// GetEndpointAttributes API operation for Amazon Simple Notification Service. 948// 949// Retrieves the endpoint attributes for a device on one of the supported push 950// notification services, such as GCM (Firebase Cloud Messaging) and APNS. For 951// more information, see Using Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 952// 953// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 954// with awserr.Error's Code and Message methods to get detailed information about 955// the error. 956// 957// See the AWS API reference guide for Amazon Simple Notification Service's 958// API operation GetEndpointAttributes for usage and error information. 959// 960// Returned Error Codes: 961// * ErrCodeInvalidParameterException "InvalidParameter" 962// Indicates that a request parameter does not comply with the associated constraints. 963// 964// * ErrCodeInternalErrorException "InternalError" 965// Indicates an internal service error. 966// 967// * ErrCodeAuthorizationErrorException "AuthorizationError" 968// Indicates that the user has been denied access to the requested resource. 969// 970// * ErrCodeNotFoundException "NotFound" 971// Indicates that the requested resource does not exist. 972// 973// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetEndpointAttributes 974func (c *SNS) GetEndpointAttributes(input *GetEndpointAttributesInput) (*GetEndpointAttributesOutput, error) { 975 req, out := c.GetEndpointAttributesRequest(input) 976 return out, req.Send() 977} 978 979// GetEndpointAttributesWithContext is the same as GetEndpointAttributes with the addition of 980// the ability to pass a context and additional request options. 981// 982// See GetEndpointAttributes for details on how to use this API operation. 983// 984// The context must be non-nil and will be used for request cancellation. If 985// the context is nil a panic will occur. In the future the SDK may create 986// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 987// for more information on using Contexts. 988func (c *SNS) GetEndpointAttributesWithContext(ctx aws.Context, input *GetEndpointAttributesInput, opts ...request.Option) (*GetEndpointAttributesOutput, error) { 989 req, out := c.GetEndpointAttributesRequest(input) 990 req.SetContext(ctx) 991 req.ApplyOptions(opts...) 992 return out, req.Send() 993} 994 995const opGetPlatformApplicationAttributes = "GetPlatformApplicationAttributes" 996 997// GetPlatformApplicationAttributesRequest generates a "aws/request.Request" representing the 998// client's request for the GetPlatformApplicationAttributes operation. The "output" return 999// value will be populated with the request's response once the request completes 1000// successfully. 1001// 1002// Use "Send" method on the returned Request to send the API call to the service. 1003// the "output" return value is not valid until after Send returns without error. 1004// 1005// See GetPlatformApplicationAttributes for more information on using the GetPlatformApplicationAttributes 1006// API call, and error handling. 1007// 1008// This method is useful when you want to inject custom logic or configuration 1009// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1010// 1011// 1012// // Example sending a request using the GetPlatformApplicationAttributesRequest method. 1013// req, resp := client.GetPlatformApplicationAttributesRequest(params) 1014// 1015// err := req.Send() 1016// if err == nil { // resp is now filled 1017// fmt.Println(resp) 1018// } 1019// 1020// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetPlatformApplicationAttributes 1021func (c *SNS) GetPlatformApplicationAttributesRequest(input *GetPlatformApplicationAttributesInput) (req *request.Request, output *GetPlatformApplicationAttributesOutput) { 1022 op := &request.Operation{ 1023 Name: opGetPlatformApplicationAttributes, 1024 HTTPMethod: "POST", 1025 HTTPPath: "/", 1026 } 1027 1028 if input == nil { 1029 input = &GetPlatformApplicationAttributesInput{} 1030 } 1031 1032 output = &GetPlatformApplicationAttributesOutput{} 1033 req = c.newRequest(op, input, output) 1034 return 1035} 1036 1037// GetPlatformApplicationAttributes API operation for Amazon Simple Notification Service. 1038// 1039// Retrieves the attributes of the platform application object for the supported 1040// push notification services, such as APNS and GCM (Firebase Cloud Messaging). 1041// For more information, see Using Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 1042// 1043// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1044// with awserr.Error's Code and Message methods to get detailed information about 1045// the error. 1046// 1047// See the AWS API reference guide for Amazon Simple Notification Service's 1048// API operation GetPlatformApplicationAttributes for usage and error information. 1049// 1050// Returned Error Codes: 1051// * ErrCodeInvalidParameterException "InvalidParameter" 1052// Indicates that a request parameter does not comply with the associated constraints. 1053// 1054// * ErrCodeInternalErrorException "InternalError" 1055// Indicates an internal service error. 1056// 1057// * ErrCodeAuthorizationErrorException "AuthorizationError" 1058// Indicates that the user has been denied access to the requested resource. 1059// 1060// * ErrCodeNotFoundException "NotFound" 1061// Indicates that the requested resource does not exist. 1062// 1063// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetPlatformApplicationAttributes 1064func (c *SNS) GetPlatformApplicationAttributes(input *GetPlatformApplicationAttributesInput) (*GetPlatformApplicationAttributesOutput, error) { 1065 req, out := c.GetPlatformApplicationAttributesRequest(input) 1066 return out, req.Send() 1067} 1068 1069// GetPlatformApplicationAttributesWithContext is the same as GetPlatformApplicationAttributes with the addition of 1070// the ability to pass a context and additional request options. 1071// 1072// See GetPlatformApplicationAttributes for details on how to use this API operation. 1073// 1074// The context must be non-nil and will be used for request cancellation. If 1075// the context is nil a panic will occur. In the future the SDK may create 1076// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1077// for more information on using Contexts. 1078func (c *SNS) GetPlatformApplicationAttributesWithContext(ctx aws.Context, input *GetPlatformApplicationAttributesInput, opts ...request.Option) (*GetPlatformApplicationAttributesOutput, error) { 1079 req, out := c.GetPlatformApplicationAttributesRequest(input) 1080 req.SetContext(ctx) 1081 req.ApplyOptions(opts...) 1082 return out, req.Send() 1083} 1084 1085const opGetSMSAttributes = "GetSMSAttributes" 1086 1087// GetSMSAttributesRequest generates a "aws/request.Request" representing the 1088// client's request for the GetSMSAttributes operation. The "output" return 1089// value will be populated with the request's response once the request completes 1090// successfully. 1091// 1092// Use "Send" method on the returned Request to send the API call to the service. 1093// the "output" return value is not valid until after Send returns without error. 1094// 1095// See GetSMSAttributes for more information on using the GetSMSAttributes 1096// API call, and error handling. 1097// 1098// This method is useful when you want to inject custom logic or configuration 1099// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1100// 1101// 1102// // Example sending a request using the GetSMSAttributesRequest method. 1103// req, resp := client.GetSMSAttributesRequest(params) 1104// 1105// err := req.Send() 1106// if err == nil { // resp is now filled 1107// fmt.Println(resp) 1108// } 1109// 1110// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSMSAttributes 1111func (c *SNS) GetSMSAttributesRequest(input *GetSMSAttributesInput) (req *request.Request, output *GetSMSAttributesOutput) { 1112 op := &request.Operation{ 1113 Name: opGetSMSAttributes, 1114 HTTPMethod: "POST", 1115 HTTPPath: "/", 1116 } 1117 1118 if input == nil { 1119 input = &GetSMSAttributesInput{} 1120 } 1121 1122 output = &GetSMSAttributesOutput{} 1123 req = c.newRequest(op, input, output) 1124 return 1125} 1126 1127// GetSMSAttributes API operation for Amazon Simple Notification Service. 1128// 1129// Returns the settings for sending SMS messages from your account. 1130// 1131// These settings are set with the SetSMSAttributes action. 1132// 1133// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1134// with awserr.Error's Code and Message methods to get detailed information about 1135// the error. 1136// 1137// See the AWS API reference guide for Amazon Simple Notification Service's 1138// API operation GetSMSAttributes for usage and error information. 1139// 1140// Returned Error Codes: 1141// * ErrCodeThrottledException "Throttled" 1142// Indicates that the rate at which requests have been submitted for this action 1143// exceeds the limit for your account. 1144// 1145// * ErrCodeInternalErrorException "InternalError" 1146// Indicates an internal service error. 1147// 1148// * ErrCodeAuthorizationErrorException "AuthorizationError" 1149// Indicates that the user has been denied access to the requested resource. 1150// 1151// * ErrCodeInvalidParameterException "InvalidParameter" 1152// Indicates that a request parameter does not comply with the associated constraints. 1153// 1154// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSMSAttributes 1155func (c *SNS) GetSMSAttributes(input *GetSMSAttributesInput) (*GetSMSAttributesOutput, error) { 1156 req, out := c.GetSMSAttributesRequest(input) 1157 return out, req.Send() 1158} 1159 1160// GetSMSAttributesWithContext is the same as GetSMSAttributes with the addition of 1161// the ability to pass a context and additional request options. 1162// 1163// See GetSMSAttributes for details on how to use this API operation. 1164// 1165// The context must be non-nil and will be used for request cancellation. If 1166// the context is nil a panic will occur. In the future the SDK may create 1167// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1168// for more information on using Contexts. 1169func (c *SNS) GetSMSAttributesWithContext(ctx aws.Context, input *GetSMSAttributesInput, opts ...request.Option) (*GetSMSAttributesOutput, error) { 1170 req, out := c.GetSMSAttributesRequest(input) 1171 req.SetContext(ctx) 1172 req.ApplyOptions(opts...) 1173 return out, req.Send() 1174} 1175 1176const opGetSubscriptionAttributes = "GetSubscriptionAttributes" 1177 1178// GetSubscriptionAttributesRequest generates a "aws/request.Request" representing the 1179// client's request for the GetSubscriptionAttributes operation. The "output" return 1180// value will be populated with the request's response once the request completes 1181// successfully. 1182// 1183// Use "Send" method on the returned Request to send the API call to the service. 1184// the "output" return value is not valid until after Send returns without error. 1185// 1186// See GetSubscriptionAttributes for more information on using the GetSubscriptionAttributes 1187// API call, and error handling. 1188// 1189// This method is useful when you want to inject custom logic or configuration 1190// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1191// 1192// 1193// // Example sending a request using the GetSubscriptionAttributesRequest method. 1194// req, resp := client.GetSubscriptionAttributesRequest(params) 1195// 1196// err := req.Send() 1197// if err == nil { // resp is now filled 1198// fmt.Println(resp) 1199// } 1200// 1201// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSubscriptionAttributes 1202func (c *SNS) GetSubscriptionAttributesRequest(input *GetSubscriptionAttributesInput) (req *request.Request, output *GetSubscriptionAttributesOutput) { 1203 op := &request.Operation{ 1204 Name: opGetSubscriptionAttributes, 1205 HTTPMethod: "POST", 1206 HTTPPath: "/", 1207 } 1208 1209 if input == nil { 1210 input = &GetSubscriptionAttributesInput{} 1211 } 1212 1213 output = &GetSubscriptionAttributesOutput{} 1214 req = c.newRequest(op, input, output) 1215 return 1216} 1217 1218// GetSubscriptionAttributes API operation for Amazon Simple Notification Service. 1219// 1220// Returns all of the properties of a subscription. 1221// 1222// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1223// with awserr.Error's Code and Message methods to get detailed information about 1224// the error. 1225// 1226// See the AWS API reference guide for Amazon Simple Notification Service's 1227// API operation GetSubscriptionAttributes for usage and error information. 1228// 1229// Returned Error Codes: 1230// * ErrCodeInvalidParameterException "InvalidParameter" 1231// Indicates that a request parameter does not comply with the associated constraints. 1232// 1233// * ErrCodeInternalErrorException "InternalError" 1234// Indicates an internal service error. 1235// 1236// * ErrCodeNotFoundException "NotFound" 1237// Indicates that the requested resource does not exist. 1238// 1239// * ErrCodeAuthorizationErrorException "AuthorizationError" 1240// Indicates that the user has been denied access to the requested resource. 1241// 1242// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetSubscriptionAttributes 1243func (c *SNS) GetSubscriptionAttributes(input *GetSubscriptionAttributesInput) (*GetSubscriptionAttributesOutput, error) { 1244 req, out := c.GetSubscriptionAttributesRequest(input) 1245 return out, req.Send() 1246} 1247 1248// GetSubscriptionAttributesWithContext is the same as GetSubscriptionAttributes with the addition of 1249// the ability to pass a context and additional request options. 1250// 1251// See GetSubscriptionAttributes for details on how to use this API operation. 1252// 1253// The context must be non-nil and will be used for request cancellation. If 1254// the context is nil a panic will occur. In the future the SDK may create 1255// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1256// for more information on using Contexts. 1257func (c *SNS) GetSubscriptionAttributesWithContext(ctx aws.Context, input *GetSubscriptionAttributesInput, opts ...request.Option) (*GetSubscriptionAttributesOutput, error) { 1258 req, out := c.GetSubscriptionAttributesRequest(input) 1259 req.SetContext(ctx) 1260 req.ApplyOptions(opts...) 1261 return out, req.Send() 1262} 1263 1264const opGetTopicAttributes = "GetTopicAttributes" 1265 1266// GetTopicAttributesRequest generates a "aws/request.Request" representing the 1267// client's request for the GetTopicAttributes operation. The "output" return 1268// value will be populated with the request's response once the request completes 1269// successfully. 1270// 1271// Use "Send" method on the returned Request to send the API call to the service. 1272// the "output" return value is not valid until after Send returns without error. 1273// 1274// See GetTopicAttributes for more information on using the GetTopicAttributes 1275// API call, and error handling. 1276// 1277// This method is useful when you want to inject custom logic or configuration 1278// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1279// 1280// 1281// // Example sending a request using the GetTopicAttributesRequest method. 1282// req, resp := client.GetTopicAttributesRequest(params) 1283// 1284// err := req.Send() 1285// if err == nil { // resp is now filled 1286// fmt.Println(resp) 1287// } 1288// 1289// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetTopicAttributes 1290func (c *SNS) GetTopicAttributesRequest(input *GetTopicAttributesInput) (req *request.Request, output *GetTopicAttributesOutput) { 1291 op := &request.Operation{ 1292 Name: opGetTopicAttributes, 1293 HTTPMethod: "POST", 1294 HTTPPath: "/", 1295 } 1296 1297 if input == nil { 1298 input = &GetTopicAttributesInput{} 1299 } 1300 1301 output = &GetTopicAttributesOutput{} 1302 req = c.newRequest(op, input, output) 1303 return 1304} 1305 1306// GetTopicAttributes API operation for Amazon Simple Notification Service. 1307// 1308// Returns all of the properties of a topic. Topic properties returned might 1309// differ based on the authorization of the user. 1310// 1311// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1312// with awserr.Error's Code and Message methods to get detailed information about 1313// the error. 1314// 1315// See the AWS API reference guide for Amazon Simple Notification Service's 1316// API operation GetTopicAttributes for usage and error information. 1317// 1318// Returned Error Codes: 1319// * ErrCodeInvalidParameterException "InvalidParameter" 1320// Indicates that a request parameter does not comply with the associated constraints. 1321// 1322// * ErrCodeInternalErrorException "InternalError" 1323// Indicates an internal service error. 1324// 1325// * ErrCodeNotFoundException "NotFound" 1326// Indicates that the requested resource does not exist. 1327// 1328// * ErrCodeAuthorizationErrorException "AuthorizationError" 1329// Indicates that the user has been denied access to the requested resource. 1330// 1331// * ErrCodeInvalidSecurityException "InvalidSecurity" 1332// The credential signature isn't valid. You must use an HTTPS endpoint and 1333// sign your request using Signature Version 4. 1334// 1335// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetTopicAttributes 1336func (c *SNS) GetTopicAttributes(input *GetTopicAttributesInput) (*GetTopicAttributesOutput, error) { 1337 req, out := c.GetTopicAttributesRequest(input) 1338 return out, req.Send() 1339} 1340 1341// GetTopicAttributesWithContext is the same as GetTopicAttributes with the addition of 1342// the ability to pass a context and additional request options. 1343// 1344// See GetTopicAttributes for details on how to use this API operation. 1345// 1346// The context must be non-nil and will be used for request cancellation. If 1347// the context is nil a panic will occur. In the future the SDK may create 1348// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1349// for more information on using Contexts. 1350func (c *SNS) GetTopicAttributesWithContext(ctx aws.Context, input *GetTopicAttributesInput, opts ...request.Option) (*GetTopicAttributesOutput, error) { 1351 req, out := c.GetTopicAttributesRequest(input) 1352 req.SetContext(ctx) 1353 req.ApplyOptions(opts...) 1354 return out, req.Send() 1355} 1356 1357const opListEndpointsByPlatformApplication = "ListEndpointsByPlatformApplication" 1358 1359// ListEndpointsByPlatformApplicationRequest generates a "aws/request.Request" representing the 1360// client's request for the ListEndpointsByPlatformApplication operation. The "output" return 1361// value will be populated with the request's response once the request completes 1362// successfully. 1363// 1364// Use "Send" method on the returned Request to send the API call to the service. 1365// the "output" return value is not valid until after Send returns without error. 1366// 1367// See ListEndpointsByPlatformApplication for more information on using the ListEndpointsByPlatformApplication 1368// API call, and error handling. 1369// 1370// This method is useful when you want to inject custom logic or configuration 1371// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1372// 1373// 1374// // Example sending a request using the ListEndpointsByPlatformApplicationRequest method. 1375// req, resp := client.ListEndpointsByPlatformApplicationRequest(params) 1376// 1377// err := req.Send() 1378// if err == nil { // resp is now filled 1379// fmt.Println(resp) 1380// } 1381// 1382// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListEndpointsByPlatformApplication 1383func (c *SNS) ListEndpointsByPlatformApplicationRequest(input *ListEndpointsByPlatformApplicationInput) (req *request.Request, output *ListEndpointsByPlatformApplicationOutput) { 1384 op := &request.Operation{ 1385 Name: opListEndpointsByPlatformApplication, 1386 HTTPMethod: "POST", 1387 HTTPPath: "/", 1388 Paginator: &request.Paginator{ 1389 InputTokens: []string{"NextToken"}, 1390 OutputTokens: []string{"NextToken"}, 1391 LimitToken: "", 1392 TruncationToken: "", 1393 }, 1394 } 1395 1396 if input == nil { 1397 input = &ListEndpointsByPlatformApplicationInput{} 1398 } 1399 1400 output = &ListEndpointsByPlatformApplicationOutput{} 1401 req = c.newRequest(op, input, output) 1402 return 1403} 1404 1405// ListEndpointsByPlatformApplication API operation for Amazon Simple Notification Service. 1406// 1407// Lists the endpoints and endpoint attributes for devices in a supported push 1408// notification service, such as GCM (Firebase Cloud Messaging) and APNS. The 1409// results for ListEndpointsByPlatformApplication are paginated and return a 1410// limited list of endpoints, up to 100. If additional records are available 1411// after the first page results, then a NextToken string will be returned. To 1412// receive the next page, you call ListEndpointsByPlatformApplication again 1413// using the NextToken string received from the previous call. When there are 1414// no more records to return, NextToken will be null. For more information, 1415// see Using Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 1416// 1417// This action is throttled at 30 transactions per second (TPS). 1418// 1419// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1420// with awserr.Error's Code and Message methods to get detailed information about 1421// the error. 1422// 1423// See the AWS API reference guide for Amazon Simple Notification Service's 1424// API operation ListEndpointsByPlatformApplication for usage and error information. 1425// 1426// Returned Error Codes: 1427// * ErrCodeInvalidParameterException "InvalidParameter" 1428// Indicates that a request parameter does not comply with the associated constraints. 1429// 1430// * ErrCodeInternalErrorException "InternalError" 1431// Indicates an internal service error. 1432// 1433// * ErrCodeAuthorizationErrorException "AuthorizationError" 1434// Indicates that the user has been denied access to the requested resource. 1435// 1436// * ErrCodeNotFoundException "NotFound" 1437// Indicates that the requested resource does not exist. 1438// 1439// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListEndpointsByPlatformApplication 1440func (c *SNS) ListEndpointsByPlatformApplication(input *ListEndpointsByPlatformApplicationInput) (*ListEndpointsByPlatformApplicationOutput, error) { 1441 req, out := c.ListEndpointsByPlatformApplicationRequest(input) 1442 return out, req.Send() 1443} 1444 1445// ListEndpointsByPlatformApplicationWithContext is the same as ListEndpointsByPlatformApplication with the addition of 1446// the ability to pass a context and additional request options. 1447// 1448// See ListEndpointsByPlatformApplication for details on how to use this API operation. 1449// 1450// The context must be non-nil and will be used for request cancellation. If 1451// the context is nil a panic will occur. In the future the SDK may create 1452// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1453// for more information on using Contexts. 1454func (c *SNS) ListEndpointsByPlatformApplicationWithContext(ctx aws.Context, input *ListEndpointsByPlatformApplicationInput, opts ...request.Option) (*ListEndpointsByPlatformApplicationOutput, error) { 1455 req, out := c.ListEndpointsByPlatformApplicationRequest(input) 1456 req.SetContext(ctx) 1457 req.ApplyOptions(opts...) 1458 return out, req.Send() 1459} 1460 1461// ListEndpointsByPlatformApplicationPages iterates over the pages of a ListEndpointsByPlatformApplication operation, 1462// calling the "fn" function with the response data for each page. To stop 1463// iterating, return false from the fn function. 1464// 1465// See ListEndpointsByPlatformApplication method for more information on how to use this operation. 1466// 1467// Note: This operation can generate multiple requests to a service. 1468// 1469// // Example iterating over at most 3 pages of a ListEndpointsByPlatformApplication operation. 1470// pageNum := 0 1471// err := client.ListEndpointsByPlatformApplicationPages(params, 1472// func(page *sns.ListEndpointsByPlatformApplicationOutput, lastPage bool) bool { 1473// pageNum++ 1474// fmt.Println(page) 1475// return pageNum <= 3 1476// }) 1477// 1478func (c *SNS) ListEndpointsByPlatformApplicationPages(input *ListEndpointsByPlatformApplicationInput, fn func(*ListEndpointsByPlatformApplicationOutput, bool) bool) error { 1479 return c.ListEndpointsByPlatformApplicationPagesWithContext(aws.BackgroundContext(), input, fn) 1480} 1481 1482// ListEndpointsByPlatformApplicationPagesWithContext same as ListEndpointsByPlatformApplicationPages except 1483// it takes a Context and allows setting request options on the pages. 1484// 1485// The context must be non-nil and will be used for request cancellation. If 1486// the context is nil a panic will occur. In the future the SDK may create 1487// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1488// for more information on using Contexts. 1489func (c *SNS) ListEndpointsByPlatformApplicationPagesWithContext(ctx aws.Context, input *ListEndpointsByPlatformApplicationInput, fn func(*ListEndpointsByPlatformApplicationOutput, bool) bool, opts ...request.Option) error { 1490 p := request.Pagination{ 1491 NewRequest: func() (*request.Request, error) { 1492 var inCpy *ListEndpointsByPlatformApplicationInput 1493 if input != nil { 1494 tmp := *input 1495 inCpy = &tmp 1496 } 1497 req, _ := c.ListEndpointsByPlatformApplicationRequest(inCpy) 1498 req.SetContext(ctx) 1499 req.ApplyOptions(opts...) 1500 return req, nil 1501 }, 1502 } 1503 1504 for p.Next() { 1505 if !fn(p.Page().(*ListEndpointsByPlatformApplicationOutput), !p.HasNextPage()) { 1506 break 1507 } 1508 } 1509 1510 return p.Err() 1511} 1512 1513const opListPhoneNumbersOptedOut = "ListPhoneNumbersOptedOut" 1514 1515// ListPhoneNumbersOptedOutRequest generates a "aws/request.Request" representing the 1516// client's request for the ListPhoneNumbersOptedOut operation. The "output" return 1517// value will be populated with the request's response once the request completes 1518// successfully. 1519// 1520// Use "Send" method on the returned Request to send the API call to the service. 1521// the "output" return value is not valid until after Send returns without error. 1522// 1523// See ListPhoneNumbersOptedOut for more information on using the ListPhoneNumbersOptedOut 1524// API call, and error handling. 1525// 1526// This method is useful when you want to inject custom logic or configuration 1527// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1528// 1529// 1530// // Example sending a request using the ListPhoneNumbersOptedOutRequest method. 1531// req, resp := client.ListPhoneNumbersOptedOutRequest(params) 1532// 1533// err := req.Send() 1534// if err == nil { // resp is now filled 1535// fmt.Println(resp) 1536// } 1537// 1538// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPhoneNumbersOptedOut 1539func (c *SNS) ListPhoneNumbersOptedOutRequest(input *ListPhoneNumbersOptedOutInput) (req *request.Request, output *ListPhoneNumbersOptedOutOutput) { 1540 op := &request.Operation{ 1541 Name: opListPhoneNumbersOptedOut, 1542 HTTPMethod: "POST", 1543 HTTPPath: "/", 1544 } 1545 1546 if input == nil { 1547 input = &ListPhoneNumbersOptedOutInput{} 1548 } 1549 1550 output = &ListPhoneNumbersOptedOutOutput{} 1551 req = c.newRequest(op, input, output) 1552 return 1553} 1554 1555// ListPhoneNumbersOptedOut API operation for Amazon Simple Notification Service. 1556// 1557// Returns a list of phone numbers that are opted out, meaning you cannot send 1558// SMS messages to them. 1559// 1560// The results for ListPhoneNumbersOptedOut are paginated, and each page returns 1561// up to 100 phone numbers. If additional phone numbers are available after 1562// the first page of results, then a NextToken string will be returned. To receive 1563// the next page, you call ListPhoneNumbersOptedOut again using the NextToken 1564// string received from the previous call. When there are no more records to 1565// return, NextToken will be null. 1566// 1567// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1568// with awserr.Error's Code and Message methods to get detailed information about 1569// the error. 1570// 1571// See the AWS API reference guide for Amazon Simple Notification Service's 1572// API operation ListPhoneNumbersOptedOut for usage and error information. 1573// 1574// Returned Error Codes: 1575// * ErrCodeThrottledException "Throttled" 1576// Indicates that the rate at which requests have been submitted for this action 1577// exceeds the limit for your account. 1578// 1579// * ErrCodeInternalErrorException "InternalError" 1580// Indicates an internal service error. 1581// 1582// * ErrCodeAuthorizationErrorException "AuthorizationError" 1583// Indicates that the user has been denied access to the requested resource. 1584// 1585// * ErrCodeInvalidParameterException "InvalidParameter" 1586// Indicates that a request parameter does not comply with the associated constraints. 1587// 1588// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPhoneNumbersOptedOut 1589func (c *SNS) ListPhoneNumbersOptedOut(input *ListPhoneNumbersOptedOutInput) (*ListPhoneNumbersOptedOutOutput, error) { 1590 req, out := c.ListPhoneNumbersOptedOutRequest(input) 1591 return out, req.Send() 1592} 1593 1594// ListPhoneNumbersOptedOutWithContext is the same as ListPhoneNumbersOptedOut with the addition of 1595// the ability to pass a context and additional request options. 1596// 1597// See ListPhoneNumbersOptedOut for details on how to use this API operation. 1598// 1599// The context must be non-nil and will be used for request cancellation. If 1600// the context is nil a panic will occur. In the future the SDK may create 1601// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1602// for more information on using Contexts. 1603func (c *SNS) ListPhoneNumbersOptedOutWithContext(ctx aws.Context, input *ListPhoneNumbersOptedOutInput, opts ...request.Option) (*ListPhoneNumbersOptedOutOutput, error) { 1604 req, out := c.ListPhoneNumbersOptedOutRequest(input) 1605 req.SetContext(ctx) 1606 req.ApplyOptions(opts...) 1607 return out, req.Send() 1608} 1609 1610const opListPlatformApplications = "ListPlatformApplications" 1611 1612// ListPlatformApplicationsRequest generates a "aws/request.Request" representing the 1613// client's request for the ListPlatformApplications operation. The "output" return 1614// value will be populated with the request's response once the request completes 1615// successfully. 1616// 1617// Use "Send" method on the returned Request to send the API call to the service. 1618// the "output" return value is not valid until after Send returns without error. 1619// 1620// See ListPlatformApplications for more information on using the ListPlatformApplications 1621// API call, and error handling. 1622// 1623// This method is useful when you want to inject custom logic or configuration 1624// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1625// 1626// 1627// // Example sending a request using the ListPlatformApplicationsRequest method. 1628// req, resp := client.ListPlatformApplicationsRequest(params) 1629// 1630// err := req.Send() 1631// if err == nil { // resp is now filled 1632// fmt.Println(resp) 1633// } 1634// 1635// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPlatformApplications 1636func (c *SNS) ListPlatformApplicationsRequest(input *ListPlatformApplicationsInput) (req *request.Request, output *ListPlatformApplicationsOutput) { 1637 op := &request.Operation{ 1638 Name: opListPlatformApplications, 1639 HTTPMethod: "POST", 1640 HTTPPath: "/", 1641 Paginator: &request.Paginator{ 1642 InputTokens: []string{"NextToken"}, 1643 OutputTokens: []string{"NextToken"}, 1644 LimitToken: "", 1645 TruncationToken: "", 1646 }, 1647 } 1648 1649 if input == nil { 1650 input = &ListPlatformApplicationsInput{} 1651 } 1652 1653 output = &ListPlatformApplicationsOutput{} 1654 req = c.newRequest(op, input, output) 1655 return 1656} 1657 1658// ListPlatformApplications API operation for Amazon Simple Notification Service. 1659// 1660// Lists the platform application objects for the supported push notification 1661// services, such as APNS and GCM (Firebase Cloud Messaging). The results for 1662// ListPlatformApplications are paginated and return a limited list of applications, 1663// up to 100. If additional records are available after the first page results, 1664// then a NextToken string will be returned. To receive the next page, you call 1665// ListPlatformApplications using the NextToken string received from the previous 1666// call. When there are no more records to return, NextToken will be null. For 1667// more information, see Using Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 1668// 1669// This action is throttled at 15 transactions per second (TPS). 1670// 1671// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1672// with awserr.Error's Code and Message methods to get detailed information about 1673// the error. 1674// 1675// See the AWS API reference guide for Amazon Simple Notification Service's 1676// API operation ListPlatformApplications for usage and error information. 1677// 1678// Returned Error Codes: 1679// * ErrCodeInvalidParameterException "InvalidParameter" 1680// Indicates that a request parameter does not comply with the associated constraints. 1681// 1682// * ErrCodeInternalErrorException "InternalError" 1683// Indicates an internal service error. 1684// 1685// * ErrCodeAuthorizationErrorException "AuthorizationError" 1686// Indicates that the user has been denied access to the requested resource. 1687// 1688// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPlatformApplications 1689func (c *SNS) ListPlatformApplications(input *ListPlatformApplicationsInput) (*ListPlatformApplicationsOutput, error) { 1690 req, out := c.ListPlatformApplicationsRequest(input) 1691 return out, req.Send() 1692} 1693 1694// ListPlatformApplicationsWithContext is the same as ListPlatformApplications with the addition of 1695// the ability to pass a context and additional request options. 1696// 1697// See ListPlatformApplications for details on how to use this API operation. 1698// 1699// The context must be non-nil and will be used for request cancellation. If 1700// the context is nil a panic will occur. In the future the SDK may create 1701// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1702// for more information on using Contexts. 1703func (c *SNS) ListPlatformApplicationsWithContext(ctx aws.Context, input *ListPlatformApplicationsInput, opts ...request.Option) (*ListPlatformApplicationsOutput, error) { 1704 req, out := c.ListPlatformApplicationsRequest(input) 1705 req.SetContext(ctx) 1706 req.ApplyOptions(opts...) 1707 return out, req.Send() 1708} 1709 1710// ListPlatformApplicationsPages iterates over the pages of a ListPlatformApplications operation, 1711// calling the "fn" function with the response data for each page. To stop 1712// iterating, return false from the fn function. 1713// 1714// See ListPlatformApplications method for more information on how to use this operation. 1715// 1716// Note: This operation can generate multiple requests to a service. 1717// 1718// // Example iterating over at most 3 pages of a ListPlatformApplications operation. 1719// pageNum := 0 1720// err := client.ListPlatformApplicationsPages(params, 1721// func(page *sns.ListPlatformApplicationsOutput, lastPage bool) bool { 1722// pageNum++ 1723// fmt.Println(page) 1724// return pageNum <= 3 1725// }) 1726// 1727func (c *SNS) ListPlatformApplicationsPages(input *ListPlatformApplicationsInput, fn func(*ListPlatformApplicationsOutput, bool) bool) error { 1728 return c.ListPlatformApplicationsPagesWithContext(aws.BackgroundContext(), input, fn) 1729} 1730 1731// ListPlatformApplicationsPagesWithContext same as ListPlatformApplicationsPages except 1732// it takes a Context and allows setting request options on the pages. 1733// 1734// The context must be non-nil and will be used for request cancellation. If 1735// the context is nil a panic will occur. In the future the SDK may create 1736// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1737// for more information on using Contexts. 1738func (c *SNS) ListPlatformApplicationsPagesWithContext(ctx aws.Context, input *ListPlatformApplicationsInput, fn func(*ListPlatformApplicationsOutput, bool) bool, opts ...request.Option) error { 1739 p := request.Pagination{ 1740 NewRequest: func() (*request.Request, error) { 1741 var inCpy *ListPlatformApplicationsInput 1742 if input != nil { 1743 tmp := *input 1744 inCpy = &tmp 1745 } 1746 req, _ := c.ListPlatformApplicationsRequest(inCpy) 1747 req.SetContext(ctx) 1748 req.ApplyOptions(opts...) 1749 return req, nil 1750 }, 1751 } 1752 1753 for p.Next() { 1754 if !fn(p.Page().(*ListPlatformApplicationsOutput), !p.HasNextPage()) { 1755 break 1756 } 1757 } 1758 1759 return p.Err() 1760} 1761 1762const opListSubscriptions = "ListSubscriptions" 1763 1764// ListSubscriptionsRequest generates a "aws/request.Request" representing the 1765// client's request for the ListSubscriptions operation. The "output" return 1766// value will be populated with the request's response once the request completes 1767// successfully. 1768// 1769// Use "Send" method on the returned Request to send the API call to the service. 1770// the "output" return value is not valid until after Send returns without error. 1771// 1772// See ListSubscriptions for more information on using the ListSubscriptions 1773// API call, and error handling. 1774// 1775// This method is useful when you want to inject custom logic or configuration 1776// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1777// 1778// 1779// // Example sending a request using the ListSubscriptionsRequest method. 1780// req, resp := client.ListSubscriptionsRequest(params) 1781// 1782// err := req.Send() 1783// if err == nil { // resp is now filled 1784// fmt.Println(resp) 1785// } 1786// 1787// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptions 1788func (c *SNS) ListSubscriptionsRequest(input *ListSubscriptionsInput) (req *request.Request, output *ListSubscriptionsOutput) { 1789 op := &request.Operation{ 1790 Name: opListSubscriptions, 1791 HTTPMethod: "POST", 1792 HTTPPath: "/", 1793 Paginator: &request.Paginator{ 1794 InputTokens: []string{"NextToken"}, 1795 OutputTokens: []string{"NextToken"}, 1796 LimitToken: "", 1797 TruncationToken: "", 1798 }, 1799 } 1800 1801 if input == nil { 1802 input = &ListSubscriptionsInput{} 1803 } 1804 1805 output = &ListSubscriptionsOutput{} 1806 req = c.newRequest(op, input, output) 1807 return 1808} 1809 1810// ListSubscriptions API operation for Amazon Simple Notification Service. 1811// 1812// Returns a list of the requester's subscriptions. Each call returns a limited 1813// list of subscriptions, up to 100. If there are more subscriptions, a NextToken 1814// is also returned. Use the NextToken parameter in a new ListSubscriptions 1815// call to get further results. 1816// 1817// This action is throttled at 30 transactions per second (TPS). 1818// 1819// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1820// with awserr.Error's Code and Message methods to get detailed information about 1821// the error. 1822// 1823// See the AWS API reference guide for Amazon Simple Notification Service's 1824// API operation ListSubscriptions for usage and error information. 1825// 1826// Returned Error Codes: 1827// * ErrCodeInvalidParameterException "InvalidParameter" 1828// Indicates that a request parameter does not comply with the associated constraints. 1829// 1830// * ErrCodeInternalErrorException "InternalError" 1831// Indicates an internal service error. 1832// 1833// * ErrCodeAuthorizationErrorException "AuthorizationError" 1834// Indicates that the user has been denied access to the requested resource. 1835// 1836// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptions 1837func (c *SNS) ListSubscriptions(input *ListSubscriptionsInput) (*ListSubscriptionsOutput, error) { 1838 req, out := c.ListSubscriptionsRequest(input) 1839 return out, req.Send() 1840} 1841 1842// ListSubscriptionsWithContext is the same as ListSubscriptions with the addition of 1843// the ability to pass a context and additional request options. 1844// 1845// See ListSubscriptions for details on how to use this API operation. 1846// 1847// The context must be non-nil and will be used for request cancellation. If 1848// the context is nil a panic will occur. In the future the SDK may create 1849// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1850// for more information on using Contexts. 1851func (c *SNS) ListSubscriptionsWithContext(ctx aws.Context, input *ListSubscriptionsInput, opts ...request.Option) (*ListSubscriptionsOutput, error) { 1852 req, out := c.ListSubscriptionsRequest(input) 1853 req.SetContext(ctx) 1854 req.ApplyOptions(opts...) 1855 return out, req.Send() 1856} 1857 1858// ListSubscriptionsPages iterates over the pages of a ListSubscriptions operation, 1859// calling the "fn" function with the response data for each page. To stop 1860// iterating, return false from the fn function. 1861// 1862// See ListSubscriptions method for more information on how to use this operation. 1863// 1864// Note: This operation can generate multiple requests to a service. 1865// 1866// // Example iterating over at most 3 pages of a ListSubscriptions operation. 1867// pageNum := 0 1868// err := client.ListSubscriptionsPages(params, 1869// func(page *sns.ListSubscriptionsOutput, lastPage bool) bool { 1870// pageNum++ 1871// fmt.Println(page) 1872// return pageNum <= 3 1873// }) 1874// 1875func (c *SNS) ListSubscriptionsPages(input *ListSubscriptionsInput, fn func(*ListSubscriptionsOutput, bool) bool) error { 1876 return c.ListSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) 1877} 1878 1879// ListSubscriptionsPagesWithContext same as ListSubscriptionsPages except 1880// it takes a Context and allows setting request options on the pages. 1881// 1882// The context must be non-nil and will be used for request cancellation. If 1883// the context is nil a panic will occur. In the future the SDK may create 1884// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1885// for more information on using Contexts. 1886func (c *SNS) ListSubscriptionsPagesWithContext(ctx aws.Context, input *ListSubscriptionsInput, fn func(*ListSubscriptionsOutput, bool) bool, opts ...request.Option) error { 1887 p := request.Pagination{ 1888 NewRequest: func() (*request.Request, error) { 1889 var inCpy *ListSubscriptionsInput 1890 if input != nil { 1891 tmp := *input 1892 inCpy = &tmp 1893 } 1894 req, _ := c.ListSubscriptionsRequest(inCpy) 1895 req.SetContext(ctx) 1896 req.ApplyOptions(opts...) 1897 return req, nil 1898 }, 1899 } 1900 1901 for p.Next() { 1902 if !fn(p.Page().(*ListSubscriptionsOutput), !p.HasNextPage()) { 1903 break 1904 } 1905 } 1906 1907 return p.Err() 1908} 1909 1910const opListSubscriptionsByTopic = "ListSubscriptionsByTopic" 1911 1912// ListSubscriptionsByTopicRequest generates a "aws/request.Request" representing the 1913// client's request for the ListSubscriptionsByTopic operation. The "output" return 1914// value will be populated with the request's response once the request completes 1915// successfully. 1916// 1917// Use "Send" method on the returned Request to send the API call to the service. 1918// the "output" return value is not valid until after Send returns without error. 1919// 1920// See ListSubscriptionsByTopic for more information on using the ListSubscriptionsByTopic 1921// API call, and error handling. 1922// 1923// This method is useful when you want to inject custom logic or configuration 1924// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1925// 1926// 1927// // Example sending a request using the ListSubscriptionsByTopicRequest method. 1928// req, resp := client.ListSubscriptionsByTopicRequest(params) 1929// 1930// err := req.Send() 1931// if err == nil { // resp is now filled 1932// fmt.Println(resp) 1933// } 1934// 1935// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptionsByTopic 1936func (c *SNS) ListSubscriptionsByTopicRequest(input *ListSubscriptionsByTopicInput) (req *request.Request, output *ListSubscriptionsByTopicOutput) { 1937 op := &request.Operation{ 1938 Name: opListSubscriptionsByTopic, 1939 HTTPMethod: "POST", 1940 HTTPPath: "/", 1941 Paginator: &request.Paginator{ 1942 InputTokens: []string{"NextToken"}, 1943 OutputTokens: []string{"NextToken"}, 1944 LimitToken: "", 1945 TruncationToken: "", 1946 }, 1947 } 1948 1949 if input == nil { 1950 input = &ListSubscriptionsByTopicInput{} 1951 } 1952 1953 output = &ListSubscriptionsByTopicOutput{} 1954 req = c.newRequest(op, input, output) 1955 return 1956} 1957 1958// ListSubscriptionsByTopic API operation for Amazon Simple Notification Service. 1959// 1960// Returns a list of the subscriptions to a specific topic. Each call returns 1961// a limited list of subscriptions, up to 100. If there are more subscriptions, 1962// a NextToken is also returned. Use the NextToken parameter in a new ListSubscriptionsByTopic 1963// call to get further results. 1964// 1965// This action is throttled at 30 transactions per second (TPS). 1966// 1967// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1968// with awserr.Error's Code and Message methods to get detailed information about 1969// the error. 1970// 1971// See the AWS API reference guide for Amazon Simple Notification Service's 1972// API operation ListSubscriptionsByTopic for usage and error information. 1973// 1974// Returned Error Codes: 1975// * ErrCodeInvalidParameterException "InvalidParameter" 1976// Indicates that a request parameter does not comply with the associated constraints. 1977// 1978// * ErrCodeInternalErrorException "InternalError" 1979// Indicates an internal service error. 1980// 1981// * ErrCodeNotFoundException "NotFound" 1982// Indicates that the requested resource does not exist. 1983// 1984// * ErrCodeAuthorizationErrorException "AuthorizationError" 1985// Indicates that the user has been denied access to the requested resource. 1986// 1987// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListSubscriptionsByTopic 1988func (c *SNS) ListSubscriptionsByTopic(input *ListSubscriptionsByTopicInput) (*ListSubscriptionsByTopicOutput, error) { 1989 req, out := c.ListSubscriptionsByTopicRequest(input) 1990 return out, req.Send() 1991} 1992 1993// ListSubscriptionsByTopicWithContext is the same as ListSubscriptionsByTopic with the addition of 1994// the ability to pass a context and additional request options. 1995// 1996// See ListSubscriptionsByTopic for details on how to use this API operation. 1997// 1998// The context must be non-nil and will be used for request cancellation. If 1999// the context is nil a panic will occur. In the future the SDK may create 2000// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2001// for more information on using Contexts. 2002func (c *SNS) ListSubscriptionsByTopicWithContext(ctx aws.Context, input *ListSubscriptionsByTopicInput, opts ...request.Option) (*ListSubscriptionsByTopicOutput, error) { 2003 req, out := c.ListSubscriptionsByTopicRequest(input) 2004 req.SetContext(ctx) 2005 req.ApplyOptions(opts...) 2006 return out, req.Send() 2007} 2008 2009// ListSubscriptionsByTopicPages iterates over the pages of a ListSubscriptionsByTopic operation, 2010// calling the "fn" function with the response data for each page. To stop 2011// iterating, return false from the fn function. 2012// 2013// See ListSubscriptionsByTopic method for more information on how to use this operation. 2014// 2015// Note: This operation can generate multiple requests to a service. 2016// 2017// // Example iterating over at most 3 pages of a ListSubscriptionsByTopic operation. 2018// pageNum := 0 2019// err := client.ListSubscriptionsByTopicPages(params, 2020// func(page *sns.ListSubscriptionsByTopicOutput, lastPage bool) bool { 2021// pageNum++ 2022// fmt.Println(page) 2023// return pageNum <= 3 2024// }) 2025// 2026func (c *SNS) ListSubscriptionsByTopicPages(input *ListSubscriptionsByTopicInput, fn func(*ListSubscriptionsByTopicOutput, bool) bool) error { 2027 return c.ListSubscriptionsByTopicPagesWithContext(aws.BackgroundContext(), input, fn) 2028} 2029 2030// ListSubscriptionsByTopicPagesWithContext same as ListSubscriptionsByTopicPages except 2031// it takes a Context and allows setting request options on the pages. 2032// 2033// The context must be non-nil and will be used for request cancellation. If 2034// the context is nil a panic will occur. In the future the SDK may create 2035// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2036// for more information on using Contexts. 2037func (c *SNS) ListSubscriptionsByTopicPagesWithContext(ctx aws.Context, input *ListSubscriptionsByTopicInput, fn func(*ListSubscriptionsByTopicOutput, bool) bool, opts ...request.Option) error { 2038 p := request.Pagination{ 2039 NewRequest: func() (*request.Request, error) { 2040 var inCpy *ListSubscriptionsByTopicInput 2041 if input != nil { 2042 tmp := *input 2043 inCpy = &tmp 2044 } 2045 req, _ := c.ListSubscriptionsByTopicRequest(inCpy) 2046 req.SetContext(ctx) 2047 req.ApplyOptions(opts...) 2048 return req, nil 2049 }, 2050 } 2051 2052 for p.Next() { 2053 if !fn(p.Page().(*ListSubscriptionsByTopicOutput), !p.HasNextPage()) { 2054 break 2055 } 2056 } 2057 2058 return p.Err() 2059} 2060 2061const opListTagsForResource = "ListTagsForResource" 2062 2063// ListTagsForResourceRequest generates a "aws/request.Request" representing the 2064// client's request for the ListTagsForResource operation. The "output" return 2065// value will be populated with the request's response once the request completes 2066// successfully. 2067// 2068// Use "Send" method on the returned Request to send the API call to the service. 2069// the "output" return value is not valid until after Send returns without error. 2070// 2071// See ListTagsForResource for more information on using the ListTagsForResource 2072// API call, and error handling. 2073// 2074// This method is useful when you want to inject custom logic or configuration 2075// into the SDK's request lifecycle. Such as custom headers, or retry logic. 2076// 2077// 2078// // Example sending a request using the ListTagsForResourceRequest method. 2079// req, resp := client.ListTagsForResourceRequest(params) 2080// 2081// err := req.Send() 2082// if err == nil { // resp is now filled 2083// fmt.Println(resp) 2084// } 2085// 2086// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListTagsForResource 2087func (c *SNS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { 2088 op := &request.Operation{ 2089 Name: opListTagsForResource, 2090 HTTPMethod: "POST", 2091 HTTPPath: "/", 2092 } 2093 2094 if input == nil { 2095 input = &ListTagsForResourceInput{} 2096 } 2097 2098 output = &ListTagsForResourceOutput{} 2099 req = c.newRequest(op, input, output) 2100 return 2101} 2102 2103// ListTagsForResource API operation for Amazon Simple Notification Service. 2104// 2105// List all tags added to the specified Amazon SNS topic. For an overview, see 2106// Amazon SNS Tags (https://docs.aws.amazon.com/sns/latest/dg/sns-tags.html) 2107// in the Amazon Simple Notification Service Developer Guide. 2108// 2109// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2110// with awserr.Error's Code and Message methods to get detailed information about 2111// the error. 2112// 2113// See the AWS API reference guide for Amazon Simple Notification Service's 2114// API operation ListTagsForResource for usage and error information. 2115// 2116// Returned Error Codes: 2117// * ErrCodeResourceNotFoundException "ResourceNotFound" 2118// Can't tag resource. Verify that the topic exists. 2119// 2120// * ErrCodeTagPolicyException "TagPolicy" 2121// The request doesn't comply with the IAM tag policy. Correct your request 2122// and then retry it. 2123// 2124// * ErrCodeInvalidParameterException "InvalidParameter" 2125// Indicates that a request parameter does not comply with the associated constraints. 2126// 2127// * ErrCodeAuthorizationErrorException "AuthorizationError" 2128// Indicates that the user has been denied access to the requested resource. 2129// 2130// * ErrCodeConcurrentAccessException "ConcurrentAccess" 2131// Can't perform multiple operations on a tag simultaneously. Perform the operations 2132// sequentially. 2133// 2134// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListTagsForResource 2135func (c *SNS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { 2136 req, out := c.ListTagsForResourceRequest(input) 2137 return out, req.Send() 2138} 2139 2140// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of 2141// the ability to pass a context and additional request options. 2142// 2143// See ListTagsForResource for details on how to use this API operation. 2144// 2145// The context must be non-nil and will be used for request cancellation. If 2146// the context is nil a panic will occur. In the future the SDK may create 2147// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2148// for more information on using Contexts. 2149func (c *SNS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { 2150 req, out := c.ListTagsForResourceRequest(input) 2151 req.SetContext(ctx) 2152 req.ApplyOptions(opts...) 2153 return out, req.Send() 2154} 2155 2156const opListTopics = "ListTopics" 2157 2158// ListTopicsRequest generates a "aws/request.Request" representing the 2159// client's request for the ListTopics operation. The "output" return 2160// value will be populated with the request's response once the request completes 2161// successfully. 2162// 2163// Use "Send" method on the returned Request to send the API call to the service. 2164// the "output" return value is not valid until after Send returns without error. 2165// 2166// See ListTopics for more information on using the ListTopics 2167// API call, and error handling. 2168// 2169// This method is useful when you want to inject custom logic or configuration 2170// into the SDK's request lifecycle. Such as custom headers, or retry logic. 2171// 2172// 2173// // Example sending a request using the ListTopicsRequest method. 2174// req, resp := client.ListTopicsRequest(params) 2175// 2176// err := req.Send() 2177// if err == nil { // resp is now filled 2178// fmt.Println(resp) 2179// } 2180// 2181// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListTopics 2182func (c *SNS) ListTopicsRequest(input *ListTopicsInput) (req *request.Request, output *ListTopicsOutput) { 2183 op := &request.Operation{ 2184 Name: opListTopics, 2185 HTTPMethod: "POST", 2186 HTTPPath: "/", 2187 Paginator: &request.Paginator{ 2188 InputTokens: []string{"NextToken"}, 2189 OutputTokens: []string{"NextToken"}, 2190 LimitToken: "", 2191 TruncationToken: "", 2192 }, 2193 } 2194 2195 if input == nil { 2196 input = &ListTopicsInput{} 2197 } 2198 2199 output = &ListTopicsOutput{} 2200 req = c.newRequest(op, input, output) 2201 return 2202} 2203 2204// ListTopics API operation for Amazon Simple Notification Service. 2205// 2206// Returns a list of the requester's topics. Each call returns a limited list 2207// of topics, up to 100. If there are more topics, a NextToken is also returned. 2208// Use the NextToken parameter in a new ListTopics call to get further results. 2209// 2210// This action is throttled at 30 transactions per second (TPS). 2211// 2212// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2213// with awserr.Error's Code and Message methods to get detailed information about 2214// the error. 2215// 2216// See the AWS API reference guide for Amazon Simple Notification Service's 2217// API operation ListTopics for usage and error information. 2218// 2219// Returned Error Codes: 2220// * ErrCodeInvalidParameterException "InvalidParameter" 2221// Indicates that a request parameter does not comply with the associated constraints. 2222// 2223// * ErrCodeInternalErrorException "InternalError" 2224// Indicates an internal service error. 2225// 2226// * ErrCodeAuthorizationErrorException "AuthorizationError" 2227// Indicates that the user has been denied access to the requested resource. 2228// 2229// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListTopics 2230func (c *SNS) ListTopics(input *ListTopicsInput) (*ListTopicsOutput, error) { 2231 req, out := c.ListTopicsRequest(input) 2232 return out, req.Send() 2233} 2234 2235// ListTopicsWithContext is the same as ListTopics with the addition of 2236// the ability to pass a context and additional request options. 2237// 2238// See ListTopics for details on how to use this API operation. 2239// 2240// The context must be non-nil and will be used for request cancellation. If 2241// the context is nil a panic will occur. In the future the SDK may create 2242// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2243// for more information on using Contexts. 2244func (c *SNS) ListTopicsWithContext(ctx aws.Context, input *ListTopicsInput, opts ...request.Option) (*ListTopicsOutput, error) { 2245 req, out := c.ListTopicsRequest(input) 2246 req.SetContext(ctx) 2247 req.ApplyOptions(opts...) 2248 return out, req.Send() 2249} 2250 2251// ListTopicsPages iterates over the pages of a ListTopics operation, 2252// calling the "fn" function with the response data for each page. To stop 2253// iterating, return false from the fn function. 2254// 2255// See ListTopics method for more information on how to use this operation. 2256// 2257// Note: This operation can generate multiple requests to a service. 2258// 2259// // Example iterating over at most 3 pages of a ListTopics operation. 2260// pageNum := 0 2261// err := client.ListTopicsPages(params, 2262// func(page *sns.ListTopicsOutput, lastPage bool) bool { 2263// pageNum++ 2264// fmt.Println(page) 2265// return pageNum <= 3 2266// }) 2267// 2268func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool) error { 2269 return c.ListTopicsPagesWithContext(aws.BackgroundContext(), input, fn) 2270} 2271 2272// ListTopicsPagesWithContext same as ListTopicsPages except 2273// it takes a Context and allows setting request options on the pages. 2274// 2275// The context must be non-nil and will be used for request cancellation. If 2276// the context is nil a panic will occur. In the future the SDK may create 2277// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2278// for more information on using Contexts. 2279func (c *SNS) ListTopicsPagesWithContext(ctx aws.Context, input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool, opts ...request.Option) error { 2280 p := request.Pagination{ 2281 NewRequest: func() (*request.Request, error) { 2282 var inCpy *ListTopicsInput 2283 if input != nil { 2284 tmp := *input 2285 inCpy = &tmp 2286 } 2287 req, _ := c.ListTopicsRequest(inCpy) 2288 req.SetContext(ctx) 2289 req.ApplyOptions(opts...) 2290 return req, nil 2291 }, 2292 } 2293 2294 for p.Next() { 2295 if !fn(p.Page().(*ListTopicsOutput), !p.HasNextPage()) { 2296 break 2297 } 2298 } 2299 2300 return p.Err() 2301} 2302 2303const opOptInPhoneNumber = "OptInPhoneNumber" 2304 2305// OptInPhoneNumberRequest generates a "aws/request.Request" representing the 2306// client's request for the OptInPhoneNumber operation. The "output" return 2307// value will be populated with the request's response once the request completes 2308// successfully. 2309// 2310// Use "Send" method on the returned Request to send the API call to the service. 2311// the "output" return value is not valid until after Send returns without error. 2312// 2313// See OptInPhoneNumber for more information on using the OptInPhoneNumber 2314// API call, and error handling. 2315// 2316// This method is useful when you want to inject custom logic or configuration 2317// into the SDK's request lifecycle. Such as custom headers, or retry logic. 2318// 2319// 2320// // Example sending a request using the OptInPhoneNumberRequest method. 2321// req, resp := client.OptInPhoneNumberRequest(params) 2322// 2323// err := req.Send() 2324// if err == nil { // resp is now filled 2325// fmt.Println(resp) 2326// } 2327// 2328// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/OptInPhoneNumber 2329func (c *SNS) OptInPhoneNumberRequest(input *OptInPhoneNumberInput) (req *request.Request, output *OptInPhoneNumberOutput) { 2330 op := &request.Operation{ 2331 Name: opOptInPhoneNumber, 2332 HTTPMethod: "POST", 2333 HTTPPath: "/", 2334 } 2335 2336 if input == nil { 2337 input = &OptInPhoneNumberInput{} 2338 } 2339 2340 output = &OptInPhoneNumberOutput{} 2341 req = c.newRequest(op, input, output) 2342 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2343 return 2344} 2345 2346// OptInPhoneNumber API operation for Amazon Simple Notification Service. 2347// 2348// Use this request to opt in a phone number that is opted out, which enables 2349// you to resume sending SMS messages to the number. 2350// 2351// You can opt in a phone number only once every 30 days. 2352// 2353// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2354// with awserr.Error's Code and Message methods to get detailed information about 2355// the error. 2356// 2357// See the AWS API reference guide for Amazon Simple Notification Service's 2358// API operation OptInPhoneNumber for usage and error information. 2359// 2360// Returned Error Codes: 2361// * ErrCodeThrottledException "Throttled" 2362// Indicates that the rate at which requests have been submitted for this action 2363// exceeds the limit for your account. 2364// 2365// * ErrCodeInternalErrorException "InternalError" 2366// Indicates an internal service error. 2367// 2368// * ErrCodeAuthorizationErrorException "AuthorizationError" 2369// Indicates that the user has been denied access to the requested resource. 2370// 2371// * ErrCodeInvalidParameterException "InvalidParameter" 2372// Indicates that a request parameter does not comply with the associated constraints. 2373// 2374// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/OptInPhoneNumber 2375func (c *SNS) OptInPhoneNumber(input *OptInPhoneNumberInput) (*OptInPhoneNumberOutput, error) { 2376 req, out := c.OptInPhoneNumberRequest(input) 2377 return out, req.Send() 2378} 2379 2380// OptInPhoneNumberWithContext is the same as OptInPhoneNumber with the addition of 2381// the ability to pass a context and additional request options. 2382// 2383// See OptInPhoneNumber for details on how to use this API operation. 2384// 2385// The context must be non-nil and will be used for request cancellation. If 2386// the context is nil a panic will occur. In the future the SDK may create 2387// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2388// for more information on using Contexts. 2389func (c *SNS) OptInPhoneNumberWithContext(ctx aws.Context, input *OptInPhoneNumberInput, opts ...request.Option) (*OptInPhoneNumberOutput, error) { 2390 req, out := c.OptInPhoneNumberRequest(input) 2391 req.SetContext(ctx) 2392 req.ApplyOptions(opts...) 2393 return out, req.Send() 2394} 2395 2396const opPublish = "Publish" 2397 2398// PublishRequest generates a "aws/request.Request" representing the 2399// client's request for the Publish operation. The "output" return 2400// value will be populated with the request's response once the request completes 2401// successfully. 2402// 2403// Use "Send" method on the returned Request to send the API call to the service. 2404// the "output" return value is not valid until after Send returns without error. 2405// 2406// See Publish for more information on using the Publish 2407// API call, and error handling. 2408// 2409// This method is useful when you want to inject custom logic or configuration 2410// into the SDK's request lifecycle. Such as custom headers, or retry logic. 2411// 2412// 2413// // Example sending a request using the PublishRequest method. 2414// req, resp := client.PublishRequest(params) 2415// 2416// err := req.Send() 2417// if err == nil { // resp is now filled 2418// fmt.Println(resp) 2419// } 2420// 2421// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Publish 2422func (c *SNS) PublishRequest(input *PublishInput) (req *request.Request, output *PublishOutput) { 2423 op := &request.Operation{ 2424 Name: opPublish, 2425 HTTPMethod: "POST", 2426 HTTPPath: "/", 2427 } 2428 2429 if input == nil { 2430 input = &PublishInput{} 2431 } 2432 2433 output = &PublishOutput{} 2434 req = c.newRequest(op, input, output) 2435 return 2436} 2437 2438// Publish API operation for Amazon Simple Notification Service. 2439// 2440// Sends a message to an Amazon SNS topic, a text message (SMS message) directly 2441// to a phone number, or a message to a mobile platform endpoint (when you specify 2442// the TargetArn). 2443// 2444// If you send a message to a topic, Amazon SNS delivers the message to each 2445// endpoint that is subscribed to the topic. The format of the message depends 2446// on the notification protocol for each subscribed endpoint. 2447// 2448// When a messageId is returned, the message has been saved and Amazon SNS will 2449// attempt to deliver it shortly. 2450// 2451// To use the Publish action for sending a message to a mobile endpoint, such 2452// as an app on a Kindle device or mobile phone, you must specify the EndpointArn 2453// for the TargetArn parameter. The EndpointArn is returned when making a call 2454// with the CreatePlatformEndpoint action. 2455// 2456// For more information about formatting messages, see Send Custom Platform-Specific 2457// Payloads in Messages to Mobile Devices (https://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.html). 2458// 2459// You can publish messages only to topics and endpoints in the same AWS Region. 2460// 2461// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2462// with awserr.Error's Code and Message methods to get detailed information about 2463// the error. 2464// 2465// See the AWS API reference guide for Amazon Simple Notification Service's 2466// API operation Publish for usage and error information. 2467// 2468// Returned Error Codes: 2469// * ErrCodeInvalidParameterException "InvalidParameter" 2470// Indicates that a request parameter does not comply with the associated constraints. 2471// 2472// * ErrCodeInvalidParameterValueException "ParameterValueInvalid" 2473// Indicates that a request parameter does not comply with the associated constraints. 2474// 2475// * ErrCodeInternalErrorException "InternalError" 2476// Indicates an internal service error. 2477// 2478// * ErrCodeNotFoundException "NotFound" 2479// Indicates that the requested resource does not exist. 2480// 2481// * ErrCodeEndpointDisabledException "EndpointDisabled" 2482// Exception error indicating endpoint disabled. 2483// 2484// * ErrCodePlatformApplicationDisabledException "PlatformApplicationDisabled" 2485// Exception error indicating platform application disabled. 2486// 2487// * ErrCodeAuthorizationErrorException "AuthorizationError" 2488// Indicates that the user has been denied access to the requested resource. 2489// 2490// * ErrCodeKMSDisabledException "KMSDisabled" 2491// The request was rejected because the specified customer master key (CMK) 2492// isn't enabled. 2493// 2494// * ErrCodeKMSInvalidStateException "KMSInvalidState" 2495// The request was rejected because the state of the specified resource isn't 2496// valid for this request. For more information, see How Key State Affects Use 2497// of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2498// in the AWS Key Management Service Developer Guide. 2499// 2500// * ErrCodeKMSNotFoundException "KMSNotFound" 2501// The request was rejected because the specified entity or resource can't be 2502// found. 2503// 2504// * ErrCodeKMSOptInRequired "KMSOptInRequired" 2505// The AWS access key ID needs a subscription for the service. 2506// 2507// * ErrCodeKMSThrottlingException "KMSThrottling" 2508// The request was denied due to request throttling. For more information about 2509// throttling, see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second) 2510// in the AWS Key Management Service Developer Guide. 2511// 2512// * ErrCodeKMSAccessDeniedException "KMSAccessDenied" 2513// The ciphertext references a key that doesn't exist or that you don't have 2514// access to. 2515// 2516// * ErrCodeInvalidSecurityException "InvalidSecurity" 2517// The credential signature isn't valid. You must use an HTTPS endpoint and 2518// sign your request using Signature Version 4. 2519// 2520// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Publish 2521func (c *SNS) Publish(input *PublishInput) (*PublishOutput, error) { 2522 req, out := c.PublishRequest(input) 2523 return out, req.Send() 2524} 2525 2526// PublishWithContext is the same as Publish with the addition of 2527// the ability to pass a context and additional request options. 2528// 2529// See Publish for details on how to use this API operation. 2530// 2531// The context must be non-nil and will be used for request cancellation. If 2532// the context is nil a panic will occur. In the future the SDK may create 2533// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2534// for more information on using Contexts. 2535func (c *SNS) PublishWithContext(ctx aws.Context, input *PublishInput, opts ...request.Option) (*PublishOutput, error) { 2536 req, out := c.PublishRequest(input) 2537 req.SetContext(ctx) 2538 req.ApplyOptions(opts...) 2539 return out, req.Send() 2540} 2541 2542const opRemovePermission = "RemovePermission" 2543 2544// RemovePermissionRequest generates a "aws/request.Request" representing the 2545// client's request for the RemovePermission operation. The "output" return 2546// value will be populated with the request's response once the request completes 2547// successfully. 2548// 2549// Use "Send" method on the returned Request to send the API call to the service. 2550// the "output" return value is not valid until after Send returns without error. 2551// 2552// See RemovePermission for more information on using the RemovePermission 2553// API call, and error handling. 2554// 2555// This method is useful when you want to inject custom logic or configuration 2556// into the SDK's request lifecycle. Such as custom headers, or retry logic. 2557// 2558// 2559// // Example sending a request using the RemovePermissionRequest method. 2560// req, resp := client.RemovePermissionRequest(params) 2561// 2562// err := req.Send() 2563// if err == nil { // resp is now filled 2564// fmt.Println(resp) 2565// } 2566// 2567// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/RemovePermission 2568func (c *SNS) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) { 2569 op := &request.Operation{ 2570 Name: opRemovePermission, 2571 HTTPMethod: "POST", 2572 HTTPPath: "/", 2573 } 2574 2575 if input == nil { 2576 input = &RemovePermissionInput{} 2577 } 2578 2579 output = &RemovePermissionOutput{} 2580 req = c.newRequest(op, input, output) 2581 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2582 return 2583} 2584 2585// RemovePermission API operation for Amazon Simple Notification Service. 2586// 2587// Removes a statement from a topic's access control policy. 2588// 2589// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2590// with awserr.Error's Code and Message methods to get detailed information about 2591// the error. 2592// 2593// See the AWS API reference guide for Amazon Simple Notification Service's 2594// API operation RemovePermission for usage and error information. 2595// 2596// Returned Error Codes: 2597// * ErrCodeInvalidParameterException "InvalidParameter" 2598// Indicates that a request parameter does not comply with the associated constraints. 2599// 2600// * ErrCodeInternalErrorException "InternalError" 2601// Indicates an internal service error. 2602// 2603// * ErrCodeAuthorizationErrorException "AuthorizationError" 2604// Indicates that the user has been denied access to the requested resource. 2605// 2606// * ErrCodeNotFoundException "NotFound" 2607// Indicates that the requested resource does not exist. 2608// 2609// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/RemovePermission 2610func (c *SNS) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { 2611 req, out := c.RemovePermissionRequest(input) 2612 return out, req.Send() 2613} 2614 2615// RemovePermissionWithContext is the same as RemovePermission with the addition of 2616// the ability to pass a context and additional request options. 2617// 2618// See RemovePermission for details on how to use this API operation. 2619// 2620// The context must be non-nil and will be used for request cancellation. If 2621// the context is nil a panic will occur. In the future the SDK may create 2622// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2623// for more information on using Contexts. 2624func (c *SNS) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) { 2625 req, out := c.RemovePermissionRequest(input) 2626 req.SetContext(ctx) 2627 req.ApplyOptions(opts...) 2628 return out, req.Send() 2629} 2630 2631const opSetEndpointAttributes = "SetEndpointAttributes" 2632 2633// SetEndpointAttributesRequest generates a "aws/request.Request" representing the 2634// client's request for the SetEndpointAttributes operation. The "output" return 2635// value will be populated with the request's response once the request completes 2636// successfully. 2637// 2638// Use "Send" method on the returned Request to send the API call to the service. 2639// the "output" return value is not valid until after Send returns without error. 2640// 2641// See SetEndpointAttributes for more information on using the SetEndpointAttributes 2642// API call, and error handling. 2643// 2644// This method is useful when you want to inject custom logic or configuration 2645// into the SDK's request lifecycle. Such as custom headers, or retry logic. 2646// 2647// 2648// // Example sending a request using the SetEndpointAttributesRequest method. 2649// req, resp := client.SetEndpointAttributesRequest(params) 2650// 2651// err := req.Send() 2652// if err == nil { // resp is now filled 2653// fmt.Println(resp) 2654// } 2655// 2656// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetEndpointAttributes 2657func (c *SNS) SetEndpointAttributesRequest(input *SetEndpointAttributesInput) (req *request.Request, output *SetEndpointAttributesOutput) { 2658 op := &request.Operation{ 2659 Name: opSetEndpointAttributes, 2660 HTTPMethod: "POST", 2661 HTTPPath: "/", 2662 } 2663 2664 if input == nil { 2665 input = &SetEndpointAttributesInput{} 2666 } 2667 2668 output = &SetEndpointAttributesOutput{} 2669 req = c.newRequest(op, input, output) 2670 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2671 return 2672} 2673 2674// SetEndpointAttributes API operation for Amazon Simple Notification Service. 2675// 2676// Sets the attributes for an endpoint for a device on one of the supported 2677// push notification services, such as GCM (Firebase Cloud Messaging) and APNS. 2678// For more information, see Using Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 2679// 2680// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2681// with awserr.Error's Code and Message methods to get detailed information about 2682// the error. 2683// 2684// See the AWS API reference guide for Amazon Simple Notification Service's 2685// API operation SetEndpointAttributes for usage and error information. 2686// 2687// Returned Error Codes: 2688// * ErrCodeInvalidParameterException "InvalidParameter" 2689// Indicates that a request parameter does not comply with the associated constraints. 2690// 2691// * ErrCodeInternalErrorException "InternalError" 2692// Indicates an internal service error. 2693// 2694// * ErrCodeAuthorizationErrorException "AuthorizationError" 2695// Indicates that the user has been denied access to the requested resource. 2696// 2697// * ErrCodeNotFoundException "NotFound" 2698// Indicates that the requested resource does not exist. 2699// 2700// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetEndpointAttributes 2701func (c *SNS) SetEndpointAttributes(input *SetEndpointAttributesInput) (*SetEndpointAttributesOutput, error) { 2702 req, out := c.SetEndpointAttributesRequest(input) 2703 return out, req.Send() 2704} 2705 2706// SetEndpointAttributesWithContext is the same as SetEndpointAttributes with the addition of 2707// the ability to pass a context and additional request options. 2708// 2709// See SetEndpointAttributes for details on how to use this API operation. 2710// 2711// The context must be non-nil and will be used for request cancellation. If 2712// the context is nil a panic will occur. In the future the SDK may create 2713// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2714// for more information on using Contexts. 2715func (c *SNS) SetEndpointAttributesWithContext(ctx aws.Context, input *SetEndpointAttributesInput, opts ...request.Option) (*SetEndpointAttributesOutput, error) { 2716 req, out := c.SetEndpointAttributesRequest(input) 2717 req.SetContext(ctx) 2718 req.ApplyOptions(opts...) 2719 return out, req.Send() 2720} 2721 2722const opSetPlatformApplicationAttributes = "SetPlatformApplicationAttributes" 2723 2724// SetPlatformApplicationAttributesRequest generates a "aws/request.Request" representing the 2725// client's request for the SetPlatformApplicationAttributes operation. The "output" return 2726// value will be populated with the request's response once the request completes 2727// successfully. 2728// 2729// Use "Send" method on the returned Request to send the API call to the service. 2730// the "output" return value is not valid until after Send returns without error. 2731// 2732// See SetPlatformApplicationAttributes for more information on using the SetPlatformApplicationAttributes 2733// API call, and error handling. 2734// 2735// This method is useful when you want to inject custom logic or configuration 2736// into the SDK's request lifecycle. Such as custom headers, or retry logic. 2737// 2738// 2739// // Example sending a request using the SetPlatformApplicationAttributesRequest method. 2740// req, resp := client.SetPlatformApplicationAttributesRequest(params) 2741// 2742// err := req.Send() 2743// if err == nil { // resp is now filled 2744// fmt.Println(resp) 2745// } 2746// 2747// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetPlatformApplicationAttributes 2748func (c *SNS) SetPlatformApplicationAttributesRequest(input *SetPlatformApplicationAttributesInput) (req *request.Request, output *SetPlatformApplicationAttributesOutput) { 2749 op := &request.Operation{ 2750 Name: opSetPlatformApplicationAttributes, 2751 HTTPMethod: "POST", 2752 HTTPPath: "/", 2753 } 2754 2755 if input == nil { 2756 input = &SetPlatformApplicationAttributesInput{} 2757 } 2758 2759 output = &SetPlatformApplicationAttributesOutput{} 2760 req = c.newRequest(op, input, output) 2761 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2762 return 2763} 2764 2765// SetPlatformApplicationAttributes API operation for Amazon Simple Notification Service. 2766// 2767// Sets the attributes of the platform application object for the supported 2768// push notification services, such as APNS and GCM (Firebase Cloud Messaging). 2769// For more information, see Using Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). 2770// For information on configuring attributes for message delivery status, see 2771// Using Amazon SNS Application Attributes for Message Delivery Status (https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html). 2772// 2773// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2774// with awserr.Error's Code and Message methods to get detailed information about 2775// the error. 2776// 2777// See the AWS API reference guide for Amazon Simple Notification Service's 2778// API operation SetPlatformApplicationAttributes for usage and error information. 2779// 2780// Returned Error Codes: 2781// * ErrCodeInvalidParameterException "InvalidParameter" 2782// Indicates that a request parameter does not comply with the associated constraints. 2783// 2784// * ErrCodeInternalErrorException "InternalError" 2785// Indicates an internal service error. 2786// 2787// * ErrCodeAuthorizationErrorException "AuthorizationError" 2788// Indicates that the user has been denied access to the requested resource. 2789// 2790// * ErrCodeNotFoundException "NotFound" 2791// Indicates that the requested resource does not exist. 2792// 2793// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetPlatformApplicationAttributes 2794func (c *SNS) SetPlatformApplicationAttributes(input *SetPlatformApplicationAttributesInput) (*SetPlatformApplicationAttributesOutput, error) { 2795 req, out := c.SetPlatformApplicationAttributesRequest(input) 2796 return out, req.Send() 2797} 2798 2799// SetPlatformApplicationAttributesWithContext is the same as SetPlatformApplicationAttributes with the addition of 2800// the ability to pass a context and additional request options. 2801// 2802// See SetPlatformApplicationAttributes for details on how to use this API operation. 2803// 2804// The context must be non-nil and will be used for request cancellation. If 2805// the context is nil a panic will occur. In the future the SDK may create 2806// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2807// for more information on using Contexts. 2808func (c *SNS) SetPlatformApplicationAttributesWithContext(ctx aws.Context, input *SetPlatformApplicationAttributesInput, opts ...request.Option) (*SetPlatformApplicationAttributesOutput, error) { 2809 req, out := c.SetPlatformApplicationAttributesRequest(input) 2810 req.SetContext(ctx) 2811 req.ApplyOptions(opts...) 2812 return out, req.Send() 2813} 2814 2815const opSetSMSAttributes = "SetSMSAttributes" 2816 2817// SetSMSAttributesRequest generates a "aws/request.Request" representing the 2818// client's request for the SetSMSAttributes operation. The "output" return 2819// value will be populated with the request's response once the request completes 2820// successfully. 2821// 2822// Use "Send" method on the returned Request to send the API call to the service. 2823// the "output" return value is not valid until after Send returns without error. 2824// 2825// See SetSMSAttributes for more information on using the SetSMSAttributes 2826// API call, and error handling. 2827// 2828// This method is useful when you want to inject custom logic or configuration 2829// into the SDK's request lifecycle. Such as custom headers, or retry logic. 2830// 2831// 2832// // Example sending a request using the SetSMSAttributesRequest method. 2833// req, resp := client.SetSMSAttributesRequest(params) 2834// 2835// err := req.Send() 2836// if err == nil { // resp is now filled 2837// fmt.Println(resp) 2838// } 2839// 2840// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSMSAttributes 2841func (c *SNS) SetSMSAttributesRequest(input *SetSMSAttributesInput) (req *request.Request, output *SetSMSAttributesOutput) { 2842 op := &request.Operation{ 2843 Name: opSetSMSAttributes, 2844 HTTPMethod: "POST", 2845 HTTPPath: "/", 2846 } 2847 2848 if input == nil { 2849 input = &SetSMSAttributesInput{} 2850 } 2851 2852 output = &SetSMSAttributesOutput{} 2853 req = c.newRequest(op, input, output) 2854 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2855 return 2856} 2857 2858// SetSMSAttributes API operation for Amazon Simple Notification Service. 2859// 2860// Use this request to set the default settings for sending SMS messages and 2861// receiving daily SMS usage reports. 2862// 2863// You can override some of these settings for a single message when you use 2864// the Publish action with the MessageAttributes.entry.N parameter. For more 2865// information, see Publishing to a mobile phone (https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html) 2866// in the Amazon SNS Developer Guide. 2867// 2868// To use this operation, you must grant the Amazon SNS service principal (sns.amazonaws.com) 2869// permission to perform the s3:ListBucket action. 2870// 2871// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2872// with awserr.Error's Code and Message methods to get detailed information about 2873// the error. 2874// 2875// See the AWS API reference guide for Amazon Simple Notification Service's 2876// API operation SetSMSAttributes for usage and error information. 2877// 2878// Returned Error Codes: 2879// * ErrCodeInvalidParameterException "InvalidParameter" 2880// Indicates that a request parameter does not comply with the associated constraints. 2881// 2882// * ErrCodeThrottledException "Throttled" 2883// Indicates that the rate at which requests have been submitted for this action 2884// exceeds the limit for your account. 2885// 2886// * ErrCodeInternalErrorException "InternalError" 2887// Indicates an internal service error. 2888// 2889// * ErrCodeAuthorizationErrorException "AuthorizationError" 2890// Indicates that the user has been denied access to the requested resource. 2891// 2892// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSMSAttributes 2893func (c *SNS) SetSMSAttributes(input *SetSMSAttributesInput) (*SetSMSAttributesOutput, error) { 2894 req, out := c.SetSMSAttributesRequest(input) 2895 return out, req.Send() 2896} 2897 2898// SetSMSAttributesWithContext is the same as SetSMSAttributes with the addition of 2899// the ability to pass a context and additional request options. 2900// 2901// See SetSMSAttributes for details on how to use this API operation. 2902// 2903// The context must be non-nil and will be used for request cancellation. If 2904// the context is nil a panic will occur. In the future the SDK may create 2905// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2906// for more information on using Contexts. 2907func (c *SNS) SetSMSAttributesWithContext(ctx aws.Context, input *SetSMSAttributesInput, opts ...request.Option) (*SetSMSAttributesOutput, error) { 2908 req, out := c.SetSMSAttributesRequest(input) 2909 req.SetContext(ctx) 2910 req.ApplyOptions(opts...) 2911 return out, req.Send() 2912} 2913 2914const opSetSubscriptionAttributes = "SetSubscriptionAttributes" 2915 2916// SetSubscriptionAttributesRequest generates a "aws/request.Request" representing the 2917// client's request for the SetSubscriptionAttributes operation. The "output" return 2918// value will be populated with the request's response once the request completes 2919// successfully. 2920// 2921// Use "Send" method on the returned Request to send the API call to the service. 2922// the "output" return value is not valid until after Send returns without error. 2923// 2924// See SetSubscriptionAttributes for more information on using the SetSubscriptionAttributes 2925// API call, and error handling. 2926// 2927// This method is useful when you want to inject custom logic or configuration 2928// into the SDK's request lifecycle. Such as custom headers, or retry logic. 2929// 2930// 2931// // Example sending a request using the SetSubscriptionAttributesRequest method. 2932// req, resp := client.SetSubscriptionAttributesRequest(params) 2933// 2934// err := req.Send() 2935// if err == nil { // resp is now filled 2936// fmt.Println(resp) 2937// } 2938// 2939// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSubscriptionAttributes 2940func (c *SNS) SetSubscriptionAttributesRequest(input *SetSubscriptionAttributesInput) (req *request.Request, output *SetSubscriptionAttributesOutput) { 2941 op := &request.Operation{ 2942 Name: opSetSubscriptionAttributes, 2943 HTTPMethod: "POST", 2944 HTTPPath: "/", 2945 } 2946 2947 if input == nil { 2948 input = &SetSubscriptionAttributesInput{} 2949 } 2950 2951 output = &SetSubscriptionAttributesOutput{} 2952 req = c.newRequest(op, input, output) 2953 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2954 return 2955} 2956 2957// SetSubscriptionAttributes API operation for Amazon Simple Notification Service. 2958// 2959// Allows a subscription owner to set an attribute of the subscription to a 2960// new value. 2961// 2962// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2963// with awserr.Error's Code and Message methods to get detailed information about 2964// the error. 2965// 2966// See the AWS API reference guide for Amazon Simple Notification Service's 2967// API operation SetSubscriptionAttributes for usage and error information. 2968// 2969// Returned Error Codes: 2970// * ErrCodeInvalidParameterException "InvalidParameter" 2971// Indicates that a request parameter does not comply with the associated constraints. 2972// 2973// * ErrCodeFilterPolicyLimitExceededException "FilterPolicyLimitExceeded" 2974// Indicates that the number of filter polices in your AWS account exceeds the 2975// limit. To add more filter polices, submit an SNS Limit Increase case in the 2976// AWS Support Center. 2977// 2978// * ErrCodeInternalErrorException "InternalError" 2979// Indicates an internal service error. 2980// 2981// * ErrCodeNotFoundException "NotFound" 2982// Indicates that the requested resource does not exist. 2983// 2984// * ErrCodeAuthorizationErrorException "AuthorizationError" 2985// Indicates that the user has been denied access to the requested resource. 2986// 2987// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetSubscriptionAttributes 2988func (c *SNS) SetSubscriptionAttributes(input *SetSubscriptionAttributesInput) (*SetSubscriptionAttributesOutput, error) { 2989 req, out := c.SetSubscriptionAttributesRequest(input) 2990 return out, req.Send() 2991} 2992 2993// SetSubscriptionAttributesWithContext is the same as SetSubscriptionAttributes with the addition of 2994// the ability to pass a context and additional request options. 2995// 2996// See SetSubscriptionAttributes for details on how to use this API operation. 2997// 2998// The context must be non-nil and will be used for request cancellation. If 2999// the context is nil a panic will occur. In the future the SDK may create 3000// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3001// for more information on using Contexts. 3002func (c *SNS) SetSubscriptionAttributesWithContext(ctx aws.Context, input *SetSubscriptionAttributesInput, opts ...request.Option) (*SetSubscriptionAttributesOutput, error) { 3003 req, out := c.SetSubscriptionAttributesRequest(input) 3004 req.SetContext(ctx) 3005 req.ApplyOptions(opts...) 3006 return out, req.Send() 3007} 3008 3009const opSetTopicAttributes = "SetTopicAttributes" 3010 3011// SetTopicAttributesRequest generates a "aws/request.Request" representing the 3012// client's request for the SetTopicAttributes operation. The "output" return 3013// value will be populated with the request's response once the request completes 3014// successfully. 3015// 3016// Use "Send" method on the returned Request to send the API call to the service. 3017// the "output" return value is not valid until after Send returns without error. 3018// 3019// See SetTopicAttributes for more information on using the SetTopicAttributes 3020// API call, and error handling. 3021// 3022// This method is useful when you want to inject custom logic or configuration 3023// into the SDK's request lifecycle. Such as custom headers, or retry logic. 3024// 3025// 3026// // Example sending a request using the SetTopicAttributesRequest method. 3027// req, resp := client.SetTopicAttributesRequest(params) 3028// 3029// err := req.Send() 3030// if err == nil { // resp is now filled 3031// fmt.Println(resp) 3032// } 3033// 3034// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetTopicAttributes 3035func (c *SNS) SetTopicAttributesRequest(input *SetTopicAttributesInput) (req *request.Request, output *SetTopicAttributesOutput) { 3036 op := &request.Operation{ 3037 Name: opSetTopicAttributes, 3038 HTTPMethod: "POST", 3039 HTTPPath: "/", 3040 } 3041 3042 if input == nil { 3043 input = &SetTopicAttributesInput{} 3044 } 3045 3046 output = &SetTopicAttributesOutput{} 3047 req = c.newRequest(op, input, output) 3048 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 3049 return 3050} 3051 3052// SetTopicAttributes API operation for Amazon Simple Notification Service. 3053// 3054// Allows a topic owner to set an attribute of the topic to a new value. 3055// 3056// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3057// with awserr.Error's Code and Message methods to get detailed information about 3058// the error. 3059// 3060// See the AWS API reference guide for Amazon Simple Notification Service's 3061// API operation SetTopicAttributes for usage and error information. 3062// 3063// Returned Error Codes: 3064// * ErrCodeInvalidParameterException "InvalidParameter" 3065// Indicates that a request parameter does not comply with the associated constraints. 3066// 3067// * ErrCodeInternalErrorException "InternalError" 3068// Indicates an internal service error. 3069// 3070// * ErrCodeNotFoundException "NotFound" 3071// Indicates that the requested resource does not exist. 3072// 3073// * ErrCodeAuthorizationErrorException "AuthorizationError" 3074// Indicates that the user has been denied access to the requested resource. 3075// 3076// * ErrCodeInvalidSecurityException "InvalidSecurity" 3077// The credential signature isn't valid. You must use an HTTPS endpoint and 3078// sign your request using Signature Version 4. 3079// 3080// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/SetTopicAttributes 3081func (c *SNS) SetTopicAttributes(input *SetTopicAttributesInput) (*SetTopicAttributesOutput, error) { 3082 req, out := c.SetTopicAttributesRequest(input) 3083 return out, req.Send() 3084} 3085 3086// SetTopicAttributesWithContext is the same as SetTopicAttributes with the addition of 3087// the ability to pass a context and additional request options. 3088// 3089// See SetTopicAttributes for details on how to use this API operation. 3090// 3091// The context must be non-nil and will be used for request cancellation. If 3092// the context is nil a panic will occur. In the future the SDK may create 3093// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3094// for more information on using Contexts. 3095func (c *SNS) SetTopicAttributesWithContext(ctx aws.Context, input *SetTopicAttributesInput, opts ...request.Option) (*SetTopicAttributesOutput, error) { 3096 req, out := c.SetTopicAttributesRequest(input) 3097 req.SetContext(ctx) 3098 req.ApplyOptions(opts...) 3099 return out, req.Send() 3100} 3101 3102const opSubscribe = "Subscribe" 3103 3104// SubscribeRequest generates a "aws/request.Request" representing the 3105// client's request for the Subscribe operation. The "output" return 3106// value will be populated with the request's response once the request completes 3107// successfully. 3108// 3109// Use "Send" method on the returned Request to send the API call to the service. 3110// the "output" return value is not valid until after Send returns without error. 3111// 3112// See Subscribe for more information on using the Subscribe 3113// API call, and error handling. 3114// 3115// This method is useful when you want to inject custom logic or configuration 3116// into the SDK's request lifecycle. Such as custom headers, or retry logic. 3117// 3118// 3119// // Example sending a request using the SubscribeRequest method. 3120// req, resp := client.SubscribeRequest(params) 3121// 3122// err := req.Send() 3123// if err == nil { // resp is now filled 3124// fmt.Println(resp) 3125// } 3126// 3127// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Subscribe 3128func (c *SNS) SubscribeRequest(input *SubscribeInput) (req *request.Request, output *SubscribeOutput) { 3129 op := &request.Operation{ 3130 Name: opSubscribe, 3131 HTTPMethod: "POST", 3132 HTTPPath: "/", 3133 } 3134 3135 if input == nil { 3136 input = &SubscribeInput{} 3137 } 3138 3139 output = &SubscribeOutput{} 3140 req = c.newRequest(op, input, output) 3141 return 3142} 3143 3144// Subscribe API operation for Amazon Simple Notification Service. 3145// 3146// Subscribes an endpoint to an Amazon SNS topic. If the endpoint type is HTTP/S 3147// or email, or if the endpoint and the topic are not in the same AWS account, 3148// the endpoint owner must run the ConfirmSubscription action to confirm the 3149// subscription. 3150// 3151// You call the ConfirmSubscription action with the token from the subscription 3152// response. Confirmation tokens are valid for three days. 3153// 3154// This action is throttled at 100 transactions per second (TPS). 3155// 3156// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3157// with awserr.Error's Code and Message methods to get detailed information about 3158// the error. 3159// 3160// See the AWS API reference guide for Amazon Simple Notification Service's 3161// API operation Subscribe for usage and error information. 3162// 3163// Returned Error Codes: 3164// * ErrCodeSubscriptionLimitExceededException "SubscriptionLimitExceeded" 3165// Indicates that the customer already owns the maximum allowed number of subscriptions. 3166// 3167// * ErrCodeFilterPolicyLimitExceededException "FilterPolicyLimitExceeded" 3168// Indicates that the number of filter polices in your AWS account exceeds the 3169// limit. To add more filter polices, submit an SNS Limit Increase case in the 3170// AWS Support Center. 3171// 3172// * ErrCodeInvalidParameterException "InvalidParameter" 3173// Indicates that a request parameter does not comply with the associated constraints. 3174// 3175// * ErrCodeInternalErrorException "InternalError" 3176// Indicates an internal service error. 3177// 3178// * ErrCodeNotFoundException "NotFound" 3179// Indicates that the requested resource does not exist. 3180// 3181// * ErrCodeAuthorizationErrorException "AuthorizationError" 3182// Indicates that the user has been denied access to the requested resource. 3183// 3184// * ErrCodeInvalidSecurityException "InvalidSecurity" 3185// The credential signature isn't valid. You must use an HTTPS endpoint and 3186// sign your request using Signature Version 4. 3187// 3188// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Subscribe 3189func (c *SNS) Subscribe(input *SubscribeInput) (*SubscribeOutput, error) { 3190 req, out := c.SubscribeRequest(input) 3191 return out, req.Send() 3192} 3193 3194// SubscribeWithContext is the same as Subscribe with the addition of 3195// the ability to pass a context and additional request options. 3196// 3197// See Subscribe for details on how to use this API operation. 3198// 3199// The context must be non-nil and will be used for request cancellation. If 3200// the context is nil a panic will occur. In the future the SDK may create 3201// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3202// for more information on using Contexts. 3203func (c *SNS) SubscribeWithContext(ctx aws.Context, input *SubscribeInput, opts ...request.Option) (*SubscribeOutput, error) { 3204 req, out := c.SubscribeRequest(input) 3205 req.SetContext(ctx) 3206 req.ApplyOptions(opts...) 3207 return out, req.Send() 3208} 3209 3210const opTagResource = "TagResource" 3211 3212// TagResourceRequest generates a "aws/request.Request" representing the 3213// client's request for the TagResource operation. The "output" return 3214// value will be populated with the request's response once the request completes 3215// successfully. 3216// 3217// Use "Send" method on the returned Request to send the API call to the service. 3218// the "output" return value is not valid until after Send returns without error. 3219// 3220// See TagResource for more information on using the TagResource 3221// API call, and error handling. 3222// 3223// This method is useful when you want to inject custom logic or configuration 3224// into the SDK's request lifecycle. Such as custom headers, or retry logic. 3225// 3226// 3227// // Example sending a request using the TagResourceRequest method. 3228// req, resp := client.TagResourceRequest(params) 3229// 3230// err := req.Send() 3231// if err == nil { // resp is now filled 3232// fmt.Println(resp) 3233// } 3234// 3235// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/TagResource 3236func (c *SNS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { 3237 op := &request.Operation{ 3238 Name: opTagResource, 3239 HTTPMethod: "POST", 3240 HTTPPath: "/", 3241 } 3242 3243 if input == nil { 3244 input = &TagResourceInput{} 3245 } 3246 3247 output = &TagResourceOutput{} 3248 req = c.newRequest(op, input, output) 3249 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 3250 return 3251} 3252 3253// TagResource API operation for Amazon Simple Notification Service. 3254// 3255// Add tags to the specified Amazon SNS topic. For an overview, see Amazon SNS 3256// Tags (https://docs.aws.amazon.com/sns/latest/dg/sns-tags.html) in the Amazon 3257// SNS Developer Guide. 3258// 3259// When you use topic tags, keep the following guidelines in mind: 3260// 3261// * Adding more than 50 tags to a topic isn't recommended. 3262// 3263// * Tags don't have any semantic meaning. Amazon SNS interprets tags as 3264// character strings. 3265// 3266// * Tags are case-sensitive. 3267// 3268// * A new tag with a key identical to that of an existing tag overwrites 3269// the existing tag. 3270// 3271// * Tagging actions are limited to 10 TPS per AWS account, per AWS region. 3272// If your application requires a higher throughput, file a technical support 3273// request (https://console.aws.amazon.com/support/home#/case/create?issueType=technical). 3274// 3275// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3276// with awserr.Error's Code and Message methods to get detailed information about 3277// the error. 3278// 3279// See the AWS API reference guide for Amazon Simple Notification Service's 3280// API operation TagResource for usage and error information. 3281// 3282// Returned Error Codes: 3283// * ErrCodeResourceNotFoundException "ResourceNotFound" 3284// Can't tag resource. Verify that the topic exists. 3285// 3286// * ErrCodeTagLimitExceededException "TagLimitExceeded" 3287// Can't add more than 50 tags to a topic. 3288// 3289// * ErrCodeStaleTagException "StaleTag" 3290// A tag has been added to a resource with the same ARN as a deleted resource. 3291// Wait a short while and then retry the operation. 3292// 3293// * ErrCodeTagPolicyException "TagPolicy" 3294// The request doesn't comply with the IAM tag policy. Correct your request 3295// and then retry it. 3296// 3297// * ErrCodeInvalidParameterException "InvalidParameter" 3298// Indicates that a request parameter does not comply with the associated constraints. 3299// 3300// * ErrCodeAuthorizationErrorException "AuthorizationError" 3301// Indicates that the user has been denied access to the requested resource. 3302// 3303// * ErrCodeConcurrentAccessException "ConcurrentAccess" 3304// Can't perform multiple operations on a tag simultaneously. Perform the operations 3305// sequentially. 3306// 3307// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/TagResource 3308func (c *SNS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { 3309 req, out := c.TagResourceRequest(input) 3310 return out, req.Send() 3311} 3312 3313// TagResourceWithContext is the same as TagResource with the addition of 3314// the ability to pass a context and additional request options. 3315// 3316// See TagResource for details on how to use this API operation. 3317// 3318// The context must be non-nil and will be used for request cancellation. If 3319// the context is nil a panic will occur. In the future the SDK may create 3320// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3321// for more information on using Contexts. 3322func (c *SNS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { 3323 req, out := c.TagResourceRequest(input) 3324 req.SetContext(ctx) 3325 req.ApplyOptions(opts...) 3326 return out, req.Send() 3327} 3328 3329const opUnsubscribe = "Unsubscribe" 3330 3331// UnsubscribeRequest generates a "aws/request.Request" representing the 3332// client's request for the Unsubscribe operation. The "output" return 3333// value will be populated with the request's response once the request completes 3334// successfully. 3335// 3336// Use "Send" method on the returned Request to send the API call to the service. 3337// the "output" return value is not valid until after Send returns without error. 3338// 3339// See Unsubscribe for more information on using the Unsubscribe 3340// API call, and error handling. 3341// 3342// This method is useful when you want to inject custom logic or configuration 3343// into the SDK's request lifecycle. Such as custom headers, or retry logic. 3344// 3345// 3346// // Example sending a request using the UnsubscribeRequest method. 3347// req, resp := client.UnsubscribeRequest(params) 3348// 3349// err := req.Send() 3350// if err == nil { // resp is now filled 3351// fmt.Println(resp) 3352// } 3353// 3354// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Unsubscribe 3355func (c *SNS) UnsubscribeRequest(input *UnsubscribeInput) (req *request.Request, output *UnsubscribeOutput) { 3356 op := &request.Operation{ 3357 Name: opUnsubscribe, 3358 HTTPMethod: "POST", 3359 HTTPPath: "/", 3360 } 3361 3362 if input == nil { 3363 input = &UnsubscribeInput{} 3364 } 3365 3366 output = &UnsubscribeOutput{} 3367 req = c.newRequest(op, input, output) 3368 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 3369 return 3370} 3371 3372// Unsubscribe API operation for Amazon Simple Notification Service. 3373// 3374// Deletes a subscription. If the subscription requires authentication for deletion, 3375// only the owner of the subscription or the topic's owner can unsubscribe, 3376// and an AWS signature is required. If the Unsubscribe call does not require 3377// authentication and the requester is not the subscription owner, a final cancellation 3378// message is delivered to the endpoint, so that the endpoint owner can easily 3379// resubscribe to the topic if the Unsubscribe request was unintended. 3380// 3381// This action is throttled at 100 transactions per second (TPS). 3382// 3383// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3384// with awserr.Error's Code and Message methods to get detailed information about 3385// the error. 3386// 3387// See the AWS API reference guide for Amazon Simple Notification Service's 3388// API operation Unsubscribe for usage and error information. 3389// 3390// Returned Error Codes: 3391// * ErrCodeInvalidParameterException "InvalidParameter" 3392// Indicates that a request parameter does not comply with the associated constraints. 3393// 3394// * ErrCodeInternalErrorException "InternalError" 3395// Indicates an internal service error. 3396// 3397// * ErrCodeAuthorizationErrorException "AuthorizationError" 3398// Indicates that the user has been denied access to the requested resource. 3399// 3400// * ErrCodeNotFoundException "NotFound" 3401// Indicates that the requested resource does not exist. 3402// 3403// * ErrCodeInvalidSecurityException "InvalidSecurity" 3404// The credential signature isn't valid. You must use an HTTPS endpoint and 3405// sign your request using Signature Version 4. 3406// 3407// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/Unsubscribe 3408func (c *SNS) Unsubscribe(input *UnsubscribeInput) (*UnsubscribeOutput, error) { 3409 req, out := c.UnsubscribeRequest(input) 3410 return out, req.Send() 3411} 3412 3413// UnsubscribeWithContext is the same as Unsubscribe with the addition of 3414// the ability to pass a context and additional request options. 3415// 3416// See Unsubscribe for details on how to use this API operation. 3417// 3418// The context must be non-nil and will be used for request cancellation. If 3419// the context is nil a panic will occur. In the future the SDK may create 3420// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3421// for more information on using Contexts. 3422func (c *SNS) UnsubscribeWithContext(ctx aws.Context, input *UnsubscribeInput, opts ...request.Option) (*UnsubscribeOutput, error) { 3423 req, out := c.UnsubscribeRequest(input) 3424 req.SetContext(ctx) 3425 req.ApplyOptions(opts...) 3426 return out, req.Send() 3427} 3428 3429const opUntagResource = "UntagResource" 3430 3431// UntagResourceRequest generates a "aws/request.Request" representing the 3432// client's request for the UntagResource operation. The "output" return 3433// value will be populated with the request's response once the request completes 3434// successfully. 3435// 3436// Use "Send" method on the returned Request to send the API call to the service. 3437// the "output" return value is not valid until after Send returns without error. 3438// 3439// See UntagResource for more information on using the UntagResource 3440// API call, and error handling. 3441// 3442// This method is useful when you want to inject custom logic or configuration 3443// into the SDK's request lifecycle. Such as custom headers, or retry logic. 3444// 3445// 3446// // Example sending a request using the UntagResourceRequest method. 3447// req, resp := client.UntagResourceRequest(params) 3448// 3449// err := req.Send() 3450// if err == nil { // resp is now filled 3451// fmt.Println(resp) 3452// } 3453// 3454// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/UntagResource 3455func (c *SNS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { 3456 op := &request.Operation{ 3457 Name: opUntagResource, 3458 HTTPMethod: "POST", 3459 HTTPPath: "/", 3460 } 3461 3462 if input == nil { 3463 input = &UntagResourceInput{} 3464 } 3465 3466 output = &UntagResourceOutput{} 3467 req = c.newRequest(op, input, output) 3468 req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 3469 return 3470} 3471 3472// UntagResource API operation for Amazon Simple Notification Service. 3473// 3474// Remove tags from the specified Amazon SNS topic. For an overview, see Amazon 3475// SNS Tags (https://docs.aws.amazon.com/sns/latest/dg/sns-tags.html) in the 3476// Amazon SNS Developer Guide. 3477// 3478// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3479// with awserr.Error's Code and Message methods to get detailed information about 3480// the error. 3481// 3482// See the AWS API reference guide for Amazon Simple Notification Service's 3483// API operation UntagResource for usage and error information. 3484// 3485// Returned Error Codes: 3486// * ErrCodeResourceNotFoundException "ResourceNotFound" 3487// Can't tag resource. Verify that the topic exists. 3488// 3489// * ErrCodeTagLimitExceededException "TagLimitExceeded" 3490// Can't add more than 50 tags to a topic. 3491// 3492// * ErrCodeStaleTagException "StaleTag" 3493// A tag has been added to a resource with the same ARN as a deleted resource. 3494// Wait a short while and then retry the operation. 3495// 3496// * ErrCodeTagPolicyException "TagPolicy" 3497// The request doesn't comply with the IAM tag policy. Correct your request 3498// and then retry it. 3499// 3500// * ErrCodeInvalidParameterException "InvalidParameter" 3501// Indicates that a request parameter does not comply with the associated constraints. 3502// 3503// * ErrCodeAuthorizationErrorException "AuthorizationError" 3504// Indicates that the user has been denied access to the requested resource. 3505// 3506// * ErrCodeConcurrentAccessException "ConcurrentAccess" 3507// Can't perform multiple operations on a tag simultaneously. Perform the operations 3508// sequentially. 3509// 3510// See also, https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/UntagResource 3511func (c *SNS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { 3512 req, out := c.UntagResourceRequest(input) 3513 return out, req.Send() 3514} 3515 3516// UntagResourceWithContext is the same as UntagResource with the addition of 3517// the ability to pass a context and additional request options. 3518// 3519// See UntagResource for details on how to use this API operation. 3520// 3521// The context must be non-nil and will be used for request cancellation. If 3522// the context is nil a panic will occur. In the future the SDK may create 3523// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3524// for more information on using Contexts. 3525func (c *SNS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { 3526 req, out := c.UntagResourceRequest(input) 3527 req.SetContext(ctx) 3528 req.ApplyOptions(opts...) 3529 return out, req.Send() 3530} 3531 3532type AddPermissionInput struct { 3533 _ struct{} `type:"structure"` 3534 3535 // The AWS account IDs of the users (principals) who will be given access to 3536 // the specified actions. The users must have AWS accounts, but do not need 3537 // to be signed up for this service. 3538 // 3539 // AWSAccountId is a required field 3540 AWSAccountId []*string `type:"list" required:"true"` 3541 3542 // The action you want to allow for the specified principal(s). 3543 // 3544 // Valid values: Any Amazon SNS action name, for example Publish. 3545 // 3546 // ActionName is a required field 3547 ActionName []*string `type:"list" required:"true"` 3548 3549 // A unique identifier for the new policy statement. 3550 // 3551 // Label is a required field 3552 Label *string `type:"string" required:"true"` 3553 3554 // The ARN of the topic whose access control policy you wish to modify. 3555 // 3556 // TopicArn is a required field 3557 TopicArn *string `type:"string" required:"true"` 3558} 3559 3560// String returns the string representation 3561func (s AddPermissionInput) String() string { 3562 return awsutil.Prettify(s) 3563} 3564 3565// GoString returns the string representation 3566func (s AddPermissionInput) GoString() string { 3567 return s.String() 3568} 3569 3570// Validate inspects the fields of the type to determine if they are valid. 3571func (s *AddPermissionInput) Validate() error { 3572 invalidParams := request.ErrInvalidParams{Context: "AddPermissionInput"} 3573 if s.AWSAccountId == nil { 3574 invalidParams.Add(request.NewErrParamRequired("AWSAccountId")) 3575 } 3576 if s.ActionName == nil { 3577 invalidParams.Add(request.NewErrParamRequired("ActionName")) 3578 } 3579 if s.Label == nil { 3580 invalidParams.Add(request.NewErrParamRequired("Label")) 3581 } 3582 if s.TopicArn == nil { 3583 invalidParams.Add(request.NewErrParamRequired("TopicArn")) 3584 } 3585 3586 if invalidParams.Len() > 0 { 3587 return invalidParams 3588 } 3589 return nil 3590} 3591 3592// SetAWSAccountId sets the AWSAccountId field's value. 3593func (s *AddPermissionInput) SetAWSAccountId(v []*string) *AddPermissionInput { 3594 s.AWSAccountId = v 3595 return s 3596} 3597 3598// SetActionName sets the ActionName field's value. 3599func (s *AddPermissionInput) SetActionName(v []*string) *AddPermissionInput { 3600 s.ActionName = v 3601 return s 3602} 3603 3604// SetLabel sets the Label field's value. 3605func (s *AddPermissionInput) SetLabel(v string) *AddPermissionInput { 3606 s.Label = &v 3607 return s 3608} 3609 3610// SetTopicArn sets the TopicArn field's value. 3611func (s *AddPermissionInput) SetTopicArn(v string) *AddPermissionInput { 3612 s.TopicArn = &v 3613 return s 3614} 3615 3616type AddPermissionOutput struct { 3617 _ struct{} `type:"structure"` 3618} 3619 3620// String returns the string representation 3621func (s AddPermissionOutput) String() string { 3622 return awsutil.Prettify(s) 3623} 3624 3625// GoString returns the string representation 3626func (s AddPermissionOutput) GoString() string { 3627 return s.String() 3628} 3629 3630// The input for the CheckIfPhoneNumberIsOptedOut action. 3631type CheckIfPhoneNumberIsOptedOutInput struct { 3632 _ struct{} `type:"structure"` 3633 3634 // The phone number for which you want to check the opt out status. 3635 // 3636 // PhoneNumber is a required field 3637 PhoneNumber *string `locationName:"phoneNumber" type:"string" required:"true"` 3638} 3639 3640// String returns the string representation 3641func (s CheckIfPhoneNumberIsOptedOutInput) String() string { 3642 return awsutil.Prettify(s) 3643} 3644 3645// GoString returns the string representation 3646func (s CheckIfPhoneNumberIsOptedOutInput) GoString() string { 3647 return s.String() 3648} 3649 3650// Validate inspects the fields of the type to determine if they are valid. 3651func (s *CheckIfPhoneNumberIsOptedOutInput) Validate() error { 3652 invalidParams := request.ErrInvalidParams{Context: "CheckIfPhoneNumberIsOptedOutInput"} 3653 if s.PhoneNumber == nil { 3654 invalidParams.Add(request.NewErrParamRequired("PhoneNumber")) 3655 } 3656 3657 if invalidParams.Len() > 0 { 3658 return invalidParams 3659 } 3660 return nil 3661} 3662 3663// SetPhoneNumber sets the PhoneNumber field's value. 3664func (s *CheckIfPhoneNumberIsOptedOutInput) SetPhoneNumber(v string) *CheckIfPhoneNumberIsOptedOutInput { 3665 s.PhoneNumber = &v 3666 return s 3667} 3668 3669// The response from the CheckIfPhoneNumberIsOptedOut action. 3670type CheckIfPhoneNumberIsOptedOutOutput struct { 3671 _ struct{} `type:"structure"` 3672 3673 // Indicates whether the phone number is opted out: 3674 // 3675 // * true – The phone number is opted out, meaning you cannot publish SMS 3676 // messages to it. 3677 // 3678 // * false – The phone number is opted in, meaning you can publish SMS 3679 // messages to it. 3680 IsOptedOut *bool `locationName:"isOptedOut" type:"boolean"` 3681} 3682 3683// String returns the string representation 3684func (s CheckIfPhoneNumberIsOptedOutOutput) String() string { 3685 return awsutil.Prettify(s) 3686} 3687 3688// GoString returns the string representation 3689func (s CheckIfPhoneNumberIsOptedOutOutput) GoString() string { 3690 return s.String() 3691} 3692 3693// SetIsOptedOut sets the IsOptedOut field's value. 3694func (s *CheckIfPhoneNumberIsOptedOutOutput) SetIsOptedOut(v bool) *CheckIfPhoneNumberIsOptedOutOutput { 3695 s.IsOptedOut = &v 3696 return s 3697} 3698 3699// Input for ConfirmSubscription action. 3700type ConfirmSubscriptionInput struct { 3701 _ struct{} `type:"structure"` 3702 3703 // Disallows unauthenticated unsubscribes of the subscription. If the value 3704 // of this parameter is true and the request has an AWS signature, then only 3705 // the topic owner and the subscription owner can unsubscribe the endpoint. 3706 // The unsubscribe action requires AWS authentication. 3707 AuthenticateOnUnsubscribe *string `type:"string"` 3708 3709 // Short-lived token sent to an endpoint during the Subscribe action. 3710 // 3711 // Token is a required field 3712 Token *string `type:"string" required:"true"` 3713 3714 // The ARN of the topic for which you wish to confirm a subscription. 3715 // 3716 // TopicArn is a required field 3717 TopicArn *string `type:"string" required:"true"` 3718} 3719 3720// String returns the string representation 3721func (s ConfirmSubscriptionInput) String() string { 3722 return awsutil.Prettify(s) 3723} 3724 3725// GoString returns the string representation 3726func (s ConfirmSubscriptionInput) GoString() string { 3727 return s.String() 3728} 3729 3730// Validate inspects the fields of the type to determine if they are valid. 3731func (s *ConfirmSubscriptionInput) Validate() error { 3732 invalidParams := request.ErrInvalidParams{Context: "ConfirmSubscriptionInput"} 3733 if s.Token == nil { 3734 invalidParams.Add(request.NewErrParamRequired("Token")) 3735 } 3736 if s.TopicArn == nil { 3737 invalidParams.Add(request.NewErrParamRequired("TopicArn")) 3738 } 3739 3740 if invalidParams.Len() > 0 { 3741 return invalidParams 3742 } 3743 return nil 3744} 3745 3746// SetAuthenticateOnUnsubscribe sets the AuthenticateOnUnsubscribe field's value. 3747func (s *ConfirmSubscriptionInput) SetAuthenticateOnUnsubscribe(v string) *ConfirmSubscriptionInput { 3748 s.AuthenticateOnUnsubscribe = &v 3749 return s 3750} 3751 3752// SetToken sets the Token field's value. 3753func (s *ConfirmSubscriptionInput) SetToken(v string) *ConfirmSubscriptionInput { 3754 s.Token = &v 3755 return s 3756} 3757 3758// SetTopicArn sets the TopicArn field's value. 3759func (s *ConfirmSubscriptionInput) SetTopicArn(v string) *ConfirmSubscriptionInput { 3760 s.TopicArn = &v 3761 return s 3762} 3763 3764// Response for ConfirmSubscriptions action. 3765type ConfirmSubscriptionOutput struct { 3766 _ struct{} `type:"structure"` 3767 3768 // The ARN of the created subscription. 3769 SubscriptionArn *string `type:"string"` 3770} 3771 3772// String returns the string representation 3773func (s ConfirmSubscriptionOutput) String() string { 3774 return awsutil.Prettify(s) 3775} 3776 3777// GoString returns the string representation 3778func (s ConfirmSubscriptionOutput) GoString() string { 3779 return s.String() 3780} 3781 3782// SetSubscriptionArn sets the SubscriptionArn field's value. 3783func (s *ConfirmSubscriptionOutput) SetSubscriptionArn(v string) *ConfirmSubscriptionOutput { 3784 s.SubscriptionArn = &v 3785 return s 3786} 3787 3788// Input for CreatePlatformApplication action. 3789type CreatePlatformApplicationInput struct { 3790 _ struct{} `type:"structure"` 3791 3792 // For a list of attributes, see SetPlatformApplicationAttributes (https://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html) 3793 // 3794 // Attributes is a required field 3795 Attributes map[string]*string `type:"map" required:"true"` 3796 3797 // Application names must be made up of only uppercase and lowercase ASCII letters, 3798 // numbers, underscores, hyphens, and periods, and must be between 1 and 256 3799 // characters long. 3800 // 3801 // Name is a required field 3802 Name *string `type:"string" required:"true"` 3803 3804 // The following platforms are supported: ADM (Amazon Device Messaging), APNS 3805 // (Apple Push Notification Service), APNS_SANDBOX, and GCM (Firebase Cloud 3806 // Messaging). 3807 // 3808 // Platform is a required field 3809 Platform *string `type:"string" required:"true"` 3810} 3811 3812// String returns the string representation 3813func (s CreatePlatformApplicationInput) String() string { 3814 return awsutil.Prettify(s) 3815} 3816 3817// GoString returns the string representation 3818func (s CreatePlatformApplicationInput) GoString() string { 3819 return s.String() 3820} 3821 3822// Validate inspects the fields of the type to determine if they are valid. 3823func (s *CreatePlatformApplicationInput) Validate() error { 3824 invalidParams := request.ErrInvalidParams{Context: "CreatePlatformApplicationInput"} 3825 if s.Attributes == nil { 3826 invalidParams.Add(request.NewErrParamRequired("Attributes")) 3827 } 3828 if s.Name == nil { 3829 invalidParams.Add(request.NewErrParamRequired("Name")) 3830 } 3831 if s.Platform == nil { 3832 invalidParams.Add(request.NewErrParamRequired("Platform")) 3833 } 3834 3835 if invalidParams.Len() > 0 { 3836 return invalidParams 3837 } 3838 return nil 3839} 3840 3841// SetAttributes sets the Attributes field's value. 3842func (s *CreatePlatformApplicationInput) SetAttributes(v map[string]*string) *CreatePlatformApplicationInput { 3843 s.Attributes = v 3844 return s 3845} 3846 3847// SetName sets the Name field's value. 3848func (s *CreatePlatformApplicationInput) SetName(v string) *CreatePlatformApplicationInput { 3849 s.Name = &v 3850 return s 3851} 3852 3853// SetPlatform sets the Platform field's value. 3854func (s *CreatePlatformApplicationInput) SetPlatform(v string) *CreatePlatformApplicationInput { 3855 s.Platform = &v 3856 return s 3857} 3858 3859// Response from CreatePlatformApplication action. 3860type CreatePlatformApplicationOutput struct { 3861 _ struct{} `type:"structure"` 3862 3863 // PlatformApplicationArn is returned. 3864 PlatformApplicationArn *string `type:"string"` 3865} 3866 3867// String returns the string representation 3868func (s CreatePlatformApplicationOutput) String() string { 3869 return awsutil.Prettify(s) 3870} 3871 3872// GoString returns the string representation 3873func (s CreatePlatformApplicationOutput) GoString() string { 3874 return s.String() 3875} 3876 3877// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. 3878func (s *CreatePlatformApplicationOutput) SetPlatformApplicationArn(v string) *CreatePlatformApplicationOutput { 3879 s.PlatformApplicationArn = &v 3880 return s 3881} 3882 3883// Input for CreatePlatformEndpoint action. 3884type CreatePlatformEndpointInput struct { 3885 _ struct{} `type:"structure"` 3886 3887 // For a list of attributes, see SetEndpointAttributes (https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html). 3888 Attributes map[string]*string `type:"map"` 3889 3890 // Arbitrary user data to associate with the endpoint. Amazon SNS does not use 3891 // this data. The data must be in UTF-8 format and less than 2KB. 3892 CustomUserData *string `type:"string"` 3893 3894 // PlatformApplicationArn returned from CreatePlatformApplication is used to 3895 // create a an endpoint. 3896 // 3897 // PlatformApplicationArn is a required field 3898 PlatformApplicationArn *string `type:"string" required:"true"` 3899 3900 // Unique identifier created by the notification service for an app on a device. 3901 // The specific name for Token will vary, depending on which notification service 3902 // is being used. For example, when using APNS as the notification service, 3903 // you need the device token. Alternatively, when using GCM (Firebase Cloud 3904 // Messaging) or ADM, the device token equivalent is called the registration 3905 // ID. 3906 // 3907 // Token is a required field 3908 Token *string `type:"string" required:"true"` 3909} 3910 3911// String returns the string representation 3912func (s CreatePlatformEndpointInput) String() string { 3913 return awsutil.Prettify(s) 3914} 3915 3916// GoString returns the string representation 3917func (s CreatePlatformEndpointInput) GoString() string { 3918 return s.String() 3919} 3920 3921// Validate inspects the fields of the type to determine if they are valid. 3922func (s *CreatePlatformEndpointInput) Validate() error { 3923 invalidParams := request.ErrInvalidParams{Context: "CreatePlatformEndpointInput"} 3924 if s.PlatformApplicationArn == nil { 3925 invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) 3926 } 3927 if s.Token == nil { 3928 invalidParams.Add(request.NewErrParamRequired("Token")) 3929 } 3930 3931 if invalidParams.Len() > 0 { 3932 return invalidParams 3933 } 3934 return nil 3935} 3936 3937// SetAttributes sets the Attributes field's value. 3938func (s *CreatePlatformEndpointInput) SetAttributes(v map[string]*string) *CreatePlatformEndpointInput { 3939 s.Attributes = v 3940 return s 3941} 3942 3943// SetCustomUserData sets the CustomUserData field's value. 3944func (s *CreatePlatformEndpointInput) SetCustomUserData(v string) *CreatePlatformEndpointInput { 3945 s.CustomUserData = &v 3946 return s 3947} 3948 3949// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. 3950func (s *CreatePlatformEndpointInput) SetPlatformApplicationArn(v string) *CreatePlatformEndpointInput { 3951 s.PlatformApplicationArn = &v 3952 return s 3953} 3954 3955// SetToken sets the Token field's value. 3956func (s *CreatePlatformEndpointInput) SetToken(v string) *CreatePlatformEndpointInput { 3957 s.Token = &v 3958 return s 3959} 3960 3961// Response from CreateEndpoint action. 3962type CreatePlatformEndpointOutput struct { 3963 _ struct{} `type:"structure"` 3964 3965 // EndpointArn returned from CreateEndpoint action. 3966 EndpointArn *string `type:"string"` 3967} 3968 3969// String returns the string representation 3970func (s CreatePlatformEndpointOutput) String() string { 3971 return awsutil.Prettify(s) 3972} 3973 3974// GoString returns the string representation 3975func (s CreatePlatformEndpointOutput) GoString() string { 3976 return s.String() 3977} 3978 3979// SetEndpointArn sets the EndpointArn field's value. 3980func (s *CreatePlatformEndpointOutput) SetEndpointArn(v string) *CreatePlatformEndpointOutput { 3981 s.EndpointArn = &v 3982 return s 3983} 3984 3985// Input for CreateTopic action. 3986type CreateTopicInput struct { 3987 _ struct{} `type:"structure"` 3988 3989 // A map of attributes with their corresponding values. 3990 // 3991 // The following lists the names, descriptions, and values of the special request 3992 // parameters that the CreateTopic action uses: 3993 // 3994 // * DeliveryPolicy – The policy that defines how Amazon SNS retries failed 3995 // deliveries to HTTP/S endpoints. 3996 // 3997 // * DisplayName – The display name to use for a topic with SMS subscriptions. 3998 // 3999 // * FifoTopic – Set to true to create a FIFO topic. 4000 // 4001 // * Policy – The policy that defines who can access your topic. By default, 4002 // only the topic owner can publish or subscribe to the topic. 4003 // 4004 // The following attribute applies only to server-side-encryption (https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): 4005 // 4006 // * KmsMasterKeyId – The ID of an AWS-managed customer master key (CMK) 4007 // for Amazon SNS or a custom CMK. For more information, see Key Terms (https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). 4008 // For more examples, see KeyId (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) 4009 // in the AWS Key Management Service API Reference. 4010 // 4011 // The following attributes apply only to FIFO topics (https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): 4012 // 4013 // * FifoTopic – When this is set to true, a FIFO topic is created. 4014 // 4015 // * ContentBasedDeduplication – Enables content-based deduplication for 4016 // FIFO topics. By default, ContentBasedDeduplication is set to false. If 4017 // you create a FIFO topic and this attribute is false, you must specify 4018 // a value for the MessageDeduplicationId parameter for the Publish (https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) 4019 // action. When you set ContentBasedDeduplication to true, Amazon SNS uses 4020 // a SHA-256 hash to generate the MessageDeduplicationId using the body of 4021 // the message (but not the attributes of the message). (Optional) To override 4022 // the generated value, you can specify a value for the the MessageDeduplicationId 4023 // parameter for the Publish action. 4024 Attributes map[string]*string `type:"map"` 4025 4026 // The name of the topic you want to create. 4027 // 4028 // Constraints: Topic names must be made up of only uppercase and lowercase 4029 // ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 4030 // 256 characters long. 4031 // 4032 // For a FIFO (first-in-first-out) topic, the name must end with the .fifo suffix. 4033 // 4034 // Name is a required field 4035 Name *string `type:"string" required:"true"` 4036 4037 // The list of tags to add to a new topic. 4038 // 4039 // To be able to tag a topic on creation, you must have the sns:CreateTopic 4040 // and sns:TagResource permissions. 4041 Tags []*Tag `type:"list"` 4042} 4043 4044// String returns the string representation 4045func (s CreateTopicInput) String() string { 4046 return awsutil.Prettify(s) 4047} 4048 4049// GoString returns the string representation 4050func (s CreateTopicInput) GoString() string { 4051 return s.String() 4052} 4053 4054// Validate inspects the fields of the type to determine if they are valid. 4055func (s *CreateTopicInput) Validate() error { 4056 invalidParams := request.ErrInvalidParams{Context: "CreateTopicInput"} 4057 if s.Name == nil { 4058 invalidParams.Add(request.NewErrParamRequired("Name")) 4059 } 4060 if s.Tags != nil { 4061 for i, v := range s.Tags { 4062 if v == nil { 4063 continue 4064 } 4065 if err := v.Validate(); err != nil { 4066 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) 4067 } 4068 } 4069 } 4070 4071 if invalidParams.Len() > 0 { 4072 return invalidParams 4073 } 4074 return nil 4075} 4076 4077// SetAttributes sets the Attributes field's value. 4078func (s *CreateTopicInput) SetAttributes(v map[string]*string) *CreateTopicInput { 4079 s.Attributes = v 4080 return s 4081} 4082 4083// SetName sets the Name field's value. 4084func (s *CreateTopicInput) SetName(v string) *CreateTopicInput { 4085 s.Name = &v 4086 return s 4087} 4088 4089// SetTags sets the Tags field's value. 4090func (s *CreateTopicInput) SetTags(v []*Tag) *CreateTopicInput { 4091 s.Tags = v 4092 return s 4093} 4094 4095// Response from CreateTopic action. 4096type CreateTopicOutput struct { 4097 _ struct{} `type:"structure"` 4098 4099 // The Amazon Resource Name (ARN) assigned to the created topic. 4100 TopicArn *string `type:"string"` 4101} 4102 4103// String returns the string representation 4104func (s CreateTopicOutput) String() string { 4105 return awsutil.Prettify(s) 4106} 4107 4108// GoString returns the string representation 4109func (s CreateTopicOutput) GoString() string { 4110 return s.String() 4111} 4112 4113// SetTopicArn sets the TopicArn field's value. 4114func (s *CreateTopicOutput) SetTopicArn(v string) *CreateTopicOutput { 4115 s.TopicArn = &v 4116 return s 4117} 4118 4119// Input for DeleteEndpoint action. 4120type DeleteEndpointInput struct { 4121 _ struct{} `type:"structure"` 4122 4123 // EndpointArn of endpoint to delete. 4124 // 4125 // EndpointArn is a required field 4126 EndpointArn *string `type:"string" required:"true"` 4127} 4128 4129// String returns the string representation 4130func (s DeleteEndpointInput) String() string { 4131 return awsutil.Prettify(s) 4132} 4133 4134// GoString returns the string representation 4135func (s DeleteEndpointInput) GoString() string { 4136 return s.String() 4137} 4138 4139// Validate inspects the fields of the type to determine if they are valid. 4140func (s *DeleteEndpointInput) Validate() error { 4141 invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointInput"} 4142 if s.EndpointArn == nil { 4143 invalidParams.Add(request.NewErrParamRequired("EndpointArn")) 4144 } 4145 4146 if invalidParams.Len() > 0 { 4147 return invalidParams 4148 } 4149 return nil 4150} 4151 4152// SetEndpointArn sets the EndpointArn field's value. 4153func (s *DeleteEndpointInput) SetEndpointArn(v string) *DeleteEndpointInput { 4154 s.EndpointArn = &v 4155 return s 4156} 4157 4158type DeleteEndpointOutput struct { 4159 _ struct{} `type:"structure"` 4160} 4161 4162// String returns the string representation 4163func (s DeleteEndpointOutput) String() string { 4164 return awsutil.Prettify(s) 4165} 4166 4167// GoString returns the string representation 4168func (s DeleteEndpointOutput) GoString() string { 4169 return s.String() 4170} 4171 4172// Input for DeletePlatformApplication action. 4173type DeletePlatformApplicationInput struct { 4174 _ struct{} `type:"structure"` 4175 4176 // PlatformApplicationArn of platform application object to delete. 4177 // 4178 // PlatformApplicationArn is a required field 4179 PlatformApplicationArn *string `type:"string" required:"true"` 4180} 4181 4182// String returns the string representation 4183func (s DeletePlatformApplicationInput) String() string { 4184 return awsutil.Prettify(s) 4185} 4186 4187// GoString returns the string representation 4188func (s DeletePlatformApplicationInput) GoString() string { 4189 return s.String() 4190} 4191 4192// Validate inspects the fields of the type to determine if they are valid. 4193func (s *DeletePlatformApplicationInput) Validate() error { 4194 invalidParams := request.ErrInvalidParams{Context: "DeletePlatformApplicationInput"} 4195 if s.PlatformApplicationArn == nil { 4196 invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) 4197 } 4198 4199 if invalidParams.Len() > 0 { 4200 return invalidParams 4201 } 4202 return nil 4203} 4204 4205// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. 4206func (s *DeletePlatformApplicationInput) SetPlatformApplicationArn(v string) *DeletePlatformApplicationInput { 4207 s.PlatformApplicationArn = &v 4208 return s 4209} 4210 4211type DeletePlatformApplicationOutput struct { 4212 _ struct{} `type:"structure"` 4213} 4214 4215// String returns the string representation 4216func (s DeletePlatformApplicationOutput) String() string { 4217 return awsutil.Prettify(s) 4218} 4219 4220// GoString returns the string representation 4221func (s DeletePlatformApplicationOutput) GoString() string { 4222 return s.String() 4223} 4224 4225type DeleteTopicInput struct { 4226 _ struct{} `type:"structure"` 4227 4228 // The ARN of the topic you want to delete. 4229 // 4230 // TopicArn is a required field 4231 TopicArn *string `type:"string" required:"true"` 4232} 4233 4234// String returns the string representation 4235func (s DeleteTopicInput) String() string { 4236 return awsutil.Prettify(s) 4237} 4238 4239// GoString returns the string representation 4240func (s DeleteTopicInput) GoString() string { 4241 return s.String() 4242} 4243 4244// Validate inspects the fields of the type to determine if they are valid. 4245func (s *DeleteTopicInput) Validate() error { 4246 invalidParams := request.ErrInvalidParams{Context: "DeleteTopicInput"} 4247 if s.TopicArn == nil { 4248 invalidParams.Add(request.NewErrParamRequired("TopicArn")) 4249 } 4250 4251 if invalidParams.Len() > 0 { 4252 return invalidParams 4253 } 4254 return nil 4255} 4256 4257// SetTopicArn sets the TopicArn field's value. 4258func (s *DeleteTopicInput) SetTopicArn(v string) *DeleteTopicInput { 4259 s.TopicArn = &v 4260 return s 4261} 4262 4263type DeleteTopicOutput struct { 4264 _ struct{} `type:"structure"` 4265} 4266 4267// String returns the string representation 4268func (s DeleteTopicOutput) String() string { 4269 return awsutil.Prettify(s) 4270} 4271 4272// GoString returns the string representation 4273func (s DeleteTopicOutput) GoString() string { 4274 return s.String() 4275} 4276 4277// Endpoint for mobile app and device. 4278type Endpoint struct { 4279 _ struct{} `type:"structure"` 4280 4281 // Attributes for endpoint. 4282 Attributes map[string]*string `type:"map"` 4283 4284 // EndpointArn for mobile app and device. 4285 EndpointArn *string `type:"string"` 4286} 4287 4288// String returns the string representation 4289func (s Endpoint) String() string { 4290 return awsutil.Prettify(s) 4291} 4292 4293// GoString returns the string representation 4294func (s Endpoint) GoString() string { 4295 return s.String() 4296} 4297 4298// SetAttributes sets the Attributes field's value. 4299func (s *Endpoint) SetAttributes(v map[string]*string) *Endpoint { 4300 s.Attributes = v 4301 return s 4302} 4303 4304// SetEndpointArn sets the EndpointArn field's value. 4305func (s *Endpoint) SetEndpointArn(v string) *Endpoint { 4306 s.EndpointArn = &v 4307 return s 4308} 4309 4310// Input for GetEndpointAttributes action. 4311type GetEndpointAttributesInput struct { 4312 _ struct{} `type:"structure"` 4313 4314 // EndpointArn for GetEndpointAttributes input. 4315 // 4316 // EndpointArn is a required field 4317 EndpointArn *string `type:"string" required:"true"` 4318} 4319 4320// String returns the string representation 4321func (s GetEndpointAttributesInput) String() string { 4322 return awsutil.Prettify(s) 4323} 4324 4325// GoString returns the string representation 4326func (s GetEndpointAttributesInput) GoString() string { 4327 return s.String() 4328} 4329 4330// Validate inspects the fields of the type to determine if they are valid. 4331func (s *GetEndpointAttributesInput) Validate() error { 4332 invalidParams := request.ErrInvalidParams{Context: "GetEndpointAttributesInput"} 4333 if s.EndpointArn == nil { 4334 invalidParams.Add(request.NewErrParamRequired("EndpointArn")) 4335 } 4336 4337 if invalidParams.Len() > 0 { 4338 return invalidParams 4339 } 4340 return nil 4341} 4342 4343// SetEndpointArn sets the EndpointArn field's value. 4344func (s *GetEndpointAttributesInput) SetEndpointArn(v string) *GetEndpointAttributesInput { 4345 s.EndpointArn = &v 4346 return s 4347} 4348 4349// Response from GetEndpointAttributes of the EndpointArn. 4350type GetEndpointAttributesOutput struct { 4351 _ struct{} `type:"structure"` 4352 4353 // Attributes include the following: 4354 // 4355 // * CustomUserData – arbitrary user data to associate with the endpoint. 4356 // Amazon SNS does not use this data. The data must be in UTF-8 format and 4357 // less than 2KB. 4358 // 4359 // * Enabled – flag that enables/disables delivery to the endpoint. Amazon 4360 // SNS will set this to false when a notification service indicates to Amazon 4361 // SNS that the endpoint is invalid. Users can set it back to true, typically 4362 // after updating Token. 4363 // 4364 // * Token – device token, also referred to as a registration id, for an 4365 // app and mobile device. This is returned from the notification service 4366 // when an app and mobile device are registered with the notification service. 4367 // The device token for the iOS platform is returned in lowercase. 4368 Attributes map[string]*string `type:"map"` 4369} 4370 4371// String returns the string representation 4372func (s GetEndpointAttributesOutput) String() string { 4373 return awsutil.Prettify(s) 4374} 4375 4376// GoString returns the string representation 4377func (s GetEndpointAttributesOutput) GoString() string { 4378 return s.String() 4379} 4380 4381// SetAttributes sets the Attributes field's value. 4382func (s *GetEndpointAttributesOutput) SetAttributes(v map[string]*string) *GetEndpointAttributesOutput { 4383 s.Attributes = v 4384 return s 4385} 4386 4387// Input for GetPlatformApplicationAttributes action. 4388type GetPlatformApplicationAttributesInput struct { 4389 _ struct{} `type:"structure"` 4390 4391 // PlatformApplicationArn for GetPlatformApplicationAttributesInput. 4392 // 4393 // PlatformApplicationArn is a required field 4394 PlatformApplicationArn *string `type:"string" required:"true"` 4395} 4396 4397// String returns the string representation 4398func (s GetPlatformApplicationAttributesInput) String() string { 4399 return awsutil.Prettify(s) 4400} 4401 4402// GoString returns the string representation 4403func (s GetPlatformApplicationAttributesInput) GoString() string { 4404 return s.String() 4405} 4406 4407// Validate inspects the fields of the type to determine if they are valid. 4408func (s *GetPlatformApplicationAttributesInput) Validate() error { 4409 invalidParams := request.ErrInvalidParams{Context: "GetPlatformApplicationAttributesInput"} 4410 if s.PlatformApplicationArn == nil { 4411 invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) 4412 } 4413 4414 if invalidParams.Len() > 0 { 4415 return invalidParams 4416 } 4417 return nil 4418} 4419 4420// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. 4421func (s *GetPlatformApplicationAttributesInput) SetPlatformApplicationArn(v string) *GetPlatformApplicationAttributesInput { 4422 s.PlatformApplicationArn = &v 4423 return s 4424} 4425 4426// Response for GetPlatformApplicationAttributes action. 4427type GetPlatformApplicationAttributesOutput struct { 4428 _ struct{} `type:"structure"` 4429 4430 // Attributes include the following: 4431 // 4432 // * EventEndpointCreated – Topic ARN to which EndpointCreated event notifications 4433 // should be sent. 4434 // 4435 // * EventEndpointDeleted – Topic ARN to which EndpointDeleted event notifications 4436 // should be sent. 4437 // 4438 // * EventEndpointUpdated – Topic ARN to which EndpointUpdate event notifications 4439 // should be sent. 4440 // 4441 // * EventDeliveryFailure – Topic ARN to which DeliveryFailure event notifications 4442 // should be sent upon Direct Publish delivery failure (permanent) to one 4443 // of the application's endpoints. 4444 Attributes map[string]*string `type:"map"` 4445} 4446 4447// String returns the string representation 4448func (s GetPlatformApplicationAttributesOutput) String() string { 4449 return awsutil.Prettify(s) 4450} 4451 4452// GoString returns the string representation 4453func (s GetPlatformApplicationAttributesOutput) GoString() string { 4454 return s.String() 4455} 4456 4457// SetAttributes sets the Attributes field's value. 4458func (s *GetPlatformApplicationAttributesOutput) SetAttributes(v map[string]*string) *GetPlatformApplicationAttributesOutput { 4459 s.Attributes = v 4460 return s 4461} 4462 4463// The input for the GetSMSAttributes request. 4464type GetSMSAttributesInput struct { 4465 _ struct{} `type:"structure"` 4466 4467 // A list of the individual attribute names, such as MonthlySpendLimit, for 4468 // which you want values. 4469 // 4470 // For all attribute names, see SetSMSAttributes (https://docs.aws.amazon.com/sns/latest/api/API_SetSMSAttributes.html). 4471 // 4472 // If you don't use this parameter, Amazon SNS returns all SMS attributes. 4473 Attributes []*string `locationName:"attributes" type:"list"` 4474} 4475 4476// String returns the string representation 4477func (s GetSMSAttributesInput) String() string { 4478 return awsutil.Prettify(s) 4479} 4480 4481// GoString returns the string representation 4482func (s GetSMSAttributesInput) GoString() string { 4483 return s.String() 4484} 4485 4486// SetAttributes sets the Attributes field's value. 4487func (s *GetSMSAttributesInput) SetAttributes(v []*string) *GetSMSAttributesInput { 4488 s.Attributes = v 4489 return s 4490} 4491 4492// The response from the GetSMSAttributes request. 4493type GetSMSAttributesOutput struct { 4494 _ struct{} `type:"structure"` 4495 4496 // The SMS attribute names and their values. 4497 Attributes map[string]*string `locationName:"attributes" type:"map"` 4498} 4499 4500// String returns the string representation 4501func (s GetSMSAttributesOutput) String() string { 4502 return awsutil.Prettify(s) 4503} 4504 4505// GoString returns the string representation 4506func (s GetSMSAttributesOutput) GoString() string { 4507 return s.String() 4508} 4509 4510// SetAttributes sets the Attributes field's value. 4511func (s *GetSMSAttributesOutput) SetAttributes(v map[string]*string) *GetSMSAttributesOutput { 4512 s.Attributes = v 4513 return s 4514} 4515 4516// Input for GetSubscriptionAttributes. 4517type GetSubscriptionAttributesInput struct { 4518 _ struct{} `type:"structure"` 4519 4520 // The ARN of the subscription whose properties you want to get. 4521 // 4522 // SubscriptionArn is a required field 4523 SubscriptionArn *string `type:"string" required:"true"` 4524} 4525 4526// String returns the string representation 4527func (s GetSubscriptionAttributesInput) String() string { 4528 return awsutil.Prettify(s) 4529} 4530 4531// GoString returns the string representation 4532func (s GetSubscriptionAttributesInput) GoString() string { 4533 return s.String() 4534} 4535 4536// Validate inspects the fields of the type to determine if they are valid. 4537func (s *GetSubscriptionAttributesInput) Validate() error { 4538 invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionAttributesInput"} 4539 if s.SubscriptionArn == nil { 4540 invalidParams.Add(request.NewErrParamRequired("SubscriptionArn")) 4541 } 4542 4543 if invalidParams.Len() > 0 { 4544 return invalidParams 4545 } 4546 return nil 4547} 4548 4549// SetSubscriptionArn sets the SubscriptionArn field's value. 4550func (s *GetSubscriptionAttributesInput) SetSubscriptionArn(v string) *GetSubscriptionAttributesInput { 4551 s.SubscriptionArn = &v 4552 return s 4553} 4554 4555// Response for GetSubscriptionAttributes action. 4556type GetSubscriptionAttributesOutput struct { 4557 _ struct{} `type:"structure"` 4558 4559 // A map of the subscription's attributes. Attributes in this map include the 4560 // following: 4561 // 4562 // * ConfirmationWasAuthenticated – true if the subscription confirmation 4563 // request was authenticated. 4564 // 4565 // * DeliveryPolicy – The JSON serialization of the subscription's delivery 4566 // policy. 4567 // 4568 // * EffectiveDeliveryPolicy – The JSON serialization of the effective 4569 // delivery policy that takes into account the topic delivery policy and 4570 // account system defaults. 4571 // 4572 // * FilterPolicy – The filter policy JSON that is assigned to the subscription. 4573 // For more information, see Amazon SNS Message Filtering (https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html) 4574 // in the Amazon SNS Developer Guide. 4575 // 4576 // * Owner – The AWS account ID of the subscription's owner. 4577 // 4578 // * PendingConfirmation – true if the subscription hasn't been confirmed. 4579 // To confirm a pending subscription, call the ConfirmSubscription action 4580 // with a confirmation token. 4581 // 4582 // * RawMessageDelivery – true if raw message delivery is enabled for the 4583 // subscription. Raw messages are free of JSON formatting and can be sent 4584 // to HTTP/S and Amazon SQS endpoints. 4585 // 4586 // * RedrivePolicy – When specified, sends undeliverable messages to the 4587 // specified Amazon SQS dead-letter queue. Messages that can't be delivered 4588 // due to client errors (for example, when the subscribed endpoint is unreachable) 4589 // or server errors (for example, when the service that powers the subscribed 4590 // endpoint becomes unavailable) are held in the dead-letter queue for further 4591 // analysis or reprocessing. 4592 // 4593 // * SubscriptionArn – The subscription's ARN. 4594 // 4595 // * TopicArn – The topic ARN that the subscription is associated with. 4596 // 4597 // The following attribute applies only to Amazon Kinesis Data Firehose delivery 4598 // stream subscriptions: 4599 // 4600 // * SubscriptionRoleArn – The ARN of the IAM role that has the following: 4601 // Permission to write to the Kinesis Data Firehose delivery stream Amazon 4602 // SNS listed as a trusted entity Specifying a valid ARN for this attribute 4603 // is required for Kinesis Data Firehose delivery stream subscriptions. For 4604 // more information, see Fanout to Kinesis Data Firehose delivery streams 4605 // (https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) 4606 // in the Amazon SNS Developer Guide. 4607 Attributes map[string]*string `type:"map"` 4608} 4609 4610// String returns the string representation 4611func (s GetSubscriptionAttributesOutput) String() string { 4612 return awsutil.Prettify(s) 4613} 4614 4615// GoString returns the string representation 4616func (s GetSubscriptionAttributesOutput) GoString() string { 4617 return s.String() 4618} 4619 4620// SetAttributes sets the Attributes field's value. 4621func (s *GetSubscriptionAttributesOutput) SetAttributes(v map[string]*string) *GetSubscriptionAttributesOutput { 4622 s.Attributes = v 4623 return s 4624} 4625 4626// Input for GetTopicAttributes action. 4627type GetTopicAttributesInput struct { 4628 _ struct{} `type:"structure"` 4629 4630 // The ARN of the topic whose properties you want to get. 4631 // 4632 // TopicArn is a required field 4633 TopicArn *string `type:"string" required:"true"` 4634} 4635 4636// String returns the string representation 4637func (s GetTopicAttributesInput) String() string { 4638 return awsutil.Prettify(s) 4639} 4640 4641// GoString returns the string representation 4642func (s GetTopicAttributesInput) GoString() string { 4643 return s.String() 4644} 4645 4646// Validate inspects the fields of the type to determine if they are valid. 4647func (s *GetTopicAttributesInput) Validate() error { 4648 invalidParams := request.ErrInvalidParams{Context: "GetTopicAttributesInput"} 4649 if s.TopicArn == nil { 4650 invalidParams.Add(request.NewErrParamRequired("TopicArn")) 4651 } 4652 4653 if invalidParams.Len() > 0 { 4654 return invalidParams 4655 } 4656 return nil 4657} 4658 4659// SetTopicArn sets the TopicArn field's value. 4660func (s *GetTopicAttributesInput) SetTopicArn(v string) *GetTopicAttributesInput { 4661 s.TopicArn = &v 4662 return s 4663} 4664 4665// Response for GetTopicAttributes action. 4666type GetTopicAttributesOutput struct { 4667 _ struct{} `type:"structure"` 4668 4669 // A map of the topic's attributes. Attributes in this map include the following: 4670 // 4671 // * DeliveryPolicy – The JSON serialization of the topic's delivery policy. 4672 // 4673 // * DisplayName – The human-readable name used in the From field for notifications 4674 // to email and email-json endpoints. 4675 // 4676 // * Owner – The AWS account ID of the topic's owner. 4677 // 4678 // * Policy – The JSON serialization of the topic's access control policy. 4679 // 4680 // * SubscriptionsConfirmed – The number of confirmed subscriptions for 4681 // the topic. 4682 // 4683 // * SubscriptionsDeleted – The number of deleted subscriptions for the 4684 // topic. 4685 // 4686 // * SubscriptionsPending – The number of subscriptions pending confirmation 4687 // for the topic. 4688 // 4689 // * TopicArn – The topic's ARN. 4690 // 4691 // * EffectiveDeliveryPolicy – The JSON serialization of the effective 4692 // delivery policy, taking system defaults into account. 4693 // 4694 // The following attribute applies only to server-side-encryption (https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): 4695 // 4696 // * KmsMasterKeyId - The ID of an AWS-managed customer master key (CMK) 4697 // for Amazon SNS or a custom CMK. For more information, see Key Terms (https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). 4698 // For more examples, see KeyId (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) 4699 // in the AWS Key Management Service API Reference. 4700 // 4701 // The following attributes apply only to FIFO topics (https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): 4702 // 4703 // * FifoTopic – When this is set to true, a FIFO topic is created. 4704 // 4705 // * ContentBasedDeduplication – Enables content-based deduplication for 4706 // FIFO topics. By default, ContentBasedDeduplication is set to false. If 4707 // you create a FIFO topic and this attribute is false, you must specify 4708 // a value for the MessageDeduplicationId parameter for the Publish (https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) 4709 // action. When you set ContentBasedDeduplication to true, Amazon SNS uses 4710 // a SHA-256 hash to generate the MessageDeduplicationId using the body of 4711 // the message (but not the attributes of the message). (Optional) To override 4712 // the generated value, you can specify a value for the the MessageDeduplicationId 4713 // parameter for the Publish action. 4714 Attributes map[string]*string `type:"map"` 4715} 4716 4717// String returns the string representation 4718func (s GetTopicAttributesOutput) String() string { 4719 return awsutil.Prettify(s) 4720} 4721 4722// GoString returns the string representation 4723func (s GetTopicAttributesOutput) GoString() string { 4724 return s.String() 4725} 4726 4727// SetAttributes sets the Attributes field's value. 4728func (s *GetTopicAttributesOutput) SetAttributes(v map[string]*string) *GetTopicAttributesOutput { 4729 s.Attributes = v 4730 return s 4731} 4732 4733// Input for ListEndpointsByPlatformApplication action. 4734type ListEndpointsByPlatformApplicationInput struct { 4735 _ struct{} `type:"structure"` 4736 4737 // NextToken string is used when calling ListEndpointsByPlatformApplication 4738 // action to retrieve additional records that are available after the first 4739 // page results. 4740 NextToken *string `type:"string"` 4741 4742 // PlatformApplicationArn for ListEndpointsByPlatformApplicationInput action. 4743 // 4744 // PlatformApplicationArn is a required field 4745 PlatformApplicationArn *string `type:"string" required:"true"` 4746} 4747 4748// String returns the string representation 4749func (s ListEndpointsByPlatformApplicationInput) String() string { 4750 return awsutil.Prettify(s) 4751} 4752 4753// GoString returns the string representation 4754func (s ListEndpointsByPlatformApplicationInput) GoString() string { 4755 return s.String() 4756} 4757 4758// Validate inspects the fields of the type to determine if they are valid. 4759func (s *ListEndpointsByPlatformApplicationInput) Validate() error { 4760 invalidParams := request.ErrInvalidParams{Context: "ListEndpointsByPlatformApplicationInput"} 4761 if s.PlatformApplicationArn == nil { 4762 invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) 4763 } 4764 4765 if invalidParams.Len() > 0 { 4766 return invalidParams 4767 } 4768 return nil 4769} 4770 4771// SetNextToken sets the NextToken field's value. 4772func (s *ListEndpointsByPlatformApplicationInput) SetNextToken(v string) *ListEndpointsByPlatformApplicationInput { 4773 s.NextToken = &v 4774 return s 4775} 4776 4777// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. 4778func (s *ListEndpointsByPlatformApplicationInput) SetPlatformApplicationArn(v string) *ListEndpointsByPlatformApplicationInput { 4779 s.PlatformApplicationArn = &v 4780 return s 4781} 4782 4783// Response for ListEndpointsByPlatformApplication action. 4784type ListEndpointsByPlatformApplicationOutput struct { 4785 _ struct{} `type:"structure"` 4786 4787 // Endpoints returned for ListEndpointsByPlatformApplication action. 4788 Endpoints []*Endpoint `type:"list"` 4789 4790 // NextToken string is returned when calling ListEndpointsByPlatformApplication 4791 // action if additional records are available after the first page results. 4792 NextToken *string `type:"string"` 4793} 4794 4795// String returns the string representation 4796func (s ListEndpointsByPlatformApplicationOutput) String() string { 4797 return awsutil.Prettify(s) 4798} 4799 4800// GoString returns the string representation 4801func (s ListEndpointsByPlatformApplicationOutput) GoString() string { 4802 return s.String() 4803} 4804 4805// SetEndpoints sets the Endpoints field's value. 4806func (s *ListEndpointsByPlatformApplicationOutput) SetEndpoints(v []*Endpoint) *ListEndpointsByPlatformApplicationOutput { 4807 s.Endpoints = v 4808 return s 4809} 4810 4811// SetNextToken sets the NextToken field's value. 4812func (s *ListEndpointsByPlatformApplicationOutput) SetNextToken(v string) *ListEndpointsByPlatformApplicationOutput { 4813 s.NextToken = &v 4814 return s 4815} 4816 4817// The input for the ListPhoneNumbersOptedOut action. 4818type ListPhoneNumbersOptedOutInput struct { 4819 _ struct{} `type:"structure"` 4820 4821 // A NextToken string is used when you call the ListPhoneNumbersOptedOut action 4822 // to retrieve additional records that are available after the first page of 4823 // results. 4824 NextToken *string `locationName:"nextToken" type:"string"` 4825} 4826 4827// String returns the string representation 4828func (s ListPhoneNumbersOptedOutInput) String() string { 4829 return awsutil.Prettify(s) 4830} 4831 4832// GoString returns the string representation 4833func (s ListPhoneNumbersOptedOutInput) GoString() string { 4834 return s.String() 4835} 4836 4837// SetNextToken sets the NextToken field's value. 4838func (s *ListPhoneNumbersOptedOutInput) SetNextToken(v string) *ListPhoneNumbersOptedOutInput { 4839 s.NextToken = &v 4840 return s 4841} 4842 4843// The response from the ListPhoneNumbersOptedOut action. 4844type ListPhoneNumbersOptedOutOutput struct { 4845 _ struct{} `type:"structure"` 4846 4847 // A NextToken string is returned when you call the ListPhoneNumbersOptedOut 4848 // action if additional records are available after the first page of results. 4849 NextToken *string `locationName:"nextToken" type:"string"` 4850 4851 // A list of phone numbers that are opted out of receiving SMS messages. The 4852 // list is paginated, and each page can contain up to 100 phone numbers. 4853 PhoneNumbers []*string `locationName:"phoneNumbers" type:"list"` 4854} 4855 4856// String returns the string representation 4857func (s ListPhoneNumbersOptedOutOutput) String() string { 4858 return awsutil.Prettify(s) 4859} 4860 4861// GoString returns the string representation 4862func (s ListPhoneNumbersOptedOutOutput) GoString() string { 4863 return s.String() 4864} 4865 4866// SetNextToken sets the NextToken field's value. 4867func (s *ListPhoneNumbersOptedOutOutput) SetNextToken(v string) *ListPhoneNumbersOptedOutOutput { 4868 s.NextToken = &v 4869 return s 4870} 4871 4872// SetPhoneNumbers sets the PhoneNumbers field's value. 4873func (s *ListPhoneNumbersOptedOutOutput) SetPhoneNumbers(v []*string) *ListPhoneNumbersOptedOutOutput { 4874 s.PhoneNumbers = v 4875 return s 4876} 4877 4878// Input for ListPlatformApplications action. 4879type ListPlatformApplicationsInput struct { 4880 _ struct{} `type:"structure"` 4881 4882 // NextToken string is used when calling ListPlatformApplications action to 4883 // retrieve additional records that are available after the first page results. 4884 NextToken *string `type:"string"` 4885} 4886 4887// String returns the string representation 4888func (s ListPlatformApplicationsInput) String() string { 4889 return awsutil.Prettify(s) 4890} 4891 4892// GoString returns the string representation 4893func (s ListPlatformApplicationsInput) GoString() string { 4894 return s.String() 4895} 4896 4897// SetNextToken sets the NextToken field's value. 4898func (s *ListPlatformApplicationsInput) SetNextToken(v string) *ListPlatformApplicationsInput { 4899 s.NextToken = &v 4900 return s 4901} 4902 4903// Response for ListPlatformApplications action. 4904type ListPlatformApplicationsOutput struct { 4905 _ struct{} `type:"structure"` 4906 4907 // NextToken string is returned when calling ListPlatformApplications action 4908 // if additional records are available after the first page results. 4909 NextToken *string `type:"string"` 4910 4911 // Platform applications returned when calling ListPlatformApplications action. 4912 PlatformApplications []*PlatformApplication `type:"list"` 4913} 4914 4915// String returns the string representation 4916func (s ListPlatformApplicationsOutput) String() string { 4917 return awsutil.Prettify(s) 4918} 4919 4920// GoString returns the string representation 4921func (s ListPlatformApplicationsOutput) GoString() string { 4922 return s.String() 4923} 4924 4925// SetNextToken sets the NextToken field's value. 4926func (s *ListPlatformApplicationsOutput) SetNextToken(v string) *ListPlatformApplicationsOutput { 4927 s.NextToken = &v 4928 return s 4929} 4930 4931// SetPlatformApplications sets the PlatformApplications field's value. 4932func (s *ListPlatformApplicationsOutput) SetPlatformApplications(v []*PlatformApplication) *ListPlatformApplicationsOutput { 4933 s.PlatformApplications = v 4934 return s 4935} 4936 4937// Input for ListSubscriptionsByTopic action. 4938type ListSubscriptionsByTopicInput struct { 4939 _ struct{} `type:"structure"` 4940 4941 // Token returned by the previous ListSubscriptionsByTopic request. 4942 NextToken *string `type:"string"` 4943 4944 // The ARN of the topic for which you wish to find subscriptions. 4945 // 4946 // TopicArn is a required field 4947 TopicArn *string `type:"string" required:"true"` 4948} 4949 4950// String returns the string representation 4951func (s ListSubscriptionsByTopicInput) String() string { 4952 return awsutil.Prettify(s) 4953} 4954 4955// GoString returns the string representation 4956func (s ListSubscriptionsByTopicInput) GoString() string { 4957 return s.String() 4958} 4959 4960// Validate inspects the fields of the type to determine if they are valid. 4961func (s *ListSubscriptionsByTopicInput) Validate() error { 4962 invalidParams := request.ErrInvalidParams{Context: "ListSubscriptionsByTopicInput"} 4963 if s.TopicArn == nil { 4964 invalidParams.Add(request.NewErrParamRequired("TopicArn")) 4965 } 4966 4967 if invalidParams.Len() > 0 { 4968 return invalidParams 4969 } 4970 return nil 4971} 4972 4973// SetNextToken sets the NextToken field's value. 4974func (s *ListSubscriptionsByTopicInput) SetNextToken(v string) *ListSubscriptionsByTopicInput { 4975 s.NextToken = &v 4976 return s 4977} 4978 4979// SetTopicArn sets the TopicArn field's value. 4980func (s *ListSubscriptionsByTopicInput) SetTopicArn(v string) *ListSubscriptionsByTopicInput { 4981 s.TopicArn = &v 4982 return s 4983} 4984 4985// Response for ListSubscriptionsByTopic action. 4986type ListSubscriptionsByTopicOutput struct { 4987 _ struct{} `type:"structure"` 4988 4989 // Token to pass along to the next ListSubscriptionsByTopic request. This element 4990 // is returned if there are more subscriptions to retrieve. 4991 NextToken *string `type:"string"` 4992 4993 // A list of subscriptions. 4994 Subscriptions []*Subscription `type:"list"` 4995} 4996 4997// String returns the string representation 4998func (s ListSubscriptionsByTopicOutput) String() string { 4999 return awsutil.Prettify(s) 5000} 5001 5002// GoString returns the string representation 5003func (s ListSubscriptionsByTopicOutput) GoString() string { 5004 return s.String() 5005} 5006 5007// SetNextToken sets the NextToken field's value. 5008func (s *ListSubscriptionsByTopicOutput) SetNextToken(v string) *ListSubscriptionsByTopicOutput { 5009 s.NextToken = &v 5010 return s 5011} 5012 5013// SetSubscriptions sets the Subscriptions field's value. 5014func (s *ListSubscriptionsByTopicOutput) SetSubscriptions(v []*Subscription) *ListSubscriptionsByTopicOutput { 5015 s.Subscriptions = v 5016 return s 5017} 5018 5019// Input for ListSubscriptions action. 5020type ListSubscriptionsInput struct { 5021 _ struct{} `type:"structure"` 5022 5023 // Token returned by the previous ListSubscriptions request. 5024 NextToken *string `type:"string"` 5025} 5026 5027// String returns the string representation 5028func (s ListSubscriptionsInput) String() string { 5029 return awsutil.Prettify(s) 5030} 5031 5032// GoString returns the string representation 5033func (s ListSubscriptionsInput) GoString() string { 5034 return s.String() 5035} 5036 5037// SetNextToken sets the NextToken field's value. 5038func (s *ListSubscriptionsInput) SetNextToken(v string) *ListSubscriptionsInput { 5039 s.NextToken = &v 5040 return s 5041} 5042 5043// Response for ListSubscriptions action 5044type ListSubscriptionsOutput struct { 5045 _ struct{} `type:"structure"` 5046 5047 // Token to pass along to the next ListSubscriptions request. This element is 5048 // returned if there are more subscriptions to retrieve. 5049 NextToken *string `type:"string"` 5050 5051 // A list of subscriptions. 5052 Subscriptions []*Subscription `type:"list"` 5053} 5054 5055// String returns the string representation 5056func (s ListSubscriptionsOutput) String() string { 5057 return awsutil.Prettify(s) 5058} 5059 5060// GoString returns the string representation 5061func (s ListSubscriptionsOutput) GoString() string { 5062 return s.String() 5063} 5064 5065// SetNextToken sets the NextToken field's value. 5066func (s *ListSubscriptionsOutput) SetNextToken(v string) *ListSubscriptionsOutput { 5067 s.NextToken = &v 5068 return s 5069} 5070 5071// SetSubscriptions sets the Subscriptions field's value. 5072func (s *ListSubscriptionsOutput) SetSubscriptions(v []*Subscription) *ListSubscriptionsOutput { 5073 s.Subscriptions = v 5074 return s 5075} 5076 5077type ListTagsForResourceInput struct { 5078 _ struct{} `type:"structure"` 5079 5080 // The ARN of the topic for which to list tags. 5081 // 5082 // ResourceArn is a required field 5083 ResourceArn *string `min:"1" type:"string" required:"true"` 5084} 5085 5086// String returns the string representation 5087func (s ListTagsForResourceInput) String() string { 5088 return awsutil.Prettify(s) 5089} 5090 5091// GoString returns the string representation 5092func (s ListTagsForResourceInput) GoString() string { 5093 return s.String() 5094} 5095 5096// Validate inspects the fields of the type to determine if they are valid. 5097func (s *ListTagsForResourceInput) Validate() error { 5098 invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} 5099 if s.ResourceArn == nil { 5100 invalidParams.Add(request.NewErrParamRequired("ResourceArn")) 5101 } 5102 if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { 5103 invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) 5104 } 5105 5106 if invalidParams.Len() > 0 { 5107 return invalidParams 5108 } 5109 return nil 5110} 5111 5112// SetResourceArn sets the ResourceArn field's value. 5113func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { 5114 s.ResourceArn = &v 5115 return s 5116} 5117 5118type ListTagsForResourceOutput struct { 5119 _ struct{} `type:"structure"` 5120 5121 // The tags associated with the specified topic. 5122 Tags []*Tag `type:"list"` 5123} 5124 5125// String returns the string representation 5126func (s ListTagsForResourceOutput) String() string { 5127 return awsutil.Prettify(s) 5128} 5129 5130// GoString returns the string representation 5131func (s ListTagsForResourceOutput) GoString() string { 5132 return s.String() 5133} 5134 5135// SetTags sets the Tags field's value. 5136func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { 5137 s.Tags = v 5138 return s 5139} 5140 5141type ListTopicsInput struct { 5142 _ struct{} `type:"structure"` 5143 5144 // Token returned by the previous ListTopics request. 5145 NextToken *string `type:"string"` 5146} 5147 5148// String returns the string representation 5149func (s ListTopicsInput) String() string { 5150 return awsutil.Prettify(s) 5151} 5152 5153// GoString returns the string representation 5154func (s ListTopicsInput) GoString() string { 5155 return s.String() 5156} 5157 5158// SetNextToken sets the NextToken field's value. 5159func (s *ListTopicsInput) SetNextToken(v string) *ListTopicsInput { 5160 s.NextToken = &v 5161 return s 5162} 5163 5164// Response for ListTopics action. 5165type ListTopicsOutput struct { 5166 _ struct{} `type:"structure"` 5167 5168 // Token to pass along to the next ListTopics request. This element is returned 5169 // if there are additional topics to retrieve. 5170 NextToken *string `type:"string"` 5171 5172 // A list of topic ARNs. 5173 Topics []*Topic `type:"list"` 5174} 5175 5176// String returns the string representation 5177func (s ListTopicsOutput) String() string { 5178 return awsutil.Prettify(s) 5179} 5180 5181// GoString returns the string representation 5182func (s ListTopicsOutput) GoString() string { 5183 return s.String() 5184} 5185 5186// SetNextToken sets the NextToken field's value. 5187func (s *ListTopicsOutput) SetNextToken(v string) *ListTopicsOutput { 5188 s.NextToken = &v 5189 return s 5190} 5191 5192// SetTopics sets the Topics field's value. 5193func (s *ListTopicsOutput) SetTopics(v []*Topic) *ListTopicsOutput { 5194 s.Topics = v 5195 return s 5196} 5197 5198// The user-specified message attribute value. For string data types, the value 5199// attribute has the same restrictions on the content as the message body. For 5200// more information, see Publish (https://docs.aws.amazon.com/sns/latest/api/API_Publish.html). 5201// 5202// Name, type, and value must not be empty or null. In addition, the message 5203// body should not be empty or null. All parts of the message attribute, including 5204// name, type, and value, are included in the message size restriction, which 5205// is currently 256 KB (262,144 bytes). For more information, see Amazon SNS 5206// message attributes (https://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html) 5207// and Publishing to a mobile phone (https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html) 5208// in the Amazon SNS Developer Guide. 5209type MessageAttributeValue struct { 5210 _ struct{} `type:"structure"` 5211 5212 // Binary type attributes can store any binary data, for example, compressed 5213 // data, encrypted data, or images. 5214 // 5215 // BinaryValue is automatically base64 encoded/decoded by the SDK. 5216 BinaryValue []byte `type:"blob"` 5217 5218 // Amazon SNS supports the following logical data types: String, String.Array, 5219 // Number, and Binary. For more information, see Message Attribute Data Types 5220 // (https://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html#SNSMessageAttributes.DataTypes). 5221 // 5222 // DataType is a required field 5223 DataType *string `type:"string" required:"true"` 5224 5225 // Strings are Unicode with UTF8 binary encoding. For a list of code values, 5226 // see ASCII Printable Characters (https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). 5227 StringValue *string `type:"string"` 5228} 5229 5230// String returns the string representation 5231func (s MessageAttributeValue) String() string { 5232 return awsutil.Prettify(s) 5233} 5234 5235// GoString returns the string representation 5236func (s MessageAttributeValue) GoString() string { 5237 return s.String() 5238} 5239 5240// Validate inspects the fields of the type to determine if they are valid. 5241func (s *MessageAttributeValue) Validate() error { 5242 invalidParams := request.ErrInvalidParams{Context: "MessageAttributeValue"} 5243 if s.DataType == nil { 5244 invalidParams.Add(request.NewErrParamRequired("DataType")) 5245 } 5246 5247 if invalidParams.Len() > 0 { 5248 return invalidParams 5249 } 5250 return nil 5251} 5252 5253// SetBinaryValue sets the BinaryValue field's value. 5254func (s *MessageAttributeValue) SetBinaryValue(v []byte) *MessageAttributeValue { 5255 s.BinaryValue = v 5256 return s 5257} 5258 5259// SetDataType sets the DataType field's value. 5260func (s *MessageAttributeValue) SetDataType(v string) *MessageAttributeValue { 5261 s.DataType = &v 5262 return s 5263} 5264 5265// SetStringValue sets the StringValue field's value. 5266func (s *MessageAttributeValue) SetStringValue(v string) *MessageAttributeValue { 5267 s.StringValue = &v 5268 return s 5269} 5270 5271// Input for the OptInPhoneNumber action. 5272type OptInPhoneNumberInput struct { 5273 _ struct{} `type:"structure"` 5274 5275 // The phone number to opt in. Use E.164 format. 5276 // 5277 // PhoneNumber is a required field 5278 PhoneNumber *string `locationName:"phoneNumber" type:"string" required:"true"` 5279} 5280 5281// String returns the string representation 5282func (s OptInPhoneNumberInput) String() string { 5283 return awsutil.Prettify(s) 5284} 5285 5286// GoString returns the string representation 5287func (s OptInPhoneNumberInput) GoString() string { 5288 return s.String() 5289} 5290 5291// Validate inspects the fields of the type to determine if they are valid. 5292func (s *OptInPhoneNumberInput) Validate() error { 5293 invalidParams := request.ErrInvalidParams{Context: "OptInPhoneNumberInput"} 5294 if s.PhoneNumber == nil { 5295 invalidParams.Add(request.NewErrParamRequired("PhoneNumber")) 5296 } 5297 5298 if invalidParams.Len() > 0 { 5299 return invalidParams 5300 } 5301 return nil 5302} 5303 5304// SetPhoneNumber sets the PhoneNumber field's value. 5305func (s *OptInPhoneNumberInput) SetPhoneNumber(v string) *OptInPhoneNumberInput { 5306 s.PhoneNumber = &v 5307 return s 5308} 5309 5310// The response for the OptInPhoneNumber action. 5311type OptInPhoneNumberOutput struct { 5312 _ struct{} `type:"structure"` 5313} 5314 5315// String returns the string representation 5316func (s OptInPhoneNumberOutput) String() string { 5317 return awsutil.Prettify(s) 5318} 5319 5320// GoString returns the string representation 5321func (s OptInPhoneNumberOutput) GoString() string { 5322 return s.String() 5323} 5324 5325// Platform application object. 5326type PlatformApplication struct { 5327 _ struct{} `type:"structure"` 5328 5329 // Attributes for platform application object. 5330 Attributes map[string]*string `type:"map"` 5331 5332 // PlatformApplicationArn for platform application object. 5333 PlatformApplicationArn *string `type:"string"` 5334} 5335 5336// String returns the string representation 5337func (s PlatformApplication) String() string { 5338 return awsutil.Prettify(s) 5339} 5340 5341// GoString returns the string representation 5342func (s PlatformApplication) GoString() string { 5343 return s.String() 5344} 5345 5346// SetAttributes sets the Attributes field's value. 5347func (s *PlatformApplication) SetAttributes(v map[string]*string) *PlatformApplication { 5348 s.Attributes = v 5349 return s 5350} 5351 5352// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. 5353func (s *PlatformApplication) SetPlatformApplicationArn(v string) *PlatformApplication { 5354 s.PlatformApplicationArn = &v 5355 return s 5356} 5357 5358// Input for Publish action. 5359type PublishInput struct { 5360 _ struct{} `type:"structure"` 5361 5362 // The message you want to send. 5363 // 5364 // If you are publishing to a topic and you want to send the same message to 5365 // all transport protocols, include the text of the message as a String value. 5366 // If you want to send different messages for each transport protocol, set the 5367 // value of the MessageStructure parameter to json and use a JSON object for 5368 // the Message parameter. 5369 // 5370 // Constraints: 5371 // 5372 // * With the exception of SMS, messages must be UTF-8 encoded strings and 5373 // at most 256 KB in size (262,144 bytes, not 262,144 characters). 5374 // 5375 // * For SMS, each message can contain up to 140 characters. This character 5376 // limit depends on the encoding schema. For example, an SMS message can 5377 // contain 160 GSM characters, 140 ASCII characters, or 70 UCS-2 characters. 5378 // If you publish a message that exceeds this size limit, Amazon SNS sends 5379 // the message as multiple messages, each fitting within the size limit. 5380 // Messages aren't truncated mid-word but are cut off at whole-word boundaries. 5381 // The total size limit for a single SMS Publish action is 1,600 characters. 5382 // 5383 // JSON-specific constraints: 5384 // 5385 // * Keys in the JSON object that correspond to supported transport protocols 5386 // must have simple JSON string values. 5387 // 5388 // * The values will be parsed (unescaped) before they are used in outgoing 5389 // messages. 5390 // 5391 // * Outbound notifications are JSON encoded (meaning that the characters 5392 // will be reescaped for sending). 5393 // 5394 // * Values have a minimum length of 0 (the empty string, "", is allowed). 5395 // 5396 // * Values have a maximum length bounded by the overall message size (so, 5397 // including multiple protocols may limit message sizes). 5398 // 5399 // * Non-string values will cause the key to be ignored. 5400 // 5401 // * Keys that do not correspond to supported transport protocols are ignored. 5402 // 5403 // * Duplicate keys are not allowed. 5404 // 5405 // * Failure to parse or validate any key or value in the message will cause 5406 // the Publish call to return an error (no partial delivery). 5407 // 5408 // Message is a required field 5409 Message *string `type:"string" required:"true"` 5410 5411 // Message attributes for Publish action. 5412 MessageAttributes map[string]*MessageAttributeValue `locationNameKey:"Name" locationNameValue:"Value" type:"map"` 5413 5414 // This parameter applies only to FIFO (first-in-first-out) topics. The MessageDeduplicationId 5415 // can contain up to 128 alphanumeric characters (a-z, A-Z, 0-9) and punctuation 5416 // (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). 5417 // 5418 // Every message must have a unique MessageDeduplicationId, which is a token 5419 // used for deduplication of sent messages. If a message with a particular MessageDeduplicationId 5420 // is sent successfully, any message sent with the same MessageDeduplicationId 5421 // during the 5-minute deduplication interval is treated as a duplicate. 5422 // 5423 // If the topic has ContentBasedDeduplication set, the system generates a MessageDeduplicationId 5424 // based on the contents of the message. Your MessageDeduplicationId overrides 5425 // the generated one. 5426 MessageDeduplicationId *string `type:"string"` 5427 5428 // This parameter applies only to FIFO (first-in-first-out) topics. The MessageGroupId 5429 // can contain up to 128 alphanumeric characters (a-z, A-Z, 0-9) and punctuation 5430 // (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). 5431 // 5432 // The MessageGroupId is a tag that specifies that a message belongs to a specific 5433 // message group. Messages that belong to the same message group are processed 5434 // in a FIFO manner (however, messages in different message groups might be 5435 // processed out of order). Every message must include a MessageGroupId. 5436 MessageGroupId *string `type:"string"` 5437 5438 // Set MessageStructure to json if you want to send a different message for 5439 // each protocol. For example, using one publish action, you can send a short 5440 // message to your SMS subscribers and a longer message to your email subscribers. 5441 // If you set MessageStructure to json, the value of the Message parameter must: 5442 // 5443 // * be a syntactically valid JSON object; and 5444 // 5445 // * contain at least a top-level JSON key of "default" with a value that 5446 // is a string. 5447 // 5448 // You can define other top-level keys that define the message you want to send 5449 // to a specific transport protocol (e.g., "http"). 5450 // 5451 // Valid value: json 5452 MessageStructure *string `type:"string"` 5453 5454 // The phone number to which you want to deliver an SMS message. Use E.164 format. 5455 // 5456 // If you don't specify a value for the PhoneNumber parameter, you must specify 5457 // a value for the TargetArn or TopicArn parameters. 5458 PhoneNumber *string `type:"string"` 5459 5460 // Optional parameter to be used as the "Subject" line when the message is delivered 5461 // to email endpoints. This field will also be included, if present, in the 5462 // standard JSON messages delivered to other endpoints. 5463 // 5464 // Constraints: Subjects must be ASCII text that begins with a letter, number, 5465 // or punctuation mark; must not include line breaks or control characters; 5466 // and must be less than 100 characters long. 5467 Subject *string `type:"string"` 5468 5469 // If you don't specify a value for the TargetArn parameter, you must specify 5470 // a value for the PhoneNumber or TopicArn parameters. 5471 TargetArn *string `type:"string"` 5472 5473 // The topic you want to publish to. 5474 // 5475 // If you don't specify a value for the TopicArn parameter, you must specify 5476 // a value for the PhoneNumber or TargetArn parameters. 5477 TopicArn *string `type:"string"` 5478} 5479 5480// String returns the string representation 5481func (s PublishInput) String() string { 5482 return awsutil.Prettify(s) 5483} 5484 5485// GoString returns the string representation 5486func (s PublishInput) GoString() string { 5487 return s.String() 5488} 5489 5490// Validate inspects the fields of the type to determine if they are valid. 5491func (s *PublishInput) Validate() error { 5492 invalidParams := request.ErrInvalidParams{Context: "PublishInput"} 5493 if s.Message == nil { 5494 invalidParams.Add(request.NewErrParamRequired("Message")) 5495 } 5496 if s.MessageAttributes != nil { 5497 for i, v := range s.MessageAttributes { 5498 if v == nil { 5499 continue 5500 } 5501 if err := v.Validate(); err != nil { 5502 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams)) 5503 } 5504 } 5505 } 5506 5507 if invalidParams.Len() > 0 { 5508 return invalidParams 5509 } 5510 return nil 5511} 5512 5513// SetMessage sets the Message field's value. 5514func (s *PublishInput) SetMessage(v string) *PublishInput { 5515 s.Message = &v 5516 return s 5517} 5518 5519// SetMessageAttributes sets the MessageAttributes field's value. 5520func (s *PublishInput) SetMessageAttributes(v map[string]*MessageAttributeValue) *PublishInput { 5521 s.MessageAttributes = v 5522 return s 5523} 5524 5525// SetMessageDeduplicationId sets the MessageDeduplicationId field's value. 5526func (s *PublishInput) SetMessageDeduplicationId(v string) *PublishInput { 5527 s.MessageDeduplicationId = &v 5528 return s 5529} 5530 5531// SetMessageGroupId sets the MessageGroupId field's value. 5532func (s *PublishInput) SetMessageGroupId(v string) *PublishInput { 5533 s.MessageGroupId = &v 5534 return s 5535} 5536 5537// SetMessageStructure sets the MessageStructure field's value. 5538func (s *PublishInput) SetMessageStructure(v string) *PublishInput { 5539 s.MessageStructure = &v 5540 return s 5541} 5542 5543// SetPhoneNumber sets the PhoneNumber field's value. 5544func (s *PublishInput) SetPhoneNumber(v string) *PublishInput { 5545 s.PhoneNumber = &v 5546 return s 5547} 5548 5549// SetSubject sets the Subject field's value. 5550func (s *PublishInput) SetSubject(v string) *PublishInput { 5551 s.Subject = &v 5552 return s 5553} 5554 5555// SetTargetArn sets the TargetArn field's value. 5556func (s *PublishInput) SetTargetArn(v string) *PublishInput { 5557 s.TargetArn = &v 5558 return s 5559} 5560 5561// SetTopicArn sets the TopicArn field's value. 5562func (s *PublishInput) SetTopicArn(v string) *PublishInput { 5563 s.TopicArn = &v 5564 return s 5565} 5566 5567// Response for Publish action. 5568type PublishOutput struct { 5569 _ struct{} `type:"structure"` 5570 5571 // Unique identifier assigned to the published message. 5572 // 5573 // Length Constraint: Maximum 100 characters 5574 MessageId *string `type:"string"` 5575 5576 // This response element applies only to FIFO (first-in-first-out) topics. 5577 // 5578 // The sequence number is a large, non-consecutive number that Amazon SNS assigns 5579 // to each message. The length of SequenceNumber is 128 bits. SequenceNumber 5580 // continues to increase for each MessageGroupId. 5581 SequenceNumber *string `type:"string"` 5582} 5583 5584// String returns the string representation 5585func (s PublishOutput) String() string { 5586 return awsutil.Prettify(s) 5587} 5588 5589// GoString returns the string representation 5590func (s PublishOutput) GoString() string { 5591 return s.String() 5592} 5593 5594// SetMessageId sets the MessageId field's value. 5595func (s *PublishOutput) SetMessageId(v string) *PublishOutput { 5596 s.MessageId = &v 5597 return s 5598} 5599 5600// SetSequenceNumber sets the SequenceNumber field's value. 5601func (s *PublishOutput) SetSequenceNumber(v string) *PublishOutput { 5602 s.SequenceNumber = &v 5603 return s 5604} 5605 5606// Input for RemovePermission action. 5607type RemovePermissionInput struct { 5608 _ struct{} `type:"structure"` 5609 5610 // The unique label of the statement you want to remove. 5611 // 5612 // Label is a required field 5613 Label *string `type:"string" required:"true"` 5614 5615 // The ARN of the topic whose access control policy you wish to modify. 5616 // 5617 // TopicArn is a required field 5618 TopicArn *string `type:"string" required:"true"` 5619} 5620 5621// String returns the string representation 5622func (s RemovePermissionInput) String() string { 5623 return awsutil.Prettify(s) 5624} 5625 5626// GoString returns the string representation 5627func (s RemovePermissionInput) GoString() string { 5628 return s.String() 5629} 5630 5631// Validate inspects the fields of the type to determine if they are valid. 5632func (s *RemovePermissionInput) Validate() error { 5633 invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"} 5634 if s.Label == nil { 5635 invalidParams.Add(request.NewErrParamRequired("Label")) 5636 } 5637 if s.TopicArn == nil { 5638 invalidParams.Add(request.NewErrParamRequired("TopicArn")) 5639 } 5640 5641 if invalidParams.Len() > 0 { 5642 return invalidParams 5643 } 5644 return nil 5645} 5646 5647// SetLabel sets the Label field's value. 5648func (s *RemovePermissionInput) SetLabel(v string) *RemovePermissionInput { 5649 s.Label = &v 5650 return s 5651} 5652 5653// SetTopicArn sets the TopicArn field's value. 5654func (s *RemovePermissionInput) SetTopicArn(v string) *RemovePermissionInput { 5655 s.TopicArn = &v 5656 return s 5657} 5658 5659type RemovePermissionOutput struct { 5660 _ struct{} `type:"structure"` 5661} 5662 5663// String returns the string representation 5664func (s RemovePermissionOutput) String() string { 5665 return awsutil.Prettify(s) 5666} 5667 5668// GoString returns the string representation 5669func (s RemovePermissionOutput) GoString() string { 5670 return s.String() 5671} 5672 5673// Input for SetEndpointAttributes action. 5674type SetEndpointAttributesInput struct { 5675 _ struct{} `type:"structure"` 5676 5677 // A map of the endpoint attributes. Attributes in this map include the following: 5678 // 5679 // * CustomUserData – arbitrary user data to associate with the endpoint. 5680 // Amazon SNS does not use this data. The data must be in UTF-8 format and 5681 // less than 2KB. 5682 // 5683 // * Enabled – flag that enables/disables delivery to the endpoint. Amazon 5684 // SNS will set this to false when a notification service indicates to Amazon 5685 // SNS that the endpoint is invalid. Users can set it back to true, typically 5686 // after updating Token. 5687 // 5688 // * Token – device token, also referred to as a registration id, for an 5689 // app and mobile device. This is returned from the notification service 5690 // when an app and mobile device are registered with the notification service. 5691 // 5692 // Attributes is a required field 5693 Attributes map[string]*string `type:"map" required:"true"` 5694 5695 // EndpointArn used for SetEndpointAttributes action. 5696 // 5697 // EndpointArn is a required field 5698 EndpointArn *string `type:"string" required:"true"` 5699} 5700 5701// String returns the string representation 5702func (s SetEndpointAttributesInput) String() string { 5703 return awsutil.Prettify(s) 5704} 5705 5706// GoString returns the string representation 5707func (s SetEndpointAttributesInput) GoString() string { 5708 return s.String() 5709} 5710 5711// Validate inspects the fields of the type to determine if they are valid. 5712func (s *SetEndpointAttributesInput) Validate() error { 5713 invalidParams := request.ErrInvalidParams{Context: "SetEndpointAttributesInput"} 5714 if s.Attributes == nil { 5715 invalidParams.Add(request.NewErrParamRequired("Attributes")) 5716 } 5717 if s.EndpointArn == nil { 5718 invalidParams.Add(request.NewErrParamRequired("EndpointArn")) 5719 } 5720 5721 if invalidParams.Len() > 0 { 5722 return invalidParams 5723 } 5724 return nil 5725} 5726 5727// SetAttributes sets the Attributes field's value. 5728func (s *SetEndpointAttributesInput) SetAttributes(v map[string]*string) *SetEndpointAttributesInput { 5729 s.Attributes = v 5730 return s 5731} 5732 5733// SetEndpointArn sets the EndpointArn field's value. 5734func (s *SetEndpointAttributesInput) SetEndpointArn(v string) *SetEndpointAttributesInput { 5735 s.EndpointArn = &v 5736 return s 5737} 5738 5739type SetEndpointAttributesOutput struct { 5740 _ struct{} `type:"structure"` 5741} 5742 5743// String returns the string representation 5744func (s SetEndpointAttributesOutput) String() string { 5745 return awsutil.Prettify(s) 5746} 5747 5748// GoString returns the string representation 5749func (s SetEndpointAttributesOutput) GoString() string { 5750 return s.String() 5751} 5752 5753// Input for SetPlatformApplicationAttributes action. 5754type SetPlatformApplicationAttributesInput struct { 5755 _ struct{} `type:"structure"` 5756 5757 // A map of the platform application attributes. Attributes in this map include 5758 // the following: 5759 // 5760 // * PlatformCredential – The credential received from the notification 5761 // service. For APNS and APNS_SANDBOX, PlatformCredential is private key. 5762 // For GCM (Firebase Cloud Messaging), PlatformCredential is API key. For 5763 // ADM, PlatformCredential is client secret. 5764 // 5765 // * PlatformPrincipal – The principal received from the notification service. 5766 // For APNS and APNS_SANDBOX, PlatformPrincipal is SSL certificate. For GCM 5767 // (Firebase Cloud Messaging), there is no PlatformPrincipal. For ADM, PlatformPrincipal 5768 // is client id. 5769 // 5770 // * EventEndpointCreated – Topic ARN to which EndpointCreated event notifications 5771 // are sent. 5772 // 5773 // * EventEndpointDeleted – Topic ARN to which EndpointDeleted event notifications 5774 // are sent. 5775 // 5776 // * EventEndpointUpdated – Topic ARN to which EndpointUpdate event notifications 5777 // are sent. 5778 // 5779 // * EventDeliveryFailure – Topic ARN to which DeliveryFailure event notifications 5780 // are sent upon Direct Publish delivery failure (permanent) to one of the 5781 // application's endpoints. 5782 // 5783 // * SuccessFeedbackRoleArn – IAM role ARN used to give Amazon SNS write 5784 // access to use CloudWatch Logs on your behalf. 5785 // 5786 // * FailureFeedbackRoleArn – IAM role ARN used to give Amazon SNS write 5787 // access to use CloudWatch Logs on your behalf. 5788 // 5789 // * SuccessFeedbackSampleRate – Sample rate percentage (0-100) of successfully 5790 // delivered messages. 5791 // 5792 // Attributes is a required field 5793 Attributes map[string]*string `type:"map" required:"true"` 5794 5795 // PlatformApplicationArn for SetPlatformApplicationAttributes action. 5796 // 5797 // PlatformApplicationArn is a required field 5798 PlatformApplicationArn *string `type:"string" required:"true"` 5799} 5800 5801// String returns the string representation 5802func (s SetPlatformApplicationAttributesInput) String() string { 5803 return awsutil.Prettify(s) 5804} 5805 5806// GoString returns the string representation 5807func (s SetPlatformApplicationAttributesInput) GoString() string { 5808 return s.String() 5809} 5810 5811// Validate inspects the fields of the type to determine if they are valid. 5812func (s *SetPlatformApplicationAttributesInput) Validate() error { 5813 invalidParams := request.ErrInvalidParams{Context: "SetPlatformApplicationAttributesInput"} 5814 if s.Attributes == nil { 5815 invalidParams.Add(request.NewErrParamRequired("Attributes")) 5816 } 5817 if s.PlatformApplicationArn == nil { 5818 invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn")) 5819 } 5820 5821 if invalidParams.Len() > 0 { 5822 return invalidParams 5823 } 5824 return nil 5825} 5826 5827// SetAttributes sets the Attributes field's value. 5828func (s *SetPlatformApplicationAttributesInput) SetAttributes(v map[string]*string) *SetPlatformApplicationAttributesInput { 5829 s.Attributes = v 5830 return s 5831} 5832 5833// SetPlatformApplicationArn sets the PlatformApplicationArn field's value. 5834func (s *SetPlatformApplicationAttributesInput) SetPlatformApplicationArn(v string) *SetPlatformApplicationAttributesInput { 5835 s.PlatformApplicationArn = &v 5836 return s 5837} 5838 5839type SetPlatformApplicationAttributesOutput struct { 5840 _ struct{} `type:"structure"` 5841} 5842 5843// String returns the string representation 5844func (s SetPlatformApplicationAttributesOutput) String() string { 5845 return awsutil.Prettify(s) 5846} 5847 5848// GoString returns the string representation 5849func (s SetPlatformApplicationAttributesOutput) GoString() string { 5850 return s.String() 5851} 5852 5853// The input for the SetSMSAttributes action. 5854type SetSMSAttributesInput struct { 5855 _ struct{} `type:"structure"` 5856 5857 // The default settings for sending SMS messages from your account. You can 5858 // set values for the following attribute names: 5859 // 5860 // MonthlySpendLimit – The maximum amount in USD that you are willing to spend 5861 // each month to send SMS messages. When Amazon SNS determines that sending 5862 // an SMS message would incur a cost that exceeds this limit, it stops sending 5863 // SMS messages within minutes. 5864 // 5865 // Amazon SNS stops sending SMS messages within minutes of the limit being crossed. 5866 // During that interval, if you continue to send SMS messages, you will incur 5867 // costs that exceed your limit. 5868 // 5869 // By default, the spend limit is set to the maximum allowed by Amazon SNS. 5870 // If you want to raise the limit, submit an SNS Limit Increase case (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-sns). 5871 // For New limit value, enter your desired monthly spend limit. In the Use Case 5872 // Description field, explain that you are requesting an SMS monthly spend limit 5873 // increase. 5874 // 5875 // DeliveryStatusIAMRole – The ARN of the IAM role that allows Amazon SNS 5876 // to write logs about SMS deliveries in CloudWatch Logs. For each SMS message 5877 // that you send, Amazon SNS writes a log that includes the message price, the 5878 // success or failure status, the reason for failure (if the message failed), 5879 // the message dwell time, and other information. 5880 // 5881 // DeliveryStatusSuccessSamplingRate – The percentage of successful SMS deliveries 5882 // for which Amazon SNS will write logs in CloudWatch Logs. The value can be 5883 // an integer from 0 - 100. For example, to write logs only for failed deliveries, 5884 // set this value to 0. To write logs for 10% of your successful deliveries, 5885 // set it to 10. 5886 // 5887 // DefaultSenderID – A string, such as your business brand, that is displayed 5888 // as the sender on the receiving device. Support for sender IDs varies by country. 5889 // The sender ID can be 1 - 11 alphanumeric characters, and it must contain 5890 // at least one letter. 5891 // 5892 // DefaultSMSType – The type of SMS message that you will send by default. 5893 // You can assign the following values: 5894 // 5895 // * Promotional – (Default) Noncritical messages, such as marketing messages. 5896 // Amazon SNS optimizes the message delivery to incur the lowest cost. 5897 // 5898 // * Transactional – Critical messages that support customer transactions, 5899 // such as one-time passcodes for multi-factor authentication. Amazon SNS 5900 // optimizes the message delivery to achieve the highest reliability. 5901 // 5902 // UsageReportS3Bucket – The name of the Amazon S3 bucket to receive daily 5903 // SMS usage reports from Amazon SNS. Each day, Amazon SNS will deliver a usage 5904 // report as a CSV file to the bucket. The report includes the following information 5905 // for each SMS message that was successfully delivered by your account: 5906 // 5907 // * Time that the message was published (in UTC) 5908 // 5909 // * Message ID 5910 // 5911 // * Destination phone number 5912 // 5913 // * Message type 5914 // 5915 // * Delivery status 5916 // 5917 // * Message price (in USD) 5918 // 5919 // * Part number (a message is split into multiple parts if it is too long 5920 // for a single message) 5921 // 5922 // * Total number of parts 5923 // 5924 // To receive the report, the bucket must have a policy that allows the Amazon 5925 // SNS service principle to perform the s3:PutObject and s3:GetBucketLocation 5926 // actions. 5927 // 5928 // For an example bucket policy and usage report, see Monitoring SMS Activity 5929 // (https://docs.aws.amazon.com/sns/latest/dg/sms_stats.html) in the Amazon 5930 // SNS Developer Guide. 5931 // 5932 // Attributes is a required field 5933 Attributes map[string]*string `locationName:"attributes" type:"map" required:"true"` 5934} 5935 5936// String returns the string representation 5937func (s SetSMSAttributesInput) String() string { 5938 return awsutil.Prettify(s) 5939} 5940 5941// GoString returns the string representation 5942func (s SetSMSAttributesInput) GoString() string { 5943 return s.String() 5944} 5945 5946// Validate inspects the fields of the type to determine if they are valid. 5947func (s *SetSMSAttributesInput) Validate() error { 5948 invalidParams := request.ErrInvalidParams{Context: "SetSMSAttributesInput"} 5949 if s.Attributes == nil { 5950 invalidParams.Add(request.NewErrParamRequired("Attributes")) 5951 } 5952 5953 if invalidParams.Len() > 0 { 5954 return invalidParams 5955 } 5956 return nil 5957} 5958 5959// SetAttributes sets the Attributes field's value. 5960func (s *SetSMSAttributesInput) SetAttributes(v map[string]*string) *SetSMSAttributesInput { 5961 s.Attributes = v 5962 return s 5963} 5964 5965// The response for the SetSMSAttributes action. 5966type SetSMSAttributesOutput struct { 5967 _ struct{} `type:"structure"` 5968} 5969 5970// String returns the string representation 5971func (s SetSMSAttributesOutput) String() string { 5972 return awsutil.Prettify(s) 5973} 5974 5975// GoString returns the string representation 5976func (s SetSMSAttributesOutput) GoString() string { 5977 return s.String() 5978} 5979 5980// Input for SetSubscriptionAttributes action. 5981type SetSubscriptionAttributesInput struct { 5982 _ struct{} `type:"structure"` 5983 5984 // A map of attributes with their corresponding values. 5985 // 5986 // The following lists the names, descriptions, and values of the special request 5987 // parameters that this action uses: 5988 // 5989 // * DeliveryPolicy – The policy that defines how Amazon SNS retries failed 5990 // deliveries to HTTP/S endpoints. 5991 // 5992 // * FilterPolicy – The simple JSON object that lets your subscriber receive 5993 // only a subset of messages, rather than receiving every message published 5994 // to the topic. 5995 // 5996 // * RawMessageDelivery – When set to true, enables raw message delivery 5997 // to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints 5998 // to process JSON formatting, which is otherwise created for Amazon SNS 5999 // metadata. 6000 // 6001 // * RedrivePolicy – When specified, sends undeliverable messages to the 6002 // specified Amazon SQS dead-letter queue. Messages that can't be delivered 6003 // due to client errors (for example, when the subscribed endpoint is unreachable) 6004 // or server errors (for example, when the service that powers the subscribed 6005 // endpoint becomes unavailable) are held in the dead-letter queue for further 6006 // analysis or reprocessing. 6007 // 6008 // The following attribute applies only to Amazon Kinesis Data Firehose delivery 6009 // stream subscriptions: 6010 // 6011 // * SubscriptionRoleArn – The ARN of the IAM role that has the following: 6012 // Permission to write to the Kinesis Data Firehose delivery stream Amazon 6013 // SNS listed as a trusted entity Specifying a valid ARN for this attribute 6014 // is required for Kinesis Data Firehose delivery stream subscriptions. For 6015 // more information, see Fanout to Kinesis Data Firehose delivery streams 6016 // (https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) 6017 // in the Amazon SNS Developer Guide. 6018 // 6019 // AttributeName is a required field 6020 AttributeName *string `type:"string" required:"true"` 6021 6022 // The new value for the attribute in JSON format. 6023 AttributeValue *string `type:"string"` 6024 6025 // The ARN of the subscription to modify. 6026 // 6027 // SubscriptionArn is a required field 6028 SubscriptionArn *string `type:"string" required:"true"` 6029} 6030 6031// String returns the string representation 6032func (s SetSubscriptionAttributesInput) String() string { 6033 return awsutil.Prettify(s) 6034} 6035 6036// GoString returns the string representation 6037func (s SetSubscriptionAttributesInput) GoString() string { 6038 return s.String() 6039} 6040 6041// Validate inspects the fields of the type to determine if they are valid. 6042func (s *SetSubscriptionAttributesInput) Validate() error { 6043 invalidParams := request.ErrInvalidParams{Context: "SetSubscriptionAttributesInput"} 6044 if s.AttributeName == nil { 6045 invalidParams.Add(request.NewErrParamRequired("AttributeName")) 6046 } 6047 if s.SubscriptionArn == nil { 6048 invalidParams.Add(request.NewErrParamRequired("SubscriptionArn")) 6049 } 6050 6051 if invalidParams.Len() > 0 { 6052 return invalidParams 6053 } 6054 return nil 6055} 6056 6057// SetAttributeName sets the AttributeName field's value. 6058func (s *SetSubscriptionAttributesInput) SetAttributeName(v string) *SetSubscriptionAttributesInput { 6059 s.AttributeName = &v 6060 return s 6061} 6062 6063// SetAttributeValue sets the AttributeValue field's value. 6064func (s *SetSubscriptionAttributesInput) SetAttributeValue(v string) *SetSubscriptionAttributesInput { 6065 s.AttributeValue = &v 6066 return s 6067} 6068 6069// SetSubscriptionArn sets the SubscriptionArn field's value. 6070func (s *SetSubscriptionAttributesInput) SetSubscriptionArn(v string) *SetSubscriptionAttributesInput { 6071 s.SubscriptionArn = &v 6072 return s 6073} 6074 6075type SetSubscriptionAttributesOutput struct { 6076 _ struct{} `type:"structure"` 6077} 6078 6079// String returns the string representation 6080func (s SetSubscriptionAttributesOutput) String() string { 6081 return awsutil.Prettify(s) 6082} 6083 6084// GoString returns the string representation 6085func (s SetSubscriptionAttributesOutput) GoString() string { 6086 return s.String() 6087} 6088 6089// Input for SetTopicAttributes action. 6090type SetTopicAttributesInput struct { 6091 _ struct{} `type:"structure"` 6092 6093 // A map of attributes with their corresponding values. 6094 // 6095 // The following lists the names, descriptions, and values of the special request 6096 // parameters that the SetTopicAttributes action uses: 6097 // 6098 // * DeliveryPolicy – The policy that defines how Amazon SNS retries failed 6099 // deliveries to HTTP/S endpoints. 6100 // 6101 // * DisplayName – The display name to use for a topic with SMS subscriptions. 6102 // 6103 // * Policy – The policy that defines who can access your topic. By default, 6104 // only the topic owner can publish or subscribe to the topic. 6105 // 6106 // The following attribute applies only to server-side-encryption (https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): 6107 // 6108 // * KmsMasterKeyId – The ID of an AWS-managed customer master key (CMK) 6109 // for Amazon SNS or a custom CMK. For more information, see Key Terms (https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). 6110 // For more examples, see KeyId (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) 6111 // in the AWS Key Management Service API Reference. 6112 // 6113 // The following attribute applies only to FIFO topics (https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): 6114 // 6115 // * ContentBasedDeduplication – Enables content-based deduplication for 6116 // FIFO topics. By default, ContentBasedDeduplication is set to false. If 6117 // you create a FIFO topic and this attribute is false, you must specify 6118 // a value for the MessageDeduplicationId parameter for the Publish (https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) 6119 // action. When you set ContentBasedDeduplication to true, Amazon SNS uses 6120 // a SHA-256 hash to generate the MessageDeduplicationId using the body of 6121 // the message (but not the attributes of the message). (Optional) To override 6122 // the generated value, you can specify a value for the the MessageDeduplicationId 6123 // parameter for the Publish action. 6124 // 6125 // AttributeName is a required field 6126 AttributeName *string `type:"string" required:"true"` 6127 6128 // The new value for the attribute. 6129 AttributeValue *string `type:"string"` 6130 6131 // The ARN of the topic to modify. 6132 // 6133 // TopicArn is a required field 6134 TopicArn *string `type:"string" required:"true"` 6135} 6136 6137// String returns the string representation 6138func (s SetTopicAttributesInput) String() string { 6139 return awsutil.Prettify(s) 6140} 6141 6142// GoString returns the string representation 6143func (s SetTopicAttributesInput) GoString() string { 6144 return s.String() 6145} 6146 6147// Validate inspects the fields of the type to determine if they are valid. 6148func (s *SetTopicAttributesInput) Validate() error { 6149 invalidParams := request.ErrInvalidParams{Context: "SetTopicAttributesInput"} 6150 if s.AttributeName == nil { 6151 invalidParams.Add(request.NewErrParamRequired("AttributeName")) 6152 } 6153 if s.TopicArn == nil { 6154 invalidParams.Add(request.NewErrParamRequired("TopicArn")) 6155 } 6156 6157 if invalidParams.Len() > 0 { 6158 return invalidParams 6159 } 6160 return nil 6161} 6162 6163// SetAttributeName sets the AttributeName field's value. 6164func (s *SetTopicAttributesInput) SetAttributeName(v string) *SetTopicAttributesInput { 6165 s.AttributeName = &v 6166 return s 6167} 6168 6169// SetAttributeValue sets the AttributeValue field's value. 6170func (s *SetTopicAttributesInput) SetAttributeValue(v string) *SetTopicAttributesInput { 6171 s.AttributeValue = &v 6172 return s 6173} 6174 6175// SetTopicArn sets the TopicArn field's value. 6176func (s *SetTopicAttributesInput) SetTopicArn(v string) *SetTopicAttributesInput { 6177 s.TopicArn = &v 6178 return s 6179} 6180 6181type SetTopicAttributesOutput struct { 6182 _ struct{} `type:"structure"` 6183} 6184 6185// String returns the string representation 6186func (s SetTopicAttributesOutput) String() string { 6187 return awsutil.Prettify(s) 6188} 6189 6190// GoString returns the string representation 6191func (s SetTopicAttributesOutput) GoString() string { 6192 return s.String() 6193} 6194 6195// Input for Subscribe action. 6196type SubscribeInput struct { 6197 _ struct{} `type:"structure"` 6198 6199 // A map of attributes with their corresponding values. 6200 // 6201 // The following lists the names, descriptions, and values of the special request 6202 // parameters that the SetTopicAttributes action uses: 6203 // 6204 // * DeliveryPolicy – The policy that defines how Amazon SNS retries failed 6205 // deliveries to HTTP/S endpoints. 6206 // 6207 // * FilterPolicy – The simple JSON object that lets your subscriber receive 6208 // only a subset of messages, rather than receiving every message published 6209 // to the topic. 6210 // 6211 // * RawMessageDelivery – When set to true, enables raw message delivery 6212 // to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints 6213 // to process JSON formatting, which is otherwise created for Amazon SNS 6214 // metadata. 6215 // 6216 // * RedrivePolicy – When specified, sends undeliverable messages to the 6217 // specified Amazon SQS dead-letter queue. Messages that can't be delivered 6218 // due to client errors (for example, when the subscribed endpoint is unreachable) 6219 // or server errors (for example, when the service that powers the subscribed 6220 // endpoint becomes unavailable) are held in the dead-letter queue for further 6221 // analysis or reprocessing. 6222 // 6223 // The following attribute applies only to Amazon Kinesis Data Firehose delivery 6224 // stream subscriptions: 6225 // 6226 // * SubscriptionRoleArn – The ARN of the IAM role that has the following: 6227 // Permission to write to the Kinesis Data Firehose delivery stream Amazon 6228 // SNS listed as a trusted entity Specifying a valid ARN for this attribute 6229 // is required for Kinesis Data Firehose delivery stream subscriptions. For 6230 // more information, see Fanout to Kinesis Data Firehose delivery streams 6231 // (https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) 6232 // in the Amazon SNS Developer Guide. 6233 Attributes map[string]*string `type:"map"` 6234 6235 // The endpoint that you want to receive notifications. Endpoints vary by protocol: 6236 // 6237 // * For the http protocol, the (public) endpoint is a URL beginning with 6238 // http://. 6239 // 6240 // * For the https protocol, the (public) endpoint is a URL beginning with 6241 // https://. 6242 // 6243 // * For the email protocol, the endpoint is an email address. 6244 // 6245 // * For the email-json protocol, the endpoint is an email address. 6246 // 6247 // * For the sms protocol, the endpoint is a phone number of an SMS-enabled 6248 // device. 6249 // 6250 // * For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue. 6251 // 6252 // * For the application protocol, the endpoint is the EndpointArn of a mobile 6253 // app and device. 6254 // 6255 // * For the lambda protocol, the endpoint is the ARN of an AWS Lambda function. 6256 // 6257 // * For the firehose protocol, the endpoint is the ARN of an Amazon Kinesis 6258 // Data Firehose delivery stream. 6259 Endpoint *string `type:"string"` 6260 6261 // The protocol that you want to use. Supported protocols include: 6262 // 6263 // * http – delivery of JSON-encoded message via HTTP POST 6264 // 6265 // * https – delivery of JSON-encoded message via HTTPS POST 6266 // 6267 // * email – delivery of message via SMTP 6268 // 6269 // * email-json – delivery of JSON-encoded message via SMTP 6270 // 6271 // * sms – delivery of message via SMS 6272 // 6273 // * sqs – delivery of JSON-encoded message to an Amazon SQS queue 6274 // 6275 // * application – delivery of JSON-encoded message to an EndpointArn for 6276 // a mobile app and device 6277 // 6278 // * lambda – delivery of JSON-encoded message to an AWS Lambda function 6279 // 6280 // * firehose – delivery of JSON-encoded message to an Amazon Kinesis Data 6281 // Firehose delivery stream. 6282 // 6283 // Protocol is a required field 6284 Protocol *string `type:"string" required:"true"` 6285 6286 // Sets whether the response from the Subscribe request includes the subscription 6287 // ARN, even if the subscription is not yet confirmed. 6288 // 6289 // If you set this parameter to true, the response includes the ARN in all cases, 6290 // even if the subscription is not yet confirmed. In addition to the ARN for 6291 // confirmed subscriptions, the response also includes the pending subscription 6292 // ARN value for subscriptions that aren't yet confirmed. A subscription becomes 6293 // confirmed when the subscriber calls the ConfirmSubscription action with a 6294 // confirmation token. 6295 // 6296 // The default value is false. 6297 ReturnSubscriptionArn *bool `type:"boolean"` 6298 6299 // The ARN of the topic you want to subscribe to. 6300 // 6301 // TopicArn is a required field 6302 TopicArn *string `type:"string" required:"true"` 6303} 6304 6305// String returns the string representation 6306func (s SubscribeInput) String() string { 6307 return awsutil.Prettify(s) 6308} 6309 6310// GoString returns the string representation 6311func (s SubscribeInput) GoString() string { 6312 return s.String() 6313} 6314 6315// Validate inspects the fields of the type to determine if they are valid. 6316func (s *SubscribeInput) Validate() error { 6317 invalidParams := request.ErrInvalidParams{Context: "SubscribeInput"} 6318 if s.Protocol == nil { 6319 invalidParams.Add(request.NewErrParamRequired("Protocol")) 6320 } 6321 if s.TopicArn == nil { 6322 invalidParams.Add(request.NewErrParamRequired("TopicArn")) 6323 } 6324 6325 if invalidParams.Len() > 0 { 6326 return invalidParams 6327 } 6328 return nil 6329} 6330 6331// SetAttributes sets the Attributes field's value. 6332func (s *SubscribeInput) SetAttributes(v map[string]*string) *SubscribeInput { 6333 s.Attributes = v 6334 return s 6335} 6336 6337// SetEndpoint sets the Endpoint field's value. 6338func (s *SubscribeInput) SetEndpoint(v string) *SubscribeInput { 6339 s.Endpoint = &v 6340 return s 6341} 6342 6343// SetProtocol sets the Protocol field's value. 6344func (s *SubscribeInput) SetProtocol(v string) *SubscribeInput { 6345 s.Protocol = &v 6346 return s 6347} 6348 6349// SetReturnSubscriptionArn sets the ReturnSubscriptionArn field's value. 6350func (s *SubscribeInput) SetReturnSubscriptionArn(v bool) *SubscribeInput { 6351 s.ReturnSubscriptionArn = &v 6352 return s 6353} 6354 6355// SetTopicArn sets the TopicArn field's value. 6356func (s *SubscribeInput) SetTopicArn(v string) *SubscribeInput { 6357 s.TopicArn = &v 6358 return s 6359} 6360 6361// Response for Subscribe action. 6362type SubscribeOutput struct { 6363 _ struct{} `type:"structure"` 6364 6365 // The ARN of the subscription if it is confirmed, or the string "pending confirmation" 6366 // if the subscription requires confirmation. However, if the API request parameter 6367 // ReturnSubscriptionArn is true, then the value is always the subscription 6368 // ARN, even if the subscription requires confirmation. 6369 SubscriptionArn *string `type:"string"` 6370} 6371 6372// String returns the string representation 6373func (s SubscribeOutput) String() string { 6374 return awsutil.Prettify(s) 6375} 6376 6377// GoString returns the string representation 6378func (s SubscribeOutput) GoString() string { 6379 return s.String() 6380} 6381 6382// SetSubscriptionArn sets the SubscriptionArn field's value. 6383func (s *SubscribeOutput) SetSubscriptionArn(v string) *SubscribeOutput { 6384 s.SubscriptionArn = &v 6385 return s 6386} 6387 6388// A wrapper type for the attributes of an Amazon SNS subscription. 6389type Subscription struct { 6390 _ struct{} `type:"structure"` 6391 6392 // The subscription's endpoint (format depends on the protocol). 6393 Endpoint *string `type:"string"` 6394 6395 // The subscription's owner. 6396 Owner *string `type:"string"` 6397 6398 // The subscription's protocol. 6399 Protocol *string `type:"string"` 6400 6401 // The subscription's ARN. 6402 SubscriptionArn *string `type:"string"` 6403 6404 // The ARN of the subscription's topic. 6405 TopicArn *string `type:"string"` 6406} 6407 6408// String returns the string representation 6409func (s Subscription) String() string { 6410 return awsutil.Prettify(s) 6411} 6412 6413// GoString returns the string representation 6414func (s Subscription) GoString() string { 6415 return s.String() 6416} 6417 6418// SetEndpoint sets the Endpoint field's value. 6419func (s *Subscription) SetEndpoint(v string) *Subscription { 6420 s.Endpoint = &v 6421 return s 6422} 6423 6424// SetOwner sets the Owner field's value. 6425func (s *Subscription) SetOwner(v string) *Subscription { 6426 s.Owner = &v 6427 return s 6428} 6429 6430// SetProtocol sets the Protocol field's value. 6431func (s *Subscription) SetProtocol(v string) *Subscription { 6432 s.Protocol = &v 6433 return s 6434} 6435 6436// SetSubscriptionArn sets the SubscriptionArn field's value. 6437func (s *Subscription) SetSubscriptionArn(v string) *Subscription { 6438 s.SubscriptionArn = &v 6439 return s 6440} 6441 6442// SetTopicArn sets the TopicArn field's value. 6443func (s *Subscription) SetTopicArn(v string) *Subscription { 6444 s.TopicArn = &v 6445 return s 6446} 6447 6448// The list of tags to be added to the specified topic. 6449type Tag struct { 6450 _ struct{} `type:"structure"` 6451 6452 // The required key portion of the tag. 6453 // 6454 // Key is a required field 6455 Key *string `min:"1" type:"string" required:"true"` 6456 6457 // The optional value portion of the tag. 6458 // 6459 // Value is a required field 6460 Value *string `type:"string" required:"true"` 6461} 6462 6463// String returns the string representation 6464func (s Tag) String() string { 6465 return awsutil.Prettify(s) 6466} 6467 6468// GoString returns the string representation 6469func (s Tag) GoString() string { 6470 return s.String() 6471} 6472 6473// Validate inspects the fields of the type to determine if they are valid. 6474func (s *Tag) Validate() error { 6475 invalidParams := request.ErrInvalidParams{Context: "Tag"} 6476 if s.Key == nil { 6477 invalidParams.Add(request.NewErrParamRequired("Key")) 6478 } 6479 if s.Key != nil && len(*s.Key) < 1 { 6480 invalidParams.Add(request.NewErrParamMinLen("Key", 1)) 6481 } 6482 if s.Value == nil { 6483 invalidParams.Add(request.NewErrParamRequired("Value")) 6484 } 6485 6486 if invalidParams.Len() > 0 { 6487 return invalidParams 6488 } 6489 return nil 6490} 6491 6492// SetKey sets the Key field's value. 6493func (s *Tag) SetKey(v string) *Tag { 6494 s.Key = &v 6495 return s 6496} 6497 6498// SetValue sets the Value field's value. 6499func (s *Tag) SetValue(v string) *Tag { 6500 s.Value = &v 6501 return s 6502} 6503 6504type TagResourceInput struct { 6505 _ struct{} `type:"structure"` 6506 6507 // The ARN of the topic to which to add tags. 6508 // 6509 // ResourceArn is a required field 6510 ResourceArn *string `min:"1" type:"string" required:"true"` 6511 6512 // The tags to be added to the specified topic. A tag consists of a required 6513 // key and an optional value. 6514 // 6515 // Tags is a required field 6516 Tags []*Tag `type:"list" required:"true"` 6517} 6518 6519// String returns the string representation 6520func (s TagResourceInput) String() string { 6521 return awsutil.Prettify(s) 6522} 6523 6524// GoString returns the string representation 6525func (s TagResourceInput) GoString() string { 6526 return s.String() 6527} 6528 6529// Validate inspects the fields of the type to determine if they are valid. 6530func (s *TagResourceInput) Validate() error { 6531 invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} 6532 if s.ResourceArn == nil { 6533 invalidParams.Add(request.NewErrParamRequired("ResourceArn")) 6534 } 6535 if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { 6536 invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) 6537 } 6538 if s.Tags == nil { 6539 invalidParams.Add(request.NewErrParamRequired("Tags")) 6540 } 6541 if s.Tags != nil { 6542 for i, v := range s.Tags { 6543 if v == nil { 6544 continue 6545 } 6546 if err := v.Validate(); err != nil { 6547 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) 6548 } 6549 } 6550 } 6551 6552 if invalidParams.Len() > 0 { 6553 return invalidParams 6554 } 6555 return nil 6556} 6557 6558// SetResourceArn sets the ResourceArn field's value. 6559func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { 6560 s.ResourceArn = &v 6561 return s 6562} 6563 6564// SetTags sets the Tags field's value. 6565func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { 6566 s.Tags = v 6567 return s 6568} 6569 6570type TagResourceOutput struct { 6571 _ struct{} `type:"structure"` 6572} 6573 6574// String returns the string representation 6575func (s TagResourceOutput) String() string { 6576 return awsutil.Prettify(s) 6577} 6578 6579// GoString returns the string representation 6580func (s TagResourceOutput) GoString() string { 6581 return s.String() 6582} 6583 6584// A wrapper type for the topic's Amazon Resource Name (ARN). To retrieve a 6585// topic's attributes, use GetTopicAttributes. 6586type Topic struct { 6587 _ struct{} `type:"structure"` 6588 6589 // The topic's ARN. 6590 TopicArn *string `type:"string"` 6591} 6592 6593// String returns the string representation 6594func (s Topic) String() string { 6595 return awsutil.Prettify(s) 6596} 6597 6598// GoString returns the string representation 6599func (s Topic) GoString() string { 6600 return s.String() 6601} 6602 6603// SetTopicArn sets the TopicArn field's value. 6604func (s *Topic) SetTopicArn(v string) *Topic { 6605 s.TopicArn = &v 6606 return s 6607} 6608 6609// Input for Unsubscribe action. 6610type UnsubscribeInput struct { 6611 _ struct{} `type:"structure"` 6612 6613 // The ARN of the subscription to be deleted. 6614 // 6615 // SubscriptionArn is a required field 6616 SubscriptionArn *string `type:"string" required:"true"` 6617} 6618 6619// String returns the string representation 6620func (s UnsubscribeInput) String() string { 6621 return awsutil.Prettify(s) 6622} 6623 6624// GoString returns the string representation 6625func (s UnsubscribeInput) GoString() string { 6626 return s.String() 6627} 6628 6629// Validate inspects the fields of the type to determine if they are valid. 6630func (s *UnsubscribeInput) Validate() error { 6631 invalidParams := request.ErrInvalidParams{Context: "UnsubscribeInput"} 6632 if s.SubscriptionArn == nil { 6633 invalidParams.Add(request.NewErrParamRequired("SubscriptionArn")) 6634 } 6635 6636 if invalidParams.Len() > 0 { 6637 return invalidParams 6638 } 6639 return nil 6640} 6641 6642// SetSubscriptionArn sets the SubscriptionArn field's value. 6643func (s *UnsubscribeInput) SetSubscriptionArn(v string) *UnsubscribeInput { 6644 s.SubscriptionArn = &v 6645 return s 6646} 6647 6648type UnsubscribeOutput struct { 6649 _ struct{} `type:"structure"` 6650} 6651 6652// String returns the string representation 6653func (s UnsubscribeOutput) String() string { 6654 return awsutil.Prettify(s) 6655} 6656 6657// GoString returns the string representation 6658func (s UnsubscribeOutput) GoString() string { 6659 return s.String() 6660} 6661 6662type UntagResourceInput struct { 6663 _ struct{} `type:"structure"` 6664 6665 // The ARN of the topic from which to remove tags. 6666 // 6667 // ResourceArn is a required field 6668 ResourceArn *string `min:"1" type:"string" required:"true"` 6669 6670 // The list of tag keys to remove from the specified topic. 6671 // 6672 // TagKeys is a required field 6673 TagKeys []*string `type:"list" required:"true"` 6674} 6675 6676// String returns the string representation 6677func (s UntagResourceInput) String() string { 6678 return awsutil.Prettify(s) 6679} 6680 6681// GoString returns the string representation 6682func (s UntagResourceInput) GoString() string { 6683 return s.String() 6684} 6685 6686// Validate inspects the fields of the type to determine if they are valid. 6687func (s *UntagResourceInput) Validate() error { 6688 invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} 6689 if s.ResourceArn == nil { 6690 invalidParams.Add(request.NewErrParamRequired("ResourceArn")) 6691 } 6692 if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { 6693 invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) 6694 } 6695 if s.TagKeys == nil { 6696 invalidParams.Add(request.NewErrParamRequired("TagKeys")) 6697 } 6698 6699 if invalidParams.Len() > 0 { 6700 return invalidParams 6701 } 6702 return nil 6703} 6704 6705// SetResourceArn sets the ResourceArn field's value. 6706func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { 6707 s.ResourceArn = &v 6708 return s 6709} 6710 6711// SetTagKeys sets the TagKeys field's value. 6712func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { 6713 s.TagKeys = v 6714 return s 6715} 6716 6717type UntagResourceOutput struct { 6718 _ struct{} `type:"structure"` 6719} 6720 6721// String returns the string representation 6722func (s UntagResourceOutput) String() string { 6723 return awsutil.Prettify(s) 6724} 6725 6726// GoString returns the string representation 6727func (s UntagResourceOutput) GoString() string { 6728 return s.String() 6729} 6730