Update Go AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2019-07-13 00:03:55 +03:00
committed by Andrey Smirnov
parent d08be990ef
commit 94a72b23ff
2183 changed files with 885887 additions and 228114 deletions
File diff suppressed because it is too large Load Diff
@@ -80,6 +80,10 @@ type CodeDeployAPI interface {
BatchGetDeploymentInstancesWithContext(aws.Context, *codedeploy.BatchGetDeploymentInstancesInput, ...request.Option) (*codedeploy.BatchGetDeploymentInstancesOutput, error)
BatchGetDeploymentInstancesRequest(*codedeploy.BatchGetDeploymentInstancesInput) (*request.Request, *codedeploy.BatchGetDeploymentInstancesOutput)
BatchGetDeploymentTargets(*codedeploy.BatchGetDeploymentTargetsInput) (*codedeploy.BatchGetDeploymentTargetsOutput, error)
BatchGetDeploymentTargetsWithContext(aws.Context, *codedeploy.BatchGetDeploymentTargetsInput, ...request.Option) (*codedeploy.BatchGetDeploymentTargetsOutput, error)
BatchGetDeploymentTargetsRequest(*codedeploy.BatchGetDeploymentTargetsInput) (*request.Request, *codedeploy.BatchGetDeploymentTargetsOutput)
BatchGetDeployments(*codedeploy.BatchGetDeploymentsInput) (*codedeploy.BatchGetDeploymentsOutput, error)
BatchGetDeploymentsWithContext(aws.Context, *codedeploy.BatchGetDeploymentsInput, ...request.Option) (*codedeploy.BatchGetDeploymentsOutput, error)
BatchGetDeploymentsRequest(*codedeploy.BatchGetDeploymentsInput) (*request.Request, *codedeploy.BatchGetDeploymentsOutput)
@@ -152,6 +156,10 @@ type CodeDeployAPI interface {
GetDeploymentInstanceWithContext(aws.Context, *codedeploy.GetDeploymentInstanceInput, ...request.Option) (*codedeploy.GetDeploymentInstanceOutput, error)
GetDeploymentInstanceRequest(*codedeploy.GetDeploymentInstanceInput) (*request.Request, *codedeploy.GetDeploymentInstanceOutput)
GetDeploymentTarget(*codedeploy.GetDeploymentTargetInput) (*codedeploy.GetDeploymentTargetOutput, error)
GetDeploymentTargetWithContext(aws.Context, *codedeploy.GetDeploymentTargetInput, ...request.Option) (*codedeploy.GetDeploymentTargetOutput, error)
GetDeploymentTargetRequest(*codedeploy.GetDeploymentTargetInput) (*request.Request, *codedeploy.GetDeploymentTargetOutput)
GetOnPremisesInstance(*codedeploy.GetOnPremisesInstanceInput) (*codedeploy.GetOnPremisesInstanceOutput, error)
GetOnPremisesInstanceWithContext(aws.Context, *codedeploy.GetOnPremisesInstanceInput, ...request.Option) (*codedeploy.GetOnPremisesInstanceOutput, error)
GetOnPremisesInstanceRequest(*codedeploy.GetOnPremisesInstanceInput) (*request.Request, *codedeploy.GetOnPremisesInstanceOutput)
@@ -191,6 +199,10 @@ type CodeDeployAPI interface {
ListDeploymentInstancesPages(*codedeploy.ListDeploymentInstancesInput, func(*codedeploy.ListDeploymentInstancesOutput, bool) bool) error
ListDeploymentInstancesPagesWithContext(aws.Context, *codedeploy.ListDeploymentInstancesInput, func(*codedeploy.ListDeploymentInstancesOutput, bool) bool, ...request.Option) error
ListDeploymentTargets(*codedeploy.ListDeploymentTargetsInput) (*codedeploy.ListDeploymentTargetsOutput, error)
ListDeploymentTargetsWithContext(aws.Context, *codedeploy.ListDeploymentTargetsInput, ...request.Option) (*codedeploy.ListDeploymentTargetsOutput, error)
ListDeploymentTargetsRequest(*codedeploy.ListDeploymentTargetsInput) (*request.Request, *codedeploy.ListDeploymentTargetsOutput)
ListDeployments(*codedeploy.ListDeploymentsInput) (*codedeploy.ListDeploymentsOutput, error)
ListDeploymentsWithContext(aws.Context, *codedeploy.ListDeploymentsInput, ...request.Option) (*codedeploy.ListDeploymentsOutput, error)
ListDeploymentsRequest(*codedeploy.ListDeploymentsInput) (*request.Request, *codedeploy.ListDeploymentsOutput)
@@ -206,6 +218,10 @@ type CodeDeployAPI interface {
ListOnPremisesInstancesWithContext(aws.Context, *codedeploy.ListOnPremisesInstancesInput, ...request.Option) (*codedeploy.ListOnPremisesInstancesOutput, error)
ListOnPremisesInstancesRequest(*codedeploy.ListOnPremisesInstancesInput) (*request.Request, *codedeploy.ListOnPremisesInstancesOutput)
ListTagsForResource(*codedeploy.ListTagsForResourceInput) (*codedeploy.ListTagsForResourceOutput, error)
ListTagsForResourceWithContext(aws.Context, *codedeploy.ListTagsForResourceInput, ...request.Option) (*codedeploy.ListTagsForResourceOutput, error)
ListTagsForResourceRequest(*codedeploy.ListTagsForResourceInput) (*request.Request, *codedeploy.ListTagsForResourceOutput)
PutLifecycleEventHookExecutionStatus(*codedeploy.PutLifecycleEventHookExecutionStatusInput) (*codedeploy.PutLifecycleEventHookExecutionStatusOutput, error)
PutLifecycleEventHookExecutionStatusWithContext(aws.Context, *codedeploy.PutLifecycleEventHookExecutionStatusInput, ...request.Option) (*codedeploy.PutLifecycleEventHookExecutionStatusOutput, error)
PutLifecycleEventHookExecutionStatusRequest(*codedeploy.PutLifecycleEventHookExecutionStatusInput) (*request.Request, *codedeploy.PutLifecycleEventHookExecutionStatusOutput)
@@ -230,6 +246,14 @@ type CodeDeployAPI interface {
StopDeploymentWithContext(aws.Context, *codedeploy.StopDeploymentInput, ...request.Option) (*codedeploy.StopDeploymentOutput, error)
StopDeploymentRequest(*codedeploy.StopDeploymentInput) (*request.Request, *codedeploy.StopDeploymentOutput)
TagResource(*codedeploy.TagResourceInput) (*codedeploy.TagResourceOutput, error)
TagResourceWithContext(aws.Context, *codedeploy.TagResourceInput, ...request.Option) (*codedeploy.TagResourceOutput, error)
TagResourceRequest(*codedeploy.TagResourceInput) (*request.Request, *codedeploy.TagResourceOutput)
UntagResource(*codedeploy.UntagResourceInput) (*codedeploy.UntagResourceOutput, error)
UntagResourceWithContext(aws.Context, *codedeploy.UntagResourceInput, ...request.Option) (*codedeploy.UntagResourceOutput, error)
UntagResourceRequest(*codedeploy.UntagResourceInput) (*request.Request, *codedeploy.UntagResourceOutput)
UpdateApplication(*codedeploy.UpdateApplicationInput) (*codedeploy.UpdateApplicationOutput, error)
UpdateApplicationWithContext(aws.Context, *codedeploy.UpdateApplicationInput, ...request.Option) (*codedeploy.UpdateApplicationOutput, error)
UpdateApplicationRequest(*codedeploy.UpdateApplicationInput) (*request.Request, *codedeploy.UpdateApplicationOutput)
+33 -24
View File
@@ -5,14 +5,14 @@
//
// AWS CodeDeploy is a deployment service that automates application deployments
// to Amazon EC2 instances, on-premises instances running in your own facility,
// or serverless AWS Lambda functions.
// serverless AWS Lambda functions, or applications in an Amazon ECS service.
//
// You can deploy a nearly unlimited variety of application content, such as
// an updated Lambda function, code, web and configuration files, executables,
// packages, scripts, multimedia files, and so on. AWS CodeDeploy can deploy
// application content stored in Amazon S3 buckets, GitHub repositories, or
// Bitbucket repositories. You do not need to make changes to your existing
// code before you can use AWS CodeDeploy.
// an updated Lambda function, updated applications in an Amazon ECS service,
// code, web and configuration files, executables, packages, scripts, multimedia
// files, and so on. AWS CodeDeploy can deploy application content stored in
// Amazon S3 buckets, GitHub repositories, or Bitbucket repositories. You do
// not need to make changes to your existing code before you can use AWS CodeDeploy.
//
// AWS CodeDeploy makes it easier for you to rapidly release new features, helps
// you avoid downtime during application deployment, and handles the complexity
@@ -29,38 +29,47 @@
// to ensure the correct combination of revision, deployment configuration,
// and deployment group are referenced during a deployment.
//
// * Deployment group: A set of individual instances or CodeDeploy Lambda
// applications. A Lambda deployment group contains a group of applications.
// An EC2/On-premises deployment group contains individually tagged instances,
// Amazon EC2 instances in Auto Scaling groups, or both.
// * Deployment group: A set of individual instances, CodeDeploy Lambda deployment
// configuration settings, or an Amazon ECS service and network details.
// A Lambda deployment group specifies how to route traffic to a new version
// of a Lambda function. An Amazon ECS deployment group specifies the service
// created in Amazon ECS to deploy, a load balancer, and a listener to reroute
// production traffic to an updated containerized application. An EC2/On-premises
// deployment group contains individually tagged instances, Amazon EC2 instances
// in Amazon EC2 Auto Scaling groups, or both. All deployment groups can
// specify optional trigger, alarm, and rollback settings.
//
// * Deployment configuration: A set of deployment rules and deployment success
// and failure conditions used by AWS CodeDeploy during a deployment.
//
// * Deployment: The process and the components used in the process of updating
// a Lambda function or of installing content on one or more instances.
// * Deployment: The process and the components used when updating a Lambda
// function, a containerized application in an Amazon ECS service, or of
// installing content on one or more instances.
//
// * Application revisions: For an AWS Lambda deployment, this is an AppSpec
// file that specifies the Lambda function to update and one or more functions
// to validate deployment lifecycle events. For an EC2/On-premises deployment,
// this is an archive file containing source content—source code, web pages,
// executable files, and deployment scripts—along with an AppSpec file. Revisions
// are stored in Amazon S3 buckets or GitHub repositories. For Amazon S3,
// a revision is uniquely identified by its Amazon S3 object key and its
// ETag, version, or both. For GitHub, a revision is uniquely identified
// by its commit ID.
// file that specifies the Lambda function to be updated and one or more
// functions to validate deployment lifecycle events. For an Amazon ECS deployment,
// this is an AppSpec file that specifies the Amazon ECS task definition,
// container, and port where production traffic is rerouted. For an EC2/On-premises
// deployment, this is an archive file that contains source content—source
// code, webpages, executable files, and deployment scripts—along with
// an AppSpec file. Revisions are stored in Amazon S3 buckets or GitHub repositories.
// For Amazon S3, a revision is uniquely identified by its Amazon S3 object
// key and its ETag, version, or both. For GitHub, a revision is uniquely
// identified by its commit ID.
//
// This guide also contains information to help you get details about the instances
// in your deployments, to make on-premises instances available for AWS CodeDeploy
// deployments, and to get details about a Lambda function deployment.
// deployments, to get details about a Lambda function deployment, and to get
// details about Amazon ECS service deployments.
//
// AWS CodeDeploy Information Resources
//
// * AWS CodeDeploy User Guide (http://docs.aws.amazon.com/codedeploy/latest/userguide)
// * AWS CodeDeploy User Guide (https://docs.aws.amazon.com/codedeploy/latest/userguide)
//
// * AWS CodeDeploy API Reference Guide (http://docs.aws.amazon.com/codedeploy/latest/APIReference/)
// * AWS CodeDeploy API Reference Guide (https://docs.aws.amazon.com/codedeploy/latest/APIReference/)
//
// * AWS CLI Reference for AWS CodeDeploy (http://docs.aws.amazon.com/cli/latest/reference/deploy/index.html)
// * AWS CLI Reference for AWS CodeDeploy (https://docs.aws.amazon.com/cli/latest/reference/deploy/index.html)
//
// * AWS CodeDeploy Developer Forum (https://forums.aws.amazon.com/forum.jspa?forumID=179)
//
+112 -25
View File
@@ -13,14 +13,14 @@ const (
// ErrCodeApplicationAlreadyExistsException for service response error code
// "ApplicationAlreadyExistsException".
//
// An application with the specified name already exists with the applicable
// IAM user or AWS account.
// An application with the specified name with the IAM user or AWS account already
// exists.
ErrCodeApplicationAlreadyExistsException = "ApplicationAlreadyExistsException"
// ErrCodeApplicationDoesNotExistException for service response error code
// "ApplicationDoesNotExistException".
//
// The application does not exist with the applicable IAM user or AWS account.
// The application does not exist with the IAM user or AWS account.
ErrCodeApplicationDoesNotExistException = "ApplicationDoesNotExistException"
// ErrCodeApplicationLimitExceededException for service response error code
@@ -35,6 +35,13 @@ const (
// The minimum number of required application names was not specified.
ErrCodeApplicationNameRequiredException = "ApplicationNameRequiredException"
// ErrCodeArnNotSupportedException for service response error code
// "ArnNotSupportedException".
//
// The specified ARN is not supported. For example, it might be an ARN for a
// resource that is not expected.
ErrCodeArnNotSupportedException = "ArnNotSupportedException"
// ErrCodeBatchLimitExceededException for service response error code
// "BatchLimitExceededException".
//
@@ -56,15 +63,14 @@ const (
// ErrCodeDeploymentConfigAlreadyExistsException for service response error code
// "DeploymentConfigAlreadyExistsException".
//
// A deployment configuration with the specified name already exists with the
// applicable IAM user or AWS account.
// A deployment configuration with the specified name with the IAM user or AWS
// account already exists .
ErrCodeDeploymentConfigAlreadyExistsException = "DeploymentConfigAlreadyExistsException"
// ErrCodeDeploymentConfigDoesNotExistException for service response error code
// "DeploymentConfigDoesNotExistException".
//
// The deployment configuration does not exist with the applicable IAM user
// or AWS account.
// The deployment configuration does not exist with the IAM user or AWS account.
ErrCodeDeploymentConfigDoesNotExistException = "DeploymentConfigDoesNotExistException"
// ErrCodeDeploymentConfigInUseException for service response error code
@@ -88,21 +94,20 @@ const (
// ErrCodeDeploymentDoesNotExistException for service response error code
// "DeploymentDoesNotExistException".
//
// The deployment does not exist with the applicable IAM user or AWS account.
// The deployment with the IAM user or AWS account does not exist.
ErrCodeDeploymentDoesNotExistException = "DeploymentDoesNotExistException"
// ErrCodeDeploymentGroupAlreadyExistsException for service response error code
// "DeploymentGroupAlreadyExistsException".
//
// A deployment group with the specified name already exists with the applicable
// IAM user or AWS account.
// A deployment group with the specified name with the IAM user or AWS account
// already exists.
ErrCodeDeploymentGroupAlreadyExistsException = "DeploymentGroupAlreadyExistsException"
// ErrCodeDeploymentGroupDoesNotExistException for service response error code
// "DeploymentGroupDoesNotExistException".
//
// The named deployment group does not exist with the applicable IAM user or
// AWS account.
// The named deployment group with the IAM user or AWS account does not exist.
ErrCodeDeploymentGroupDoesNotExistException = "DeploymentGroupDoesNotExistException"
// ErrCodeDeploymentGroupLimitExceededException for service response error code
@@ -141,12 +146,40 @@ const (
// The specified deployment has not started.
ErrCodeDeploymentNotStartedException = "DeploymentNotStartedException"
// ErrCodeDeploymentTargetDoesNotExistException for service response error code
// "DeploymentTargetDoesNotExistException".
//
// The provided target ID does not belong to the attempted deployment.
ErrCodeDeploymentTargetDoesNotExistException = "DeploymentTargetDoesNotExistException"
// ErrCodeDeploymentTargetIdRequiredException for service response error code
// "DeploymentTargetIdRequiredException".
//
// A deployment target ID was not provided.
ErrCodeDeploymentTargetIdRequiredException = "DeploymentTargetIdRequiredException"
// ErrCodeDeploymentTargetListSizeExceededException for service response error code
// "DeploymentTargetListSizeExceededException".
//
// The maximum number of targets that can be associated with an Amazon ECS or
// AWS Lambda deployment was exceeded. The target list of both types of deployments
// must have exactly one item. This exception does not apply to EC2/On-premises
// deployments.
ErrCodeDeploymentTargetListSizeExceededException = "DeploymentTargetListSizeExceededException"
// ErrCodeDescriptionTooLongException for service response error code
// "DescriptionTooLongException".
//
// The description is too long.
ErrCodeDescriptionTooLongException = "DescriptionTooLongException"
// ErrCodeECSServiceMappingLimitExceededException for service response error code
// "ECSServiceMappingLimitExceededException".
//
// The Amazon ECS service is associated with more than one deployment groups.
// An Amazon ECS service can be associated with only one deployment group.
ErrCodeECSServiceMappingLimitExceededException = "ECSServiceMappingLimitExceededException"
// ErrCodeGitHubAccountTokenDoesNotExistException for service response error code
// "GitHubAccountTokenDoesNotExistException".
//
@@ -231,11 +264,11 @@ const (
//
// * The alarm object is null.
//
// * The alarm name is empty or null or exceeds the 255 character limit.
// * The alarm name is empty or null or exceeds the limit of 255 characters.
//
// * Two alarms with the same name have been specified.
//
// * The alarm configuration is enabled but the alarm list is empty.
// * The alarm configuration is enabled, but the alarm list is empty.
ErrCodeInvalidAlarmConfigException = "InvalidAlarmConfigException"
// ErrCodeInvalidApplicationNameException for service response error code
@@ -244,11 +277,17 @@ const (
// The application name was specified in an invalid format.
ErrCodeInvalidApplicationNameException = "InvalidApplicationNameException"
// ErrCodeInvalidArnException for service response error code
// "InvalidArnException".
//
// The specified ARN is not in a valid format.
ErrCodeInvalidArnException = "InvalidArnException"
// ErrCodeInvalidAutoRollbackConfigException for service response error code
// "InvalidAutoRollbackConfigException".
//
// The automatic rollback configuration was specified in an invalid format.
// For example, automatic rollback is enabled but an invalid triggering event
// For example, automatic rollback is enabled, but an invalid triggering event
// type or no event types were listed.
ErrCodeInvalidAutoRollbackConfigException = "InvalidAutoRollbackConfigException"
@@ -319,10 +358,22 @@ const (
// "InvalidDeploymentStyleException".
//
// An invalid deployment style was specified. Valid deployment types include
// "IN_PLACE" and "BLUE_GREEN". Valid deployment options include "WITH_TRAFFIC_CONTROL"
// and "WITHOUT_TRAFFIC_CONTROL".
// "IN_PLACE" and "BLUE_GREEN." Valid deployment options include "WITH_TRAFFIC_CONTROL"
// and "WITHOUT_TRAFFIC_CONTROL."
ErrCodeInvalidDeploymentStyleException = "InvalidDeploymentStyleException"
// ErrCodeInvalidDeploymentTargetIdException for service response error code
// "InvalidDeploymentTargetIdException".
//
// The target ID provided was not valid.
ErrCodeInvalidDeploymentTargetIdException = "InvalidDeploymentTargetIdException"
// ErrCodeInvalidDeploymentWaitTypeException for service response error code
// "InvalidDeploymentWaitTypeException".
//
// The wait type is invalid.
ErrCodeInvalidDeploymentWaitTypeException = "InvalidDeploymentWaitTypeException"
// ErrCodeInvalidEC2TagCombinationException for service response error code
// "InvalidEC2TagCombinationException".
//
@@ -336,15 +387,27 @@ const (
// The tag was specified in an invalid format.
ErrCodeInvalidEC2TagException = "InvalidEC2TagException"
// ErrCodeInvalidECSServiceException for service response error code
// "InvalidECSServiceException".
//
// The Amazon ECS service identifier is not valid.
ErrCodeInvalidECSServiceException = "InvalidECSServiceException"
// ErrCodeInvalidFileExistsBehaviorException for service response error code
// "InvalidFileExistsBehaviorException".
//
// An invalid fileExistsBehavior option was specified to determine how AWS CodeDeploy
// handles files or directories that already exist in a deployment target location
// handles files or directories that already exist in a deployment target location,
// but weren't part of the previous successful deployment. Valid values include
// "DISALLOW", "OVERWRITE", and "RETAIN".
// "DISALLOW," "OVERWRITE," and "RETAIN."
ErrCodeInvalidFileExistsBehaviorException = "InvalidFileExistsBehaviorException"
// ErrCodeInvalidGitHubAccountTokenException for service response error code
// "InvalidGitHubAccountTokenException".
//
// The GitHub token is not valid.
ErrCodeInvalidGitHubAccountTokenException = "InvalidGitHubAccountTokenException"
// ErrCodeInvalidGitHubAccountTokenNameException for service response error code
// "InvalidGitHubAccountTokenNameException".
//
@@ -373,13 +436,13 @@ const (
// ErrCodeInvalidInputException for service response error code
// "InvalidInputException".
//
// The specified input was specified in an invalid format.
// The input was specified in an invalid format.
ErrCodeInvalidInputException = "InvalidInputException"
// ErrCodeInvalidInstanceNameException for service response error code
// "InvalidInstanceNameException".
//
// The specified on-premises instance name was specified in an invalid format.
// The on-premises instance name was specified in an invalid format.
ErrCodeInvalidInstanceNameException = "InvalidInstanceNameException"
// ErrCodeInvalidInstanceStatusException for service response error code
@@ -464,7 +527,7 @@ const (
//
// The service role ARN was specified in an invalid format. Or, if an Auto Scaling
// group was specified, the specified service role does not grant the appropriate
// permissions to Auto Scaling.
// permissions to Amazon EC2 Auto Scaling.
ErrCodeInvalidRoleException = "InvalidRoleException"
// ErrCodeInvalidSortByException for service response error code
@@ -483,15 +546,33 @@ const (
// ErrCodeInvalidTagException for service response error code
// "InvalidTagException".
//
// The specified tag was specified in an invalid format.
// The tag was specified in an invalid format.
ErrCodeInvalidTagException = "InvalidTagException"
// ErrCodeInvalidTagFilterException for service response error code
// "InvalidTagFilterException".
//
// The specified tag filter was specified in an invalid format.
// The tag filter was specified in an invalid format.
ErrCodeInvalidTagFilterException = "InvalidTagFilterException"
// ErrCodeInvalidTagsToAddException for service response error code
// "InvalidTagsToAddException".
//
// The specified tags are not valid.
ErrCodeInvalidTagsToAddException = "InvalidTagsToAddException"
// ErrCodeInvalidTargetFilterNameException for service response error code
// "InvalidTargetFilterNameException".
//
// The target filter name is invalid.
ErrCodeInvalidTargetFilterNameException = "InvalidTargetFilterNameException"
// ErrCodeInvalidTargetGroupPairException for service response error code
// "InvalidTargetGroupPairException".
//
// A target group pair associated with this deployment is not valid.
ErrCodeInvalidTargetGroupPairException = "InvalidTargetGroupPairException"
// ErrCodeInvalidTargetInstancesException for service response error code
// "InvalidTargetInstancesException".
//
@@ -558,6 +639,12 @@ const (
// The API used does not support the deployment.
ErrCodeOperationNotSupportedException = "OperationNotSupportedException"
// ErrCodeResourceArnRequiredException for service response error code
// "ResourceArnRequiredException".
//
// The ARN of a resource is required, but was not found.
ErrCodeResourceArnRequiredException = "ResourceArnRequiredException"
// ErrCodeResourceValidationException for service response error code
// "ResourceValidationException".
//
@@ -567,7 +654,7 @@ const (
// ErrCodeRevisionDoesNotExistException for service response error code
// "RevisionDoesNotExistException".
//
// The named revision does not exist with the applicable IAM user or AWS account.
// The named revision does not exist with the IAM user or AWS account.
ErrCodeRevisionDoesNotExistException = "RevisionDoesNotExistException"
// ErrCodeRevisionRequiredException for service response error code
+58
View File
@@ -0,0 +1,58 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// +build go1.10,integration
package codedeploy_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/codedeploy"
)
var _ aws.Config
var _ awserr.Error
var _ request.Request
func TestInteg_00_ListApplications(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-west-2")
svc := codedeploy.New(sess)
params := &codedeploy.ListApplicationsInput{}
_, err := svc.ListApplicationsWithContext(ctx, params)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestInteg_01_GetDeployment(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-west-2")
svc := codedeploy.New(sess)
params := &codedeploy.GetDeploymentInput{
DeploymentId: aws.String("d-USUAELQEX"),
}
_, err := svc.GetDeploymentWithContext(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
View File
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "codedeploy" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "codedeploy" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "CodeDeploy" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the CodeDeploy 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,