Upgrade AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2017-09-28 17:57:05 +03:00
parent 9a767b7631
commit 182c21e38c
1096 changed files with 309697 additions and 132612 deletions
+301 -312
View File
@@ -1,6 +1,5 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package sns provides a client for Amazon Simple Notification Service.
package sns
import (
@@ -17,19 +16,18 @@ const opAddPermission = "AddPermission"
// AddPermissionRequest generates a "aws/request.Request" representing the
// client's request for the AddPermission operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See AddPermission for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the AddPermission method directly
// instead.
// See AddPermission for more information on using the AddPermission
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the AddPermissionRequest method.
// req, resp := client.AddPermissionRequest(params)
@@ -109,19 +107,18 @@ const opCheckIfPhoneNumberIsOptedOut = "CheckIfPhoneNumberIsOptedOut"
// CheckIfPhoneNumberIsOptedOutRequest generates a "aws/request.Request" representing the
// client's request for the CheckIfPhoneNumberIsOptedOut operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See CheckIfPhoneNumberIsOptedOut for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CheckIfPhoneNumberIsOptedOut method directly
// instead.
// See CheckIfPhoneNumberIsOptedOut for more information on using the CheckIfPhoneNumberIsOptedOut
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CheckIfPhoneNumberIsOptedOutRequest method.
// req, resp := client.CheckIfPhoneNumberIsOptedOutRequest(params)
@@ -204,19 +201,18 @@ const opConfirmSubscription = "ConfirmSubscription"
// ConfirmSubscriptionRequest generates a "aws/request.Request" representing the
// client's request for the ConfirmSubscription operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See ConfirmSubscription for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ConfirmSubscription method directly
// instead.
// See ConfirmSubscription for more information on using the ConfirmSubscription
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ConfirmSubscriptionRequest method.
// req, resp := client.ConfirmSubscriptionRequest(params)
@@ -300,19 +296,18 @@ const opCreatePlatformApplication = "CreatePlatformApplication"
// CreatePlatformApplicationRequest generates a "aws/request.Request" representing the
// client's request for the CreatePlatformApplication operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See CreatePlatformApplication for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreatePlatformApplication method directly
// instead.
// See CreatePlatformApplication for more information on using the CreatePlatformApplication
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreatePlatformApplicationRequest method.
// req, resp := client.CreatePlatformApplicationRequest(params)
@@ -411,19 +406,18 @@ const opCreatePlatformEndpoint = "CreatePlatformEndpoint"
// CreatePlatformEndpointRequest generates a "aws/request.Request" representing the
// client's request for the CreatePlatformEndpoint operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See CreatePlatformEndpoint for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreatePlatformEndpoint method directly
// instead.
// See CreatePlatformEndpoint for more information on using the CreatePlatformEndpoint
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreatePlatformEndpointRequest method.
// req, resp := client.CreatePlatformEndpointRequest(params)
@@ -513,19 +507,18 @@ const opCreateTopic = "CreateTopic"
// CreateTopicRequest generates a "aws/request.Request" representing the
// client's request for the CreateTopic operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See CreateTopic for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateTopic method directly
// instead.
// See CreateTopic for more information on using the CreateTopic
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateTopicRequest method.
// req, resp := client.CreateTopicRequest(params)
@@ -606,19 +599,18 @@ const opDeleteEndpoint = "DeleteEndpoint"
// DeleteEndpointRequest generates a "aws/request.Request" representing the
// client's request for the DeleteEndpoint operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See DeleteEndpoint for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DeleteEndpoint method directly
// instead.
// See DeleteEndpoint for more information on using the DeleteEndpoint
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DeleteEndpointRequest method.
// req, resp := client.DeleteEndpointRequest(params)
@@ -699,19 +691,18 @@ const opDeletePlatformApplication = "DeletePlatformApplication"
// DeletePlatformApplicationRequest generates a "aws/request.Request" representing the
// client's request for the DeletePlatformApplication operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See DeletePlatformApplication for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DeletePlatformApplication method directly
// instead.
// See DeletePlatformApplication for more information on using the DeletePlatformApplication
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DeletePlatformApplicationRequest method.
// req, resp := client.DeletePlatformApplicationRequest(params)
@@ -789,19 +780,18 @@ const opDeleteTopic = "DeleteTopic"
// DeleteTopicRequest generates a "aws/request.Request" representing the
// client's request for the DeleteTopic operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See DeleteTopic for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DeleteTopic method directly
// instead.
// See DeleteTopic for more information on using the DeleteTopic
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DeleteTopicRequest method.
// req, resp := client.DeleteTopicRequest(params)
@@ -883,19 +873,18 @@ const opGetEndpointAttributes = "GetEndpointAttributes"
// GetEndpointAttributesRequest generates a "aws/request.Request" representing the
// client's request for the GetEndpointAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See GetEndpointAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the GetEndpointAttributes method directly
// instead.
// See GetEndpointAttributes for more information on using the GetEndpointAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the GetEndpointAttributesRequest method.
// req, resp := client.GetEndpointAttributesRequest(params)
@@ -974,19 +963,18 @@ const opGetPlatformApplicationAttributes = "GetPlatformApplicationAttributes"
// GetPlatformApplicationAttributesRequest generates a "aws/request.Request" representing the
// client's request for the GetPlatformApplicationAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See GetPlatformApplicationAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the GetPlatformApplicationAttributes method directly
// instead.
// See GetPlatformApplicationAttributes for more information on using the GetPlatformApplicationAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the GetPlatformApplicationAttributesRequest method.
// req, resp := client.GetPlatformApplicationAttributesRequest(params)
@@ -1065,19 +1053,18 @@ const opGetSMSAttributes = "GetSMSAttributes"
// GetSMSAttributesRequest generates a "aws/request.Request" representing the
// client's request for the GetSMSAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See GetSMSAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the GetSMSAttributes method directly
// instead.
// See GetSMSAttributes for more information on using the GetSMSAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the GetSMSAttributesRequest method.
// req, resp := client.GetSMSAttributesRequest(params)
@@ -1157,19 +1144,18 @@ const opGetSubscriptionAttributes = "GetSubscriptionAttributes"
// GetSubscriptionAttributesRequest generates a "aws/request.Request" representing the
// client's request for the GetSubscriptionAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See GetSubscriptionAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the GetSubscriptionAttributes method directly
// instead.
// See GetSubscriptionAttributes for more information on using the GetSubscriptionAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the GetSubscriptionAttributesRequest method.
// req, resp := client.GetSubscriptionAttributesRequest(params)
@@ -1246,19 +1232,18 @@ const opGetTopicAttributes = "GetTopicAttributes"
// GetTopicAttributesRequest generates a "aws/request.Request" representing the
// client's request for the GetTopicAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See GetTopicAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the GetTopicAttributes method directly
// instead.
// See GetTopicAttributes for more information on using the GetTopicAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the GetTopicAttributesRequest method.
// req, resp := client.GetTopicAttributesRequest(params)
@@ -1336,19 +1321,18 @@ const opListEndpointsByPlatformApplication = "ListEndpointsByPlatformApplication
// ListEndpointsByPlatformApplicationRequest generates a "aws/request.Request" representing the
// client's request for the ListEndpointsByPlatformApplication operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See ListEndpointsByPlatformApplication for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListEndpointsByPlatformApplication method directly
// instead.
// See ListEndpointsByPlatformApplication for more information on using the ListEndpointsByPlatformApplication
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ListEndpointsByPlatformApplicationRequest method.
// req, resp := client.ListEndpointsByPlatformApplicationRequest(params)
@@ -1465,8 +1449,12 @@ func (c *SNS) ListEndpointsByPlatformApplicationPages(input *ListEndpointsByPlat
func (c *SNS) ListEndpointsByPlatformApplicationPagesWithContext(ctx aws.Context, input *ListEndpointsByPlatformApplicationInput, fn func(*ListEndpointsByPlatformApplicationOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
inCpy := *input
req, _ := c.ListEndpointsByPlatformApplicationRequest(&inCpy)
var inCpy *ListEndpointsByPlatformApplicationInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListEndpointsByPlatformApplicationRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
@@ -1484,19 +1472,18 @@ const opListPhoneNumbersOptedOut = "ListPhoneNumbersOptedOut"
// ListPhoneNumbersOptedOutRequest generates a "aws/request.Request" representing the
// client's request for the ListPhoneNumbersOptedOut operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See ListPhoneNumbersOptedOut for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListPhoneNumbersOptedOut method directly
// instead.
// See ListPhoneNumbersOptedOut for more information on using the ListPhoneNumbersOptedOut
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ListPhoneNumbersOptedOutRequest method.
// req, resp := client.ListPhoneNumbersOptedOutRequest(params)
@@ -1582,19 +1569,18 @@ const opListPlatformApplications = "ListPlatformApplications"
// ListPlatformApplicationsRequest generates a "aws/request.Request" representing the
// client's request for the ListPlatformApplications operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See ListPlatformApplications for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListPlatformApplications method directly
// instead.
// See ListPlatformApplications for more information on using the ListPlatformApplications
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ListPlatformApplicationsRequest method.
// req, resp := client.ListPlatformApplicationsRequest(params)
@@ -1708,8 +1694,12 @@ func (c *SNS) ListPlatformApplicationsPages(input *ListPlatformApplicationsInput
func (c *SNS) ListPlatformApplicationsPagesWithContext(ctx aws.Context, input *ListPlatformApplicationsInput, fn func(*ListPlatformApplicationsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
inCpy := *input
req, _ := c.ListPlatformApplicationsRequest(&inCpy)
var inCpy *ListPlatformApplicationsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListPlatformApplicationsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
@@ -1727,19 +1717,18 @@ const opListSubscriptions = "ListSubscriptions"
// ListSubscriptionsRequest generates a "aws/request.Request" representing the
// client's request for the ListSubscriptions operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See ListSubscriptions for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListSubscriptions method directly
// instead.
// See ListSubscriptions for more information on using the ListSubscriptions
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ListSubscriptionsRequest method.
// req, resp := client.ListSubscriptionsRequest(params)
@@ -1849,8 +1838,12 @@ func (c *SNS) ListSubscriptionsPages(input *ListSubscriptionsInput, fn func(*Lis
func (c *SNS) ListSubscriptionsPagesWithContext(ctx aws.Context, input *ListSubscriptionsInput, fn func(*ListSubscriptionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
inCpy := *input
req, _ := c.ListSubscriptionsRequest(&inCpy)
var inCpy *ListSubscriptionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListSubscriptionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
@@ -1868,19 +1861,18 @@ const opListSubscriptionsByTopic = "ListSubscriptionsByTopic"
// ListSubscriptionsByTopicRequest generates a "aws/request.Request" representing the
// client's request for the ListSubscriptionsByTopic operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See ListSubscriptionsByTopic for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListSubscriptionsByTopic method directly
// instead.
// See ListSubscriptionsByTopic for more information on using the ListSubscriptionsByTopic
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ListSubscriptionsByTopicRequest method.
// req, resp := client.ListSubscriptionsByTopicRequest(params)
@@ -1993,8 +1985,12 @@ func (c *SNS) ListSubscriptionsByTopicPages(input *ListSubscriptionsByTopicInput
func (c *SNS) ListSubscriptionsByTopicPagesWithContext(ctx aws.Context, input *ListSubscriptionsByTopicInput, fn func(*ListSubscriptionsByTopicOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
inCpy := *input
req, _ := c.ListSubscriptionsByTopicRequest(&inCpy)
var inCpy *ListSubscriptionsByTopicInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListSubscriptionsByTopicRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
@@ -2012,19 +2008,18 @@ const opListTopics = "ListTopics"
// ListTopicsRequest generates a "aws/request.Request" representing the
// client's request for the ListTopics operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See ListTopics for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the ListTopics method directly
// instead.
// See ListTopics for more information on using the ListTopics
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the ListTopicsRequest method.
// req, resp := client.ListTopicsRequest(params)
@@ -2133,8 +2128,12 @@ func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(*ListTopicsOutput,
func (c *SNS) ListTopicsPagesWithContext(ctx aws.Context, input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
inCpy := *input
req, _ := c.ListTopicsRequest(&inCpy)
var inCpy *ListTopicsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListTopicsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
@@ -2152,19 +2151,18 @@ const opOptInPhoneNumber = "OptInPhoneNumber"
// OptInPhoneNumberRequest generates a "aws/request.Request" representing the
// client's request for the OptInPhoneNumber operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See OptInPhoneNumber for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the OptInPhoneNumber method directly
// instead.
// See OptInPhoneNumber for more information on using the OptInPhoneNumber
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the OptInPhoneNumberRequest method.
// req, resp := client.OptInPhoneNumberRequest(params)
@@ -2245,19 +2243,18 @@ const opPublish = "Publish"
// PublishRequest generates a "aws/request.Request" representing the
// client's request for the Publish operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See Publish for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the Publish method directly
// instead.
// See Publish for more information on using the Publish
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the PublishRequest method.
// req, resp := client.PublishRequest(params)
@@ -2354,19 +2351,18 @@ const opRemovePermission = "RemovePermission"
// RemovePermissionRequest generates a "aws/request.Request" representing the
// client's request for the RemovePermission operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See RemovePermission for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the RemovePermission method directly
// instead.
// See RemovePermission for more information on using the RemovePermission
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the RemovePermissionRequest method.
// req, resp := client.RemovePermissionRequest(params)
@@ -2445,19 +2441,18 @@ const opSetEndpointAttributes = "SetEndpointAttributes"
// SetEndpointAttributesRequest generates a "aws/request.Request" representing the
// client's request for the SetEndpointAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See SetEndpointAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the SetEndpointAttributes method directly
// instead.
// See SetEndpointAttributes for more information on using the SetEndpointAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the SetEndpointAttributesRequest method.
// req, resp := client.SetEndpointAttributesRequest(params)
@@ -2538,19 +2533,18 @@ const opSetPlatformApplicationAttributes = "SetPlatformApplicationAttributes"
// SetPlatformApplicationAttributesRequest generates a "aws/request.Request" representing the
// client's request for the SetPlatformApplicationAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See SetPlatformApplicationAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the SetPlatformApplicationAttributes method directly
// instead.
// See SetPlatformApplicationAttributes for more information on using the SetPlatformApplicationAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the SetPlatformApplicationAttributesRequest method.
// req, resp := client.SetPlatformApplicationAttributesRequest(params)
@@ -2633,19 +2627,18 @@ const opSetSMSAttributes = "SetSMSAttributes"
// SetSMSAttributesRequest generates a "aws/request.Request" representing the
// client's request for the SetSMSAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See SetSMSAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the SetSMSAttributes method directly
// instead.
// See SetSMSAttributes for more information on using the SetSMSAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the SetSMSAttributesRequest method.
// req, resp := client.SetSMSAttributesRequest(params)
@@ -2729,19 +2722,18 @@ const opSetSubscriptionAttributes = "SetSubscriptionAttributes"
// SetSubscriptionAttributesRequest generates a "aws/request.Request" representing the
// client's request for the SetSubscriptionAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See SetSubscriptionAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the SetSubscriptionAttributes method directly
// instead.
// See SetSubscriptionAttributes for more information on using the SetSubscriptionAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the SetSubscriptionAttributesRequest method.
// req, resp := client.SetSubscriptionAttributesRequest(params)
@@ -2820,19 +2812,18 @@ const opSetTopicAttributes = "SetTopicAttributes"
// SetTopicAttributesRequest generates a "aws/request.Request" representing the
// client's request for the SetTopicAttributes operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See SetTopicAttributes for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the SetTopicAttributes method directly
// instead.
// See SetTopicAttributes for more information on using the SetTopicAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the SetTopicAttributesRequest method.
// req, resp := client.SetTopicAttributesRequest(params)
@@ -2911,19 +2902,18 @@ const opSubscribe = "Subscribe"
// SubscribeRequest generates a "aws/request.Request" representing the
// client's request for the Subscribe operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See Subscribe for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the Subscribe method directly
// instead.
// See Subscribe for more information on using the Subscribe
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the SubscribeRequest method.
// req, resp := client.SubscribeRequest(params)
@@ -3006,19 +2996,18 @@ const opUnsubscribe = "Unsubscribe"
// UnsubscribeRequest generates a "aws/request.Request" representing the
// client's request for the Unsubscribe operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
// value will be populated with the request's response once the request complets
// successfuly.
//
// See Unsubscribe for usage and error information.
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the Unsubscribe method directly
// instead.
// See Unsubscribe for more information on using the Unsubscribe
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the UnsubscribeRequest method.
// req, resp := client.UnsubscribeRequest(params)
+40
View File
@@ -0,0 +1,40 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package sns provides the client and types for making API
// requests to Amazon Simple Notification Service.
//
// Amazon Simple Notification Service (Amazon SNS) is a web service that enables
// you to build distributed web-enabled applications. Applications can use Amazon
// SNS to easily push real-time notification messages to interested subscribers
// over multiple delivery protocols. For more information about this product
// see http://aws.amazon.com/sns (http://aws.amazon.com/sns/). For detailed
// information about Amazon SNS features and their associated API calls, see
// the Amazon SNS Developer Guide (http://docs.aws.amazon.com/sns/latest/dg/).
//
// We also provide SDKs that enable you to access Amazon SNS from your preferred
// programming language. The SDKs contain functionality that automatically takes
// care of tasks such as: cryptographically signing your service requests, retrying
// requests, and handling error responses. For a list of available SDKs, go
// to Tools for Amazon Web Services (http://aws.amazon.com/tools/).
//
// See https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31 for more information on this service.
//
// See sns package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/sns/
//
// Using the Client
//
// To Amazon Simple Notification Service with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
//
// See the SDK's documentation for more information on how to use the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the Amazon Simple Notification Service client SNS for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/sns/#New
package sns
+1 -1
View File
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sns
-704
View File
@@ -1,704 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package sns_test
import (
"bytes"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sns"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleSNS_AddPermission() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.AddPermissionInput{
AWSAccountId: []*string{ // Required
aws.String("delegate"), // Required
// More values...
},
ActionName: []*string{ // Required
aws.String("action"), // Required
// More values...
},
Label: aws.String("label"), // Required
TopicArn: aws.String("topicARN"), // Required
}
resp, err := svc.AddPermission(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_CheckIfPhoneNumberIsOptedOut() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.CheckIfPhoneNumberIsOptedOutInput{
PhoneNumber: aws.String("PhoneNumber"), // Required
}
resp, err := svc.CheckIfPhoneNumberIsOptedOut(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_ConfirmSubscription() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.ConfirmSubscriptionInput{
Token: aws.String("token"), // Required
TopicArn: aws.String("topicARN"), // Required
AuthenticateOnUnsubscribe: aws.String("authenticateOnUnsubscribe"),
}
resp, err := svc.ConfirmSubscription(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_CreatePlatformApplication() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.CreatePlatformApplicationInput{
Attributes: map[string]*string{ // Required
"Key": aws.String("String"), // Required
// More values...
},
Name: aws.String("String"), // Required
Platform: aws.String("String"), // Required
}
resp, err := svc.CreatePlatformApplication(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_CreatePlatformEndpoint() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.CreatePlatformEndpointInput{
PlatformApplicationArn: aws.String("String"), // Required
Token: aws.String("String"), // Required
Attributes: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
CustomUserData: aws.String("String"),
}
resp, err := svc.CreatePlatformEndpoint(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_CreateTopic() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.CreateTopicInput{
Name: aws.String("topicName"), // Required
}
resp, err := svc.CreateTopic(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_DeleteEndpoint() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.DeleteEndpointInput{
EndpointArn: aws.String("String"), // Required
}
resp, err := svc.DeleteEndpoint(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_DeletePlatformApplication() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.DeletePlatformApplicationInput{
PlatformApplicationArn: aws.String("String"), // Required
}
resp, err := svc.DeletePlatformApplication(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_DeleteTopic() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.DeleteTopicInput{
TopicArn: aws.String("topicARN"), // Required
}
resp, err := svc.DeleteTopic(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_GetEndpointAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.GetEndpointAttributesInput{
EndpointArn: aws.String("String"), // Required
}
resp, err := svc.GetEndpointAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_GetPlatformApplicationAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.GetPlatformApplicationAttributesInput{
PlatformApplicationArn: aws.String("String"), // Required
}
resp, err := svc.GetPlatformApplicationAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_GetSMSAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.GetSMSAttributesInput{
Attributes: []*string{
aws.String("String"), // Required
// More values...
},
}
resp, err := svc.GetSMSAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_GetSubscriptionAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.GetSubscriptionAttributesInput{
SubscriptionArn: aws.String("subscriptionARN"), // Required
}
resp, err := svc.GetSubscriptionAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_GetTopicAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.GetTopicAttributesInput{
TopicArn: aws.String("topicARN"), // Required
}
resp, err := svc.GetTopicAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_ListEndpointsByPlatformApplication() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.ListEndpointsByPlatformApplicationInput{
PlatformApplicationArn: aws.String("String"), // Required
NextToken: aws.String("String"),
}
resp, err := svc.ListEndpointsByPlatformApplication(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_ListPhoneNumbersOptedOut() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.ListPhoneNumbersOptedOutInput{
NextToken: aws.String("string"),
}
resp, err := svc.ListPhoneNumbersOptedOut(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_ListPlatformApplications() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.ListPlatformApplicationsInput{
NextToken: aws.String("String"),
}
resp, err := svc.ListPlatformApplications(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_ListSubscriptions() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.ListSubscriptionsInput{
NextToken: aws.String("nextToken"),
}
resp, err := svc.ListSubscriptions(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_ListSubscriptionsByTopic() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.ListSubscriptionsByTopicInput{
TopicArn: aws.String("topicARN"), // Required
NextToken: aws.String("nextToken"),
}
resp, err := svc.ListSubscriptionsByTopic(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_ListTopics() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.ListTopicsInput{
NextToken: aws.String("nextToken"),
}
resp, err := svc.ListTopics(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_OptInPhoneNumber() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.OptInPhoneNumberInput{
PhoneNumber: aws.String("PhoneNumber"), // Required
}
resp, err := svc.OptInPhoneNumber(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_Publish() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.PublishInput{
Message: aws.String("message"), // Required
MessageAttributes: map[string]*sns.MessageAttributeValue{
"Key": { // Required
DataType: aws.String("String"), // Required
BinaryValue: []byte("PAYLOAD"),
StringValue: aws.String("String"),
},
// More values...
},
MessageStructure: aws.String("messageStructure"),
PhoneNumber: aws.String("String"),
Subject: aws.String("subject"),
TargetArn: aws.String("String"),
TopicArn: aws.String("topicARN"),
}
resp, err := svc.Publish(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_RemovePermission() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.RemovePermissionInput{
Label: aws.String("label"), // Required
TopicArn: aws.String("topicARN"), // Required
}
resp, err := svc.RemovePermission(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_SetEndpointAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.SetEndpointAttributesInput{
Attributes: map[string]*string{ // Required
"Key": aws.String("String"), // Required
// More values...
},
EndpointArn: aws.String("String"), // Required
}
resp, err := svc.SetEndpointAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_SetPlatformApplicationAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.SetPlatformApplicationAttributesInput{
Attributes: map[string]*string{ // Required
"Key": aws.String("String"), // Required
// More values...
},
PlatformApplicationArn: aws.String("String"), // Required
}
resp, err := svc.SetPlatformApplicationAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_SetSMSAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.SetSMSAttributesInput{
Attributes: map[string]*string{ // Required
"Key": aws.String("String"), // Required
// More values...
},
}
resp, err := svc.SetSMSAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_SetSubscriptionAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.SetSubscriptionAttributesInput{
AttributeName: aws.String("attributeName"), // Required
SubscriptionArn: aws.String("subscriptionARN"), // Required
AttributeValue: aws.String("attributeValue"),
}
resp, err := svc.SetSubscriptionAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_SetTopicAttributes() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.SetTopicAttributesInput{
AttributeName: aws.String("attributeName"), // Required
TopicArn: aws.String("topicARN"), // Required
AttributeValue: aws.String("attributeValue"),
}
resp, err := svc.SetTopicAttributes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_Subscribe() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.SubscribeInput{
Protocol: aws.String("protocol"), // Required
TopicArn: aws.String("topicARN"), // Required
Endpoint: aws.String("endpoint"),
}
resp, err := svc.Subscribe(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleSNS_Unsubscribe() {
sess := session.Must(session.NewSession())
svc := sns.New(sess)
params := &sns.UnsubscribeInput{
SubscriptionArn: aws.String("subscriptionARN"), // Required
}
resp, err := svc.Unsubscribe(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
+6 -16
View File
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sns
@@ -11,22 +11,12 @@ import (
"github.com/aws/aws-sdk-go/private/protocol/query"
)
// Amazon Simple Notification Service (Amazon SNS) is a web service that enables
// you to build distributed web-enabled applications. Applications can use Amazon
// SNS to easily push real-time notification messages to interested subscribers
// over multiple delivery protocols. For more information about this product
// see http://aws.amazon.com/sns (http://aws.amazon.com/sns/). For detailed
// information about Amazon SNS features and their associated API calls, see
// the Amazon SNS Developer Guide (http://docs.aws.amazon.com/sns/latest/dg/).
// SNS provides the API operation methods for making requests to
// Amazon Simple Notification Service. See this package's package overview docs
// for details on the service.
//
// We also provide SDKs that enable you to access Amazon SNS from your preferred
// programming language. The SDKs contain functionality that automatically takes
// care of tasks such as: cryptographically signing your service requests, retrying
// requests, and handling error responses. For a list of available SDKs, go
// to Tools for Amazon Web Services (http://aws.amazon.com/tools/).
// The service client's operations are safe to be used concurrently.
// It is not safe to mutate any of the client's properties though.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31
// SNS methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type SNS struct {
*client.Client
}
+2 -2
View File
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package snsiface provides an interface to enable mocking the Amazon Simple Notification Service service client
// for testing your code.
@@ -21,7 +21,7 @@ import (
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the the SDK's request pipeline.
// to inject custom request handlers into the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // Amazon Simple Notification Service.