mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-29 04:16:07 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+1003
-168
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -7,9 +7,9 @@
|
||||
// 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
|
||||
// see https://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/).
|
||||
// the Amazon SNS Developer Guide (https://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
|
||||
|
||||
+92
@@ -10,12 +10,27 @@ const (
|
||||
// Indicates that the user has been denied access to the requested resource.
|
||||
ErrCodeAuthorizationErrorException = "AuthorizationError"
|
||||
|
||||
// ErrCodeConcurrentAccessException for service response error code
|
||||
// "ConcurrentAccess".
|
||||
//
|
||||
// Can't perform multiple operations on a tag simultaneously. Perform the operations
|
||||
// sequentially.
|
||||
ErrCodeConcurrentAccessException = "ConcurrentAccess"
|
||||
|
||||
// ErrCodeEndpointDisabledException for service response error code
|
||||
// "EndpointDisabled".
|
||||
//
|
||||
// Exception error indicating endpoint disabled.
|
||||
ErrCodeEndpointDisabledException = "EndpointDisabled"
|
||||
|
||||
// ErrCodeFilterPolicyLimitExceededException for service response error code
|
||||
// "FilterPolicyLimitExceeded".
|
||||
//
|
||||
// Indicates that the number of filter polices in your AWS account exceeds the
|
||||
// limit. To add more filter polices, submit an SNS Limit Increase case in the
|
||||
// AWS Support Center.
|
||||
ErrCodeFilterPolicyLimitExceededException = "FilterPolicyLimitExceeded"
|
||||
|
||||
// ErrCodeInternalErrorException for service response error code
|
||||
// "InternalError".
|
||||
//
|
||||
@@ -34,6 +49,57 @@ const (
|
||||
// Indicates that a request parameter does not comply with the associated constraints.
|
||||
ErrCodeInvalidParameterValueException = "ParameterValueInvalid"
|
||||
|
||||
// ErrCodeInvalidSecurityException for service response error code
|
||||
// "InvalidSecurity".
|
||||
//
|
||||
// The credential signature isn't valid. You must use an HTTPS endpoint and
|
||||
// sign your request using Signature Version 4.
|
||||
ErrCodeInvalidSecurityException = "InvalidSecurity"
|
||||
|
||||
// ErrCodeKMSAccessDeniedException for service response error code
|
||||
// "KMSAccessDenied".
|
||||
//
|
||||
// The ciphertext references a key that doesn't exist or that you don't have
|
||||
// access to.
|
||||
ErrCodeKMSAccessDeniedException = "KMSAccessDenied"
|
||||
|
||||
// ErrCodeKMSDisabledException for service response error code
|
||||
// "KMSDisabled".
|
||||
//
|
||||
// The request was rejected because the specified customer master key (CMK)
|
||||
// isn't enabled.
|
||||
ErrCodeKMSDisabledException = "KMSDisabled"
|
||||
|
||||
// ErrCodeKMSInvalidStateException for service response error code
|
||||
// "KMSInvalidState".
|
||||
//
|
||||
// The request was rejected because the state of the specified resource isn't
|
||||
// valid for this request. For more information, see How Key State Affects Use
|
||||
// of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
|
||||
// in the AWS Key Management Service Developer Guide.
|
||||
ErrCodeKMSInvalidStateException = "KMSInvalidState"
|
||||
|
||||
// ErrCodeKMSNotFoundException for service response error code
|
||||
// "KMSNotFound".
|
||||
//
|
||||
// The request was rejected because the specified entity or resource can't be
|
||||
// found.
|
||||
ErrCodeKMSNotFoundException = "KMSNotFound"
|
||||
|
||||
// ErrCodeKMSOptInRequired for service response error code
|
||||
// "KMSOptInRequired".
|
||||
//
|
||||
// The AWS access key ID needs a subscription for the service.
|
||||
ErrCodeKMSOptInRequired = "KMSOptInRequired"
|
||||
|
||||
// ErrCodeKMSThrottlingException for service response error code
|
||||
// "KMSThrottling".
|
||||
//
|
||||
// The request was denied due to request throttling. For more information about
|
||||
// throttling, see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second)
|
||||
// in the AWS Key Management Service Developer Guide.
|
||||
ErrCodeKMSThrottlingException = "KMSThrottling"
|
||||
|
||||
// ErrCodeNotFoundException for service response error code
|
||||
// "NotFound".
|
||||
//
|
||||
@@ -46,12 +112,38 @@ const (
|
||||
// Exception error indicating platform application disabled.
|
||||
ErrCodePlatformApplicationDisabledException = "PlatformApplicationDisabled"
|
||||
|
||||
// ErrCodeResourceNotFoundException for service response error code
|
||||
// "ResourceNotFound".
|
||||
//
|
||||
// Can't tag resource. Verify that the topic exists.
|
||||
ErrCodeResourceNotFoundException = "ResourceNotFound"
|
||||
|
||||
// ErrCodeStaleTagException for service response error code
|
||||
// "StaleTag".
|
||||
//
|
||||
// A tag has been added to a resource with the same ARN as a deleted resource.
|
||||
// Wait a short while and then retry the operation.
|
||||
ErrCodeStaleTagException = "StaleTag"
|
||||
|
||||
// ErrCodeSubscriptionLimitExceededException for service response error code
|
||||
// "SubscriptionLimitExceeded".
|
||||
//
|
||||
// Indicates that the customer already owns the maximum allowed number of subscriptions.
|
||||
ErrCodeSubscriptionLimitExceededException = "SubscriptionLimitExceeded"
|
||||
|
||||
// ErrCodeTagLimitExceededException for service response error code
|
||||
// "TagLimitExceeded".
|
||||
//
|
||||
// Can't add more than 50 tags to a topic.
|
||||
ErrCodeTagLimitExceededException = "TagLimitExceeded"
|
||||
|
||||
// ErrCodeTagPolicyException for service response error code
|
||||
// "TagPolicy".
|
||||
//
|
||||
// The request doesn't comply with the IAM tag policy. Correct your request
|
||||
// and then retry it.
|
||||
ErrCodeTagPolicyException = "TagPolicy"
|
||||
|
||||
// ErrCodeThrottledException for service response error code
|
||||
// "Throttled".
|
||||
//
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// +build go1.10,integration
|
||||
|
||||
package sns_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/awstesting/integration"
|
||||
"github.com/aws/aws-sdk-go/service/sns"
|
||||
)
|
||||
|
||||
var _ aws.Config
|
||||
var _ awserr.Error
|
||||
var _ request.Request
|
||||
|
||||
func TestInteg_00_ListTopics(t *testing.T) {
|
||||
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancelFn()
|
||||
|
||||
sess := integration.SessionWithDefaultRegion("us-west-2")
|
||||
svc := sns.New(sess)
|
||||
params := &sns.ListTopicsInput{}
|
||||
_, err := svc.ListTopicsWithContext(ctx, params)
|
||||
if err != nil {
|
||||
t.Errorf("expect no error, got %v", err)
|
||||
}
|
||||
}
|
||||
func TestInteg_01_Publish(t *testing.T) {
|
||||
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancelFn()
|
||||
|
||||
sess := integration.SessionWithDefaultRegion("us-west-2")
|
||||
svc := sns.New(sess)
|
||||
params := &sns.PublishInput{
|
||||
Message: aws.String("hello"),
|
||||
TopicArn: aws.String("fake_topic"),
|
||||
}
|
||||
_, err := svc.PublishWithContext(ctx, params)
|
||||
if err == nil {
|
||||
t.Fatalf("expect request to fail")
|
||||
}
|
||||
aerr, ok := err.(awserr.RequestFailure)
|
||||
if !ok {
|
||||
t.Fatalf("expect awserr, was %T", err)
|
||||
}
|
||||
if len(aerr.Code()) == 0 {
|
||||
t.Errorf("expect non-empty error code")
|
||||
}
|
||||
if v := aerr.Code(); v == request.ErrCodeSerialization {
|
||||
t.Errorf("expect API error code got serialization failure")
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "sns" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
ServiceName = "sns" // Name of service.
|
||||
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||
ServiceID = "SNS" // ServiceID is a unique identifer of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the SNS client with a session.
|
||||
@@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
|
||||
+12
@@ -148,6 +148,10 @@ type SNSAPI interface {
|
||||
ListSubscriptionsByTopicPages(*sns.ListSubscriptionsByTopicInput, func(*sns.ListSubscriptionsByTopicOutput, bool) bool) error
|
||||
ListSubscriptionsByTopicPagesWithContext(aws.Context, *sns.ListSubscriptionsByTopicInput, func(*sns.ListSubscriptionsByTopicOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListTagsForResource(*sns.ListTagsForResourceInput) (*sns.ListTagsForResourceOutput, error)
|
||||
ListTagsForResourceWithContext(aws.Context, *sns.ListTagsForResourceInput, ...request.Option) (*sns.ListTagsForResourceOutput, error)
|
||||
ListTagsForResourceRequest(*sns.ListTagsForResourceInput) (*request.Request, *sns.ListTagsForResourceOutput)
|
||||
|
||||
ListTopics(*sns.ListTopicsInput) (*sns.ListTopicsOutput, error)
|
||||
ListTopicsWithContext(aws.Context, *sns.ListTopicsInput, ...request.Option) (*sns.ListTopicsOutput, error)
|
||||
ListTopicsRequest(*sns.ListTopicsInput) (*request.Request, *sns.ListTopicsOutput)
|
||||
@@ -191,9 +195,17 @@ type SNSAPI interface {
|
||||
SubscribeWithContext(aws.Context, *sns.SubscribeInput, ...request.Option) (*sns.SubscribeOutput, error)
|
||||
SubscribeRequest(*sns.SubscribeInput) (*request.Request, *sns.SubscribeOutput)
|
||||
|
||||
TagResource(*sns.TagResourceInput) (*sns.TagResourceOutput, error)
|
||||
TagResourceWithContext(aws.Context, *sns.TagResourceInput, ...request.Option) (*sns.TagResourceOutput, error)
|
||||
TagResourceRequest(*sns.TagResourceInput) (*request.Request, *sns.TagResourceOutput)
|
||||
|
||||
Unsubscribe(*sns.UnsubscribeInput) (*sns.UnsubscribeOutput, error)
|
||||
UnsubscribeWithContext(aws.Context, *sns.UnsubscribeInput, ...request.Option) (*sns.UnsubscribeOutput, error)
|
||||
UnsubscribeRequest(*sns.UnsubscribeInput) (*request.Request, *sns.UnsubscribeOutput)
|
||||
|
||||
UntagResource(*sns.UntagResourceInput) (*sns.UntagResourceOutput, error)
|
||||
UntagResourceWithContext(aws.Context, *sns.UntagResourceInput, ...request.Option) (*sns.UntagResourceOutput, error)
|
||||
UntagResourceRequest(*sns.UntagResourceInput) (*request.Request, *sns.UntagResourceOutput)
|
||||
}
|
||||
|
||||
var _ SNSAPI = (*sns.SNS)(nil)
|
||||
|
||||
Reference in New Issue
Block a user