diff --git a/.changelog/0b4e24e69ff34ce482797da344bef773.json b/.changelog/0b4e24e69ff34ce482797da344bef773.json new file mode 100644 index 00000000000..cec0ec76ff1 --- /dev/null +++ b/.changelog/0b4e24e69ff34ce482797da344bef773.json @@ -0,0 +1,8 @@ +{ + "id": "0b4e24e6-9ff3-4ce4-8279-7da344bef773", + "type": "feature", + "description": "This release adds support for including ApproximateCreationDateTimePrecision configurations in EnableKinesisStreamingDestination API, adds the same as an optional field in the response of DescribeKinesisStreamingDestination, and adds support for a new UpdateKinesisStreamingDestination API.", + "modules": [ + "service/dynamodb" + ] +} \ No newline at end of file diff --git a/.changelog/1471423c674a4fe48f4cdb031ef88aa2.json b/.changelog/1471423c674a4fe48f4cdb031ef88aa2.json new file mode 100644 index 00000000000..93604aa8cd0 --- /dev/null +++ b/.changelog/1471423c674a4fe48f4cdb031ef88aa2.json @@ -0,0 +1,8 @@ +{ + "id": "1471423c-674a-4fe4-8f4c-db031ef88aa2", + "type": "feature", + "description": "Introducing new NotebookS3LocationUri parameter to Athena ImportNotebook API. Payload is no longer required and either Payload or NotebookS3LocationUri needs to be provided (not both) for a successful ImportNotebook API call. If both are provided, an InvalidRequestException will be thrown.", + "modules": [ + "service/athena" + ] +} \ No newline at end of file diff --git a/.changelog/2b66a07b53c04b51a37883358bc75caf.json b/.changelog/2b66a07b53c04b51a37883358bc75caf.json new file mode 100644 index 00000000000..554b6d991ce --- /dev/null +++ b/.changelog/2b66a07b53c04b51a37883358bc75caf.json @@ -0,0 +1,8 @@ +{ + "id": "2b66a07b-53c0-4b51-a378-83358bc75caf", + "type": "feature", + "description": "Increased Quick Response name max length to 100", + "modules": [ + "service/qconnect" + ] +} \ No newline at end of file diff --git a/.changelog/fcbea51f145e45a1823a78e1c0b697e3.json b/.changelog/fcbea51f145e45a1823a78e1c0b697e3.json new file mode 100644 index 00000000000..91724e1795a --- /dev/null +++ b/.changelog/fcbea51f145e45a1823a78e1c0b697e3.json @@ -0,0 +1,8 @@ +{ + "id": "fcbea51f-145e-45a1-823a-78e1c0b697e3", + "type": "feature", + "description": "Release CodeBuild Reserved Capacity feature", + "modules": [ + "service/codebuild" + ] +} \ No newline at end of file diff --git a/service/appsync/internal/endpoints/endpoints.go b/service/appsync/internal/endpoints/endpoints.go index c6bbd423c16..b0d2f67a46d 100644 --- a/service/appsync/internal/endpoints/endpoints.go +++ b/service/appsync/internal/endpoints/endpoints.go @@ -169,6 +169,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, @@ -196,6 +199,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, diff --git a/service/athena/api_op_ImportNotebook.go b/service/athena/api_op_ImportNotebook.go index f3e559ecbcc..d65f954f043 100644 --- a/service/athena/api_op_ImportNotebook.go +++ b/service/athena/api_op_ImportNotebook.go @@ -12,9 +12,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Imports a single ipynb file to a Spark enabled workgroup. The maximum file size -// that can be imported is 10 megabytes. If an ipynb file with the same name -// already exists in the workgroup, throws an error. +// Imports a single ipynb file to a Spark enabled workgroup. To import the +// notebook, the request must specify a value for either Payload or +// NoteBookS3LocationUri . If neither is specified or both are specified, an +// InvalidRequestException occurs. The maximum file size that can be imported is 10 +// megabytes. If an ipynb file with the same name already exists in the workgroup, +// throws an error. func (c *Client) ImportNotebook(ctx context.Context, params *ImportNotebookInput, optFns ...func(*Options)) (*ImportNotebookOutput, error) { if params == nil { params = &ImportNotebookInput{} @@ -37,11 +40,6 @@ type ImportNotebookInput struct { // This member is required. Name *string - // The notebook content to be imported. - // - // This member is required. - Payload *string - // The notebook content type. Currently, the only valid type is IPYNB . // // This member is required. @@ -60,6 +58,12 @@ type ImportNotebookInput struct { // the action will fail. ClientRequestToken *string + // A URI that specifies the Amazon S3 location of a notebook file in ipynb format. + NotebookS3LocationUri *string + + // The notebook content to be imported. The payload must be in ipynb format. + Payload *string + noSmithyDocumentSerde } diff --git a/service/athena/serializers.go b/service/athena/serializers.go index 12125b5a5cf..fce70ee8c39 100644 --- a/service/athena/serializers.go +++ b/service/athena/serializers.go @@ -4937,6 +4937,11 @@ func awsAwsjson11_serializeOpDocumentImportNotebookInput(v *ImportNotebookInput, ok.String(*v.Name) } + if v.NotebookS3LocationUri != nil { + ok := object.Key("NotebookS3LocationUri") + ok.String(*v.NotebookS3LocationUri) + } + if v.Payload != nil { ok := object.Key("Payload") ok.String(*v.Payload) diff --git a/service/athena/types/types.go b/service/athena/types/types.go index 514fcd86915..33cf4c64087 100644 --- a/service/athena/types/types.go +++ b/service/athena/types/types.go @@ -1399,8 +1399,9 @@ type WorkGroupConfiguration struct { EngineVersion *EngineVersion // The ARN of the execution role used to access user resources for Spark sessions - // and Identity Center enabled workgroups. This property applies only to Spark - // enabled workgroups and Identity Center enabled workgroups. + // and IAM Identity Center enabled workgroups. This property applies only to Spark + // enabled workgroups and IAM Identity Center enabled workgroups. The property is + // required for IAM Identity Center enabled workgroups. ExecutionRole *string // Specifies whether the workgroup is IAM Identity Center supported. diff --git a/service/athena/validators.go b/service/athena/validators.go index ffda1ba6a2b..4cc784b29d0 100644 --- a/service/athena/validators.go +++ b/service/athena/validators.go @@ -2259,9 +2259,6 @@ func validateOpImportNotebookInput(v *ImportNotebookInput) error { if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } - if v.Payload == nil { - invalidParams.Add(smithy.NewErrParamRequired("Payload")) - } if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } diff --git a/service/codebuild/api_op_BatchGetFleets.go b/service/codebuild/api_op_BatchGetFleets.go new file mode 100644 index 00000000000..1383cea3804 --- /dev/null +++ b/service/codebuild/api_op_BatchGetFleets.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codebuild + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/codebuild/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about one or more compute fleets. +func (c *Client) BatchGetFleets(ctx context.Context, params *BatchGetFleetsInput, optFns ...func(*Options)) (*BatchGetFleetsOutput, error) { + if params == nil { + params = &BatchGetFleetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetFleets", params, optFns, c.addOperationBatchGetFleetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetFleetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetFleetsInput struct { + + // The names or ARNs of the compute fleets. + // + // This member is required. + Names []string + + noSmithyDocumentSerde +} + +type BatchGetFleetsOutput struct { + + // Information about the requested compute fleets. + Fleets []types.Fleet + + // The names of compute fleets for which information could not be found. + FleetsNotFound []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchGetFleets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchGetFleets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchGetFleets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpBatchGetFleetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetFleets(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchGetFleets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchGetFleets", + } +} diff --git a/service/codebuild/api_op_CreateFleet.go b/service/codebuild/api_op_CreateFleet.go new file mode 100644 index 00000000000..7a92431c14f --- /dev/null +++ b/service/codebuild/api_op_CreateFleet.go @@ -0,0 +1,207 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codebuild + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/codebuild/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a compute fleet. +func (c *Client) CreateFleet(ctx context.Context, params *CreateFleetInput, optFns ...func(*Options)) (*CreateFleetOutput, error) { + if params == nil { + params = &CreateFleetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateFleet", params, optFns, c.addOperationCreateFleetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateFleetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateFleetInput struct { + + // The initial number of machines allocated to the fleet, which defines the number + // of builds that can run in parallel. + // + // This member is required. + BaseCapacity *int32 + + // Information about the compute resources the compute fleet uses. Available + // values include: + // - BUILD_GENERAL1_SMALL : Use up to 3 GB memory and 2 vCPUs for builds. + // - BUILD_GENERAL1_MEDIUM : Use up to 7 GB memory and 4 vCPUs for builds. + // - BUILD_GENERAL1_LARGE : Use up to 16 GB memory and 8 vCPUs for builds, + // depending on your environment type. + // - BUILD_GENERAL1_XLARGE : Use up to 70 GB memory and 36 vCPUs for builds, + // depending on your environment type. + // - BUILD_GENERAL1_2XLARGE : Use up to 145 GB memory, 72 vCPUs, and 824 GB of + // SSD storage for builds. This compute type supports Docker images up to 100 GB + // uncompressed. + // If you use BUILD_GENERAL1_SMALL : + // - For environment type LINUX_CONTAINER , you can use up to 3 GB memory and 2 + // vCPUs for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GB memory, 4 + // vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + // - For environment type ARM_CONTAINER , you can use up to 4 GB memory and 2 + // vCPUs on ARM-based processors for builds. + // If you use BUILD_GENERAL1_LARGE : + // - For environment type LINUX_CONTAINER , you can use up to 15 GB memory and 8 + // vCPUs for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GB memory, + // 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. + // - For environment type ARM_CONTAINER , you can use up to 16 GB memory and 8 + // vCPUs on ARM-based processors for builds. + // For more information, see Build environment compute types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) + // in the CodeBuild User Guide. + // + // This member is required. + ComputeType types.ComputeType + + // The environment type of the compute fleet. + // - The environment type ARM_CONTAINER is available only in regions US East (N. + // Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific + // (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), + // EU (Frankfurt), and South America (São Paulo). + // - The environment type LINUX_CONTAINER is available only in regions US East + // (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), + // Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South + // America (São Paulo), and Asia Pacific (Mumbai). + // - The environment type LINUX_GPU_CONTAINER is available only in regions US + // East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU + // (Frankfurt), Asia Pacific (Tokyo), and Asia Pacific (Sydney). + // - The environment type WINDOWS_SERVER_2019_CONTAINER is available only in + // regions US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific + // (Sydney), Asia Pacific (Tokyo), Asia Pacific (Mumbai) and EU (Ireland). + // - The environment type WINDOWS_SERVER_2022_CONTAINER is available only in + // regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), + // EU (Frankfurt), Asia Pacific (Sydney), Asia Pacific (Singapore), Asia Pacific + // (Tokyo), South America (São Paulo) and Asia Pacific (Mumbai). + // For more information, see Build environment compute types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) + // in the CodeBuild user guide. + // + // This member is required. + EnvironmentType types.EnvironmentType + + // The name of the compute fleet. + // + // This member is required. + Name *string + + // The scaling configuration of the compute fleet. + ScalingConfiguration *types.ScalingConfigurationInput + + // A list of tag key and value pairs associated with this compute fleet. These + // tags are available for use by Amazon Web Services services that support + // CodeBuild build project tags. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateFleetOutput struct { + + // Information about the compute fleet + Fleet *types.Fleet + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateFleet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateFleet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateFleet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateFleetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFleet(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateFleet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateFleet", + } +} diff --git a/service/codebuild/api_op_DeleteFleet.go b/service/codebuild/api_op_DeleteFleet.go new file mode 100644 index 00000000000..7e2fe154f89 --- /dev/null +++ b/service/codebuild/api_op_DeleteFleet.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codebuild + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a compute fleet. When you delete a compute fleet, its builds are not +// deleted. +func (c *Client) DeleteFleet(ctx context.Context, params *DeleteFleetInput, optFns ...func(*Options)) (*DeleteFleetOutput, error) { + if params == nil { + params = &DeleteFleetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteFleet", params, optFns, c.addOperationDeleteFleetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteFleetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteFleetInput struct { + + // The ARN of the compute fleet. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type DeleteFleetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteFleet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteFleet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteFleet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteFleetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFleet(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteFleet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteFleet", + } +} diff --git a/service/codebuild/api_op_ListFleets.go b/service/codebuild/api_op_ListFleets.go new file mode 100644 index 00000000000..b5885ffc52e --- /dev/null +++ b/service/codebuild/api_op_ListFleets.go @@ -0,0 +1,253 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codebuild + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/codebuild/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets a list of compute fleet names with each compute fleet name representing a +// single compute fleet. +func (c *Client) ListFleets(ctx context.Context, params *ListFleetsInput, optFns ...func(*Options)) (*ListFleetsOutput, error) { + if params == nil { + params = &ListFleetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFleets", params, optFns, c.addOperationListFleetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFleetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFleetsInput struct { + + // The maximum number of paginated compute fleets returned per response. Use + // nextToken to iterate pages in the list of returned compute fleets. + MaxResults *int32 + + // During a previous call, if there are more than 100 items in the list, only the + // first 100 items are returned, along with a unique string called a nextToken. To + // get the next batch of items in the list, call this operation again, adding the + // next token to the call. To get all of the items in the list, keep calling this + // operation with each subsequent next token that is returned, until no more next + // tokens are returned. + NextToken *string + + // The criterion to be used to list compute fleet names. Valid values include: + // - CREATED_TIME : List based on when each compute fleet was created. + // - LAST_MODIFIED_TIME : List based on when information about each compute fleet + // was last changed. + // - NAME : List based on each compute fleet's name. + // Use sortOrder to specify in what order to list the compute fleet names based on + // the preceding criteria. + SortBy types.FleetSortByType + + // The order in which to list compute fleets. Valid values include: + // - ASCENDING : List in ascending order. + // - DESCENDING : List in descending order. + // Use sortBy to specify the criterion to be used to list compute fleet names. + SortOrder types.SortOrderType + + noSmithyDocumentSerde +} + +type ListFleetsOutput struct { + + // The list of compute fleet names. + Fleets []string + + // If there are more than 100 items in the list, only the first 100 items are + // returned, along with a unique string called a nextToken. To get the next batch + // of items in the list, call this operation again, adding the next token to the + // call. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListFleets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListFleets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListFleets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFleets(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListFleetsAPIClient is a client that implements the ListFleets operation. +type ListFleetsAPIClient interface { + ListFleets(context.Context, *ListFleetsInput, ...func(*Options)) (*ListFleetsOutput, error) +} + +var _ ListFleetsAPIClient = (*Client)(nil) + +// ListFleetsPaginatorOptions is the paginator options for ListFleets +type ListFleetsPaginatorOptions struct { + // The maximum number of paginated compute fleets returned per response. Use + // nextToken to iterate pages in the list of returned compute fleets. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListFleetsPaginator is a paginator for ListFleets +type ListFleetsPaginator struct { + options ListFleetsPaginatorOptions + client ListFleetsAPIClient + params *ListFleetsInput + nextToken *string + firstPage bool +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + if params == nil { + params = &ListFleetsInput{} + } + + options := ListFleetsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFleetsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListFleets page. +func (p *ListFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListFleets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListFleets", + } +} diff --git a/service/codebuild/api_op_StartBuild.go b/service/codebuild/api_op_StartBuild.go index 4f579ef248f..d69872620a5 100644 --- a/service/codebuild/api_op_StartBuild.go +++ b/service/codebuild/api_op_StartBuild.go @@ -90,6 +90,10 @@ type StartBuildInput struct { // ones already defined in the build project. EnvironmentVariablesOverride []types.EnvironmentVariable + // A ProjectFleet object specified for this build that overrides the one defined + // in the build project. + FleetOverride *types.ProjectFleet + // The user-defined depth of history, with a minimum value of 0, that overrides, // for this build only, any previous depth of history defined in the build project. GitCloneDepthOverride *int32 diff --git a/service/codebuild/api_op_UpdateFleet.go b/service/codebuild/api_op_UpdateFleet.go new file mode 100644 index 00000000000..f49acdeaa8b --- /dev/null +++ b/service/codebuild/api_op_UpdateFleet.go @@ -0,0 +1,201 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codebuild + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/codebuild/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a compute fleet. +func (c *Client) UpdateFleet(ctx context.Context, params *UpdateFleetInput, optFns ...func(*Options)) (*UpdateFleetOutput, error) { + if params == nil { + params = &UpdateFleetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateFleet", params, optFns, c.addOperationUpdateFleetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateFleetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateFleetInput struct { + + // The ARN of the compute fleet. + // + // This member is required. + Arn *string + + // The initial number of machines allocated to the compute fleet, which defines the + // number of builds that can run in parallel. + BaseCapacity *int32 + + // Information about the compute resources the compute fleet uses. Available + // values include: + // - BUILD_GENERAL1_SMALL : Use up to 3 GB memory and 2 vCPUs for builds. + // - BUILD_GENERAL1_MEDIUM : Use up to 7 GB memory and 4 vCPUs for builds. + // - BUILD_GENERAL1_LARGE : Use up to 16 GB memory and 8 vCPUs for builds, + // depending on your environment type. + // - BUILD_GENERAL1_XLARGE : Use up to 70 GB memory and 36 vCPUs for builds, + // depending on your environment type. + // - BUILD_GENERAL1_2XLARGE : Use up to 145 GB memory, 72 vCPUs, and 824 GB of + // SSD storage for builds. This compute type supports Docker images up to 100 GB + // uncompressed. + // If you use BUILD_GENERAL1_SMALL : + // - For environment type LINUX_CONTAINER , you can use up to 3 GB memory and 2 + // vCPUs for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GB memory, 4 + // vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + // - For environment type ARM_CONTAINER , you can use up to 4 GB memory and 2 + // vCPUs on ARM-based processors for builds. + // If you use BUILD_GENERAL1_LARGE : + // - For environment type LINUX_CONTAINER , you can use up to 15 GB memory and 8 + // vCPUs for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GB memory, + // 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. + // - For environment type ARM_CONTAINER , you can use up to 16 GB memory and 8 + // vCPUs on ARM-based processors for builds. + // For more information, see Build environment compute types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) + // in the CodeBuild User Guide. + ComputeType types.ComputeType + + // The environment type of the compute fleet. + // - The environment type ARM_CONTAINER is available only in regions US East (N. + // Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific + // (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), + // EU (Frankfurt), and South America (São Paulo). + // - The environment type LINUX_CONTAINER is available only in regions US East + // (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), + // Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South + // America (São Paulo), and Asia Pacific (Mumbai). + // - The environment type LINUX_GPU_CONTAINER is available only in regions US + // East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU + // (Frankfurt), Asia Pacific (Tokyo), and Asia Pacific (Sydney). + // - The environment type WINDOWS_SERVER_2019_CONTAINER is available only in + // regions US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific + // (Sydney), Asia Pacific (Tokyo), Asia Pacific (Mumbai) and EU (Ireland). + // - The environment type WINDOWS_SERVER_2022_CONTAINER is available only in + // regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), + // EU (Frankfurt), Asia Pacific (Sydney), Asia Pacific (Singapore), Asia Pacific + // (Tokyo), South America (São Paulo) and Asia Pacific (Mumbai). + // For more information, see Build environment compute types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) + // in the CodeBuild user guide. + EnvironmentType types.EnvironmentType + + // The scaling configuration of the compute fleet. + ScalingConfiguration *types.ScalingConfigurationInput + + // A list of tag key and value pairs associated with this compute fleet. These + // tags are available for use by Amazon Web Services services that support + // CodeBuild build project tags. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type UpdateFleetOutput struct { + + // A Fleet object. + Fleet *types.Fleet + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateFleet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateFleet{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateFleet"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateFleetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFleet(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateFleet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateFleet", + } +} diff --git a/service/codebuild/deserializers.go b/service/codebuild/deserializers.go index 5c56ff86c92..a4b73e0fa16 100644 --- a/service/codebuild/deserializers.go +++ b/service/codebuild/deserializers.go @@ -353,6 +353,117 @@ func awsAwsjson11_deserializeOpErrorBatchGetBuilds(response *smithyhttp.Response } } +type awsAwsjson11_deserializeOpBatchGetFleets struct { +} + +func (*awsAwsjson11_deserializeOpBatchGetFleets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpBatchGetFleets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorBatchGetFleets(response, &metadata) + } + output := &BatchGetFleetsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentBatchGetFleetsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorBatchGetFleets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpBatchGetProjects struct { } @@ -686,6 +797,123 @@ func awsAwsjson11_deserializeOpErrorBatchGetReports(response *smithyhttp.Respons } } +type awsAwsjson11_deserializeOpCreateFleet struct { +} + +func (*awsAwsjson11_deserializeOpCreateFleet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorCreateFleet(response, &metadata) + } + output := &CreateFleetOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentCreateFleetOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorCreateFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccountLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorAccountLimitExceededException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateProject struct { } @@ -860,7 +1088,124 @@ func (m *awsAwsjson11_deserializeOpCreateReportGroup) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorCreateReportGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorCreateReportGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccountLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorAccountLimitExceededException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpCreateWebhook struct { +} + +func (*awsAwsjson11_deserializeOpCreateWebhook) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateWebhook) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorCreateWebhook(response, &metadata) + } + output := &CreateWebhookOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentCreateWebhookOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorCreateWebhook(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -901,15 +1246,18 @@ func awsAwsjson11_deserializeOpErrorCreateReportGroup(response *smithyhttp.Respo } switch { - case strings.EqualFold("AccountLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorAccountLimitExceededException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("OAuthProviderException", errorCode): + return awsAwsjson11_deserializeErrorOAuthProviderException(response, errorBody) + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -920,14 +1268,14 @@ func awsAwsjson11_deserializeOpErrorCreateReportGroup(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpCreateWebhook struct { +type awsAwsjson11_deserializeOpDeleteBuildBatch struct { } -func (*awsAwsjson11_deserializeOpCreateWebhook) ID() string { +func (*awsAwsjson11_deserializeOpDeleteBuildBatch) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpCreateWebhook) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteBuildBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -941,9 +1289,9 @@ func (m *awsAwsjson11_deserializeOpCreateWebhook) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateWebhook(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteBuildBatch(response, &metadata) } - output := &CreateWebhookOutput{} + output := &DeleteBuildBatchOutput{} out.Result = output var buff [1024]byte @@ -963,7 +1311,7 @@ func (m *awsAwsjson11_deserializeOpCreateWebhook) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentCreateWebhookOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteBuildBatchOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -977,7 +1325,7 @@ func (m *awsAwsjson11_deserializeOpCreateWebhook) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorCreateWebhook(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteBuildBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1021,15 +1369,6 @@ func awsAwsjson11_deserializeOpErrorCreateWebhook(response *smithyhttp.Response, case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("OAuthProviderException", errorCode): - return awsAwsjson11_deserializeErrorOAuthProviderException(response, errorBody) - - case strings.EqualFold("ResourceAlreadyExistsException", errorCode): - return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1040,14 +1379,14 @@ func awsAwsjson11_deserializeOpErrorCreateWebhook(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpDeleteBuildBatch struct { +type awsAwsjson11_deserializeOpDeleteFleet struct { } -func (*awsAwsjson11_deserializeOpDeleteBuildBatch) ID() string { +func (*awsAwsjson11_deserializeOpDeleteFleet) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteBuildBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1061,9 +1400,9 @@ func (m *awsAwsjson11_deserializeOpDeleteBuildBatch) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteBuildBatch(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteFleet(response, &metadata) } - output := &DeleteBuildBatchOutput{} + output := &DeleteFleetOutput{} out.Result = output var buff [1024]byte @@ -1083,7 +1422,7 @@ func (m *awsAwsjson11_deserializeOpDeleteBuildBatch) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteBuildBatchOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteFleetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1097,7 +1436,7 @@ func (m *awsAwsjson11_deserializeOpDeleteBuildBatch) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteBuildBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3068,6 +3407,117 @@ func awsAwsjson11_deserializeOpErrorListCuratedEnvironmentImages(response *smith } } +type awsAwsjson11_deserializeOpListFleets struct { +} + +func (*awsAwsjson11_deserializeOpListFleets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListFleets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListFleets(response, &metadata) + } + output := &ListFleetsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListFleetsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListFleets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListProjects struct { } @@ -4635,7 +5085,124 @@ func awsAwsjson11_deserializeOpErrorStopBuildBatch(response *smithyhttp.Response errorMessage = message } - switch { + switch { + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateFleet struct { +} + +func (*awsAwsjson11_deserializeOpUpdateFleet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateFleet(response, &metadata) + } + output := &UpdateFleetOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdateFleetOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccountLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorAccountLimitExceededException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) @@ -7829,27 +8396,327 @@ func awsAwsjson11_deserializeDocumentFilterGroups(v *[][]types.WebhookFilter, va return nil } - shape, ok := value.([]interface{}) + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv [][]types.WebhookFilter + if *v == nil { + cv = [][]types.WebhookFilter{} + } else { + cv = *v + } + + for _, value := range shape { + var col []types.WebhookFilter + if err := awsAwsjson11_deserializeDocumentFilterGroup(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFleet(v **types.Fleet, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Fleet + if *v == nil { + sv = &types.Fleet{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "baseCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected FleetCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BaseCapacity = ptr.Int32(int32(i64)) + } + + case "computeType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeType to be of type string, got %T instead", value) + } + sv.ComputeType = types.ComputeType(jtv) + } + + case "created": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Created = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "environmentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnvironmentType to be of type string, got %T instead", value) + } + sv.EnvironmentType = types.EnvironmentType(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastModified": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "scalingConfiguration": + if err := awsAwsjson11_deserializeDocumentScalingConfigurationOutput(&sv.ScalingConfiguration, value); err != nil { + return err + } + + case "status": + if err := awsAwsjson11_deserializeDocumentFleetStatus(&sv.Status, value); err != nil { + return err + } + + case "tags": + if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFleetArns(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFleetNames(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFleets(v *[]types.Fleet, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Fleet + if *v == nil { + cv = []types.Fleet{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Fleet + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFleet(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFleetStatus(v **types.FleetStatus, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv [][]types.WebhookFilter + var sv *types.FleetStatus if *v == nil { - cv = [][]types.WebhookFilter{} + sv = &types.FleetStatus{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col []types.WebhookFilter - if err := awsAwsjson11_deserializeDocumentFilterGroup(&col, value); err != nil { - return err - } - cv = append(cv, col) + for key, value := range shape { + switch key { + case "context": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetContextCode to be of type string, got %T instead", value) + } + sv.Context = types.FleetContextCode(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "statusCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetStatusCode to be of type string, got %T instead", value) + } + sv.StatusCode = types.FleetStatusCode(jtv) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } @@ -9017,6 +9884,11 @@ func awsAwsjson11_deserializeDocumentProjectEnvironment(v **types.ProjectEnviron return err } + case "fleet": + if err := awsAwsjson11_deserializeDocumentProjectFleet(&sv.Fleet, value); err != nil { + return err + } + case "image": if value != nil { jtv, ok := value.(string) @@ -9177,6 +10049,46 @@ func awsAwsjson11_deserializeDocumentProjectFileSystemLocations(v *[]types.Proje return nil } +func awsAwsjson11_deserializeDocumentProjectFleet(v **types.ProjectFleet, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ProjectFleet + if *v == nil { + sv = &types.ProjectFleet{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fleetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FleetArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentProjectNames(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10466,6 +11378,77 @@ func awsAwsjson11_deserializeDocumentS3ReportExportConfig(v **types.S3ReportExpo return nil } +func awsAwsjson11_deserializeDocumentScalingConfigurationOutput(v **types.ScalingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ScalingConfigurationOutput + if *v == nil { + sv = &types.ScalingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "desiredCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected FleetCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DesiredCapacity = ptr.Int32(int32(i64)) + } + + case "maxCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected FleetCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxCapacity = ptr.Int32(int32(i64)) + } + + case "scalingType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetScalingType to be of type string, got %T instead", value) + } + sv.ScalingType = types.FleetScalingType(jtv) + } + + case "targetTrackingScalingConfigs": + if err := awsAwsjson11_deserializeDocumentTargetTrackingScalingConfigurations(&sv.TargetTrackingScalingConfigs, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentSecurityGroupIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10595,9 +11578,128 @@ func awsAwsjson11_deserializeDocumentSourceCredentialsInfo(v **types.SourceCrede if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ServerType to be of type string, got %T instead", value) + return fmt.Errorf("expected ServerType to be of type string, got %T instead", value) + } + sv.ServerType = types.ServerType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSourceCredentialsInfos(v *[]types.SourceCredentialsInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.SourceCredentialsInfo + if *v == nil { + cv = []types.SourceCredentialsInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SourceCredentialsInfo + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSourceCredentialsInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentSubnets(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KeyInput to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValueInput to be of type string, got %T instead", value) } - sv.ServerType = types.ServerType(jtv) + sv.Value = ptr.String(jtv) } default: @@ -10609,7 +11711,7 @@ func awsAwsjson11_deserializeDocumentSourceCredentialsInfo(v **types.SourceCrede return nil } -func awsAwsjson11_deserializeDocumentSourceCredentialsInfos(v *[]types.SourceCredentialsInfo, value interface{}) error { +func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10622,17 +11724,17 @@ func awsAwsjson11_deserializeDocumentSourceCredentialsInfos(v *[]types.SourceCre return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.SourceCredentialsInfo + var cv []types.Tag if *v == nil { - cv = []types.SourceCredentialsInfo{} + cv = []types.Tag{} } else { cv = *v } for _, value := range shape { - var col types.SourceCredentialsInfo + var col types.Tag destAddr := &col - if err := awsAwsjson11_deserializeDocumentSourceCredentialsInfo(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr @@ -10643,43 +11745,7 @@ func awsAwsjson11_deserializeDocumentSourceCredentialsInfos(v *[]types.SourceCre return nil } -func awsAwsjson11_deserializeDocumentSubnets(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { +func awsAwsjson11_deserializeDocumentTargetTrackingScalingConfiguration(v **types.TargetTrackingScalingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10692,31 +11758,56 @@ func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Tag + var sv *types.TargetTrackingScalingConfiguration if *v == nil { - sv = &types.Tag{} + sv = &types.TargetTrackingScalingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "key": + case "metricType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KeyInput to be of type string, got %T instead", value) + return fmt.Errorf("expected FleetScalingMetricType to be of type string, got %T instead", value) } - sv.Key = ptr.String(jtv) + sv.MetricType = types.FleetScalingMetricType(jtv) } - case "value": + case "targetValue": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ValueInput to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TargetValue = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.TargetValue = ptr.Float64(f64) + + default: + return fmt.Errorf("expected WrapperDouble to be a JSON Number, got %T instead", value) + } - sv.Value = ptr.String(jtv) } default: @@ -10728,7 +11819,7 @@ func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error return nil } -func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { +func awsAwsjson11_deserializeDocumentTargetTrackingScalingConfigurations(v *[]types.TargetTrackingScalingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10741,17 +11832,17 @@ func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Tag + var cv []types.TargetTrackingScalingConfiguration if *v == nil { - cv = []types.Tag{} + cv = []types.TargetTrackingScalingConfiguration{} } else { cv = *v } for _, value := range shape { - var col types.Tag + var col types.TargetTrackingScalingConfiguration destAddr := &col - if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentTargetTrackingScalingConfiguration(&destAddr, value); err != nil { return err } col = *destAddr @@ -11300,6 +12391,47 @@ func awsAwsjson11_deserializeOpDocumentBatchGetBuildsOutput(v **BatchGetBuildsOu return nil } +func awsAwsjson11_deserializeOpDocumentBatchGetFleetsOutput(v **BatchGetFleetsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchGetFleetsOutput + if *v == nil { + sv = &BatchGetFleetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fleets": + if err := awsAwsjson11_deserializeDocumentFleets(&sv.Fleets, value); err != nil { + return err + } + + case "fleetsNotFound": + if err := awsAwsjson11_deserializeDocumentFleetNames(&sv.FleetsNotFound, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentBatchGetProjectsOutput(v **BatchGetProjectsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11423,6 +12555,42 @@ func awsAwsjson11_deserializeOpDocumentBatchGetReportsOutput(v **BatchGetReports return nil } +func awsAwsjson11_deserializeOpDocumentCreateFleetOutput(v **CreateFleetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateFleetOutput + if *v == nil { + sv = &CreateFleetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fleet": + if err := awsAwsjson11_deserializeDocumentFleet(&sv.Fleet, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateProjectOutput(v **CreateProjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11581,6 +12749,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteBuildBatchOutput(v **DeleteBuildBat return nil } +func awsAwsjson11_deserializeOpDocumentDeleteFleetOutput(v **DeleteFleetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteFleetOutput + if *v == nil { + sv = &DeleteFleetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteProjectOutput(v **DeleteProjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12234,6 +13433,51 @@ func awsAwsjson11_deserializeOpDocumentListCuratedEnvironmentImagesOutput(v **Li return nil } +func awsAwsjson11_deserializeOpDocumentListFleetsOutput(v **ListFleetsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListFleetsOutput + if *v == nil { + sv = &ListFleetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fleets": + if err := awsAwsjson11_deserializeDocumentFleetArns(&sv.Fleets, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListProjectsOutput(v **ListProjectsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12796,6 +14040,42 @@ func awsAwsjson11_deserializeOpDocumentStopBuildOutput(v **StopBuildOutput, valu return nil } +func awsAwsjson11_deserializeOpDocumentUpdateFleetOutput(v **UpdateFleetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateFleetOutput + if *v == nil { + sv = &UpdateFleetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fleet": + if err := awsAwsjson11_deserializeDocumentFleet(&sv.Fleet, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateProjectOutput(v **UpdateProjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/codebuild/generated.json b/service/codebuild/generated.json index 733a55b7ae7..09aef131932 100644 --- a/service/codebuild/generated.json +++ b/service/codebuild/generated.json @@ -12,13 +12,16 @@ "api_op_BatchDeleteBuilds.go", "api_op_BatchGetBuildBatches.go", "api_op_BatchGetBuilds.go", + "api_op_BatchGetFleets.go", "api_op_BatchGetProjects.go", "api_op_BatchGetReportGroups.go", "api_op_BatchGetReports.go", + "api_op_CreateFleet.go", "api_op_CreateProject.go", "api_op_CreateReportGroup.go", "api_op_CreateWebhook.go", "api_op_DeleteBuildBatch.go", + "api_op_DeleteFleet.go", "api_op_DeleteProject.go", "api_op_DeleteReport.go", "api_op_DeleteReportGroup.go", @@ -36,6 +39,7 @@ "api_op_ListBuilds.go", "api_op_ListBuildsForProject.go", "api_op_ListCuratedEnvironmentImages.go", + "api_op_ListFleets.go", "api_op_ListProjects.go", "api_op_ListReportGroups.go", "api_op_ListReports.go", @@ -50,6 +54,7 @@ "api_op_StartBuildBatch.go", "api_op_StopBuild.go", "api_op_StopBuildBatch.go", + "api_op_UpdateFleet.go", "api_op_UpdateProject.go", "api_op_UpdateProjectVisibility.go", "api_op_UpdateReportGroup.go", diff --git a/service/codebuild/serializers.go b/service/codebuild/serializers.go index a61fc509706..070bbe79844 100644 --- a/service/codebuild/serializers.go +++ b/service/codebuild/serializers.go @@ -181,6 +181,61 @@ func (m *awsAwsjson11_serializeOpBatchGetBuilds) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpBatchGetFleets struct { +} + +func (*awsAwsjson11_serializeOpBatchGetFleets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpBatchGetFleets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchGetFleetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeBuild_20161006.BatchGetFleets") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentBatchGetFleetsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpBatchGetProjects struct { } @@ -346,6 +401,61 @@ func (m *awsAwsjson11_serializeOpBatchGetReports) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateFleet struct { +} + +func (*awsAwsjson11_serializeOpCreateFleet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateFleetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeBuild_20161006.CreateFleet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateFleetInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCreateProject struct { } @@ -566,6 +676,61 @@ func (m *awsAwsjson11_serializeOpDeleteBuildBatch) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteFleet struct { +} + +func (*awsAwsjson11_serializeOpDeleteFleet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteFleetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeBuild_20161006.DeleteFleet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteFleetInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteProject struct { } @@ -1501,6 +1666,61 @@ func (m *awsAwsjson11_serializeOpListCuratedEnvironmentImages) HandleSerialize(c return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListFleets struct { +} + +func (*awsAwsjson11_serializeOpListFleets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListFleets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListFleetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeBuild_20161006.ListFleets") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListFleetsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListProjects struct { } @@ -2271,6 +2491,61 @@ func (m *awsAwsjson11_serializeOpStopBuildBatch) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateFleet struct { +} + +func (*awsAwsjson11_serializeOpUpdateFleet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateFleetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CodeBuild_20161006.UpdateFleet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateFleetInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpUpdateProject struct { } @@ -2657,6 +2932,17 @@ func awsAwsjson11_serializeDocumentFilterGroups(v [][]types.WebhookFilter, value return nil } +func awsAwsjson11_serializeDocumentFleetNames(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentGitSubmodulesConfig(v *types.GitSubmodulesConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2850,6 +3136,13 @@ func awsAwsjson11_serializeDocumentProjectEnvironment(v *types.ProjectEnvironmen } } + if v.Fleet != nil { + ok := object.Key("fleet") + if err := awsAwsjson11_serializeDocumentProjectFleet(v.Fleet, ok); err != nil { + return err + } + } + if v.Image != nil { ok := object.Key("image") ok.String(*v.Image) @@ -2925,6 +3218,18 @@ func awsAwsjson11_serializeDocumentProjectFileSystemLocations(v []types.ProjectF return nil } +func awsAwsjson11_serializeDocumentProjectFleet(v *types.ProjectFleet, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FleetArn != nil { + ok := object.Key("fleetArn") + ok.String(*v.FleetArn) + } + + return nil +} + func awsAwsjson11_serializeDocumentProjectNames(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3176,6 +3481,30 @@ func awsAwsjson11_serializeDocumentS3ReportExportConfig(v *types.S3ReportExportC return nil } +func awsAwsjson11_serializeDocumentScalingConfigurationInput(v *types.ScalingConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxCapacity != nil { + ok := object.Key("maxCapacity") + ok.Integer(*v.MaxCapacity) + } + + if len(v.ScalingType) > 0 { + ok := object.Key("scalingType") + ok.String(string(v.ScalingType)) + } + + if v.TargetTrackingScalingConfigs != nil { + ok := object.Key("targetTrackingScalingConfigs") + if err := awsAwsjson11_serializeDocumentTargetTrackingScalingConfigurations(v.TargetTrackingScalingConfigs, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentSecurityGroupIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3245,6 +3574,49 @@ func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value return nil } +func awsAwsjson11_serializeDocumentTargetTrackingScalingConfiguration(v *types.TargetTrackingScalingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.MetricType) > 0 { + ok := object.Key("metricType") + ok.String(string(v.MetricType)) + } + + if v.TargetValue != nil { + ok := object.Key("targetValue") + switch { + case math.IsNaN(*v.TargetValue): + ok.String("NaN") + + case math.IsInf(*v.TargetValue, 1): + ok.String("Infinity") + + case math.IsInf(*v.TargetValue, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.TargetValue) + + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentTargetTrackingScalingConfigurations(v []types.TargetTrackingScalingConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentTargetTrackingScalingConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentTestCaseFilter(v *types.TestCaseFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3352,6 +3724,20 @@ func awsAwsjson11_serializeOpDocumentBatchGetBuildsInput(v *BatchGetBuildsInput, return nil } +func awsAwsjson11_serializeOpDocumentBatchGetFleetsInput(v *BatchGetFleetsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Names != nil { + ok := object.Key("names") + if err := awsAwsjson11_serializeDocumentFleetNames(v.Names, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentBatchGetProjectsInput(v *BatchGetProjectsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3394,6 +3780,47 @@ func awsAwsjson11_serializeOpDocumentBatchGetReportsInput(v *BatchGetReportsInpu return nil } +func awsAwsjson11_serializeOpDocumentCreateFleetInput(v *CreateFleetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BaseCapacity != nil { + ok := object.Key("baseCapacity") + ok.Integer(*v.BaseCapacity) + } + + if len(v.ComputeType) > 0 { + ok := object.Key("computeType") + ok.String(string(v.ComputeType)) + } + + if len(v.EnvironmentType) > 0 { + ok := object.Key("environmentType") + ok.String(string(v.EnvironmentType)) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.ScalingConfiguration != nil { + ok := object.Key("scalingConfiguration") + if err := awsAwsjson11_serializeDocumentScalingConfigurationInput(v.ScalingConfiguration, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3602,6 +4029,18 @@ func awsAwsjson11_serializeOpDocumentDeleteBuildBatchInput(v *DeleteBuildBatchIn return nil } +func awsAwsjson11_serializeOpDocumentDeleteFleetInput(v *DeleteFleetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("arn") + ok.String(*v.Arn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteProjectInput(v *DeleteProjectInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3963,6 +4402,33 @@ func awsAwsjson11_serializeOpDocumentListCuratedEnvironmentImagesInput(v *ListCu return nil } +func awsAwsjson11_serializeOpDocumentListFleetsInput(v *ListFleetsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if len(v.SortBy) > 0 { + ok := object.Key("sortBy") + ok.String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListProjectsInput(v *ListProjectsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4438,6 +4904,13 @@ func awsAwsjson11_serializeOpDocumentStartBuildInput(v *StartBuildInput, value s } } + if v.FleetOverride != nil { + ok := object.Key("fleetOverride") + if err := awsAwsjson11_serializeDocumentProjectFleet(v.FleetOverride, ok); err != nil { + return err + } + } + if v.GitCloneDepthOverride != nil { ok := object.Key("gitCloneDepthOverride") ok.Integer(*v.GitCloneDepthOverride) @@ -4584,6 +5057,47 @@ func awsAwsjson11_serializeOpDocumentStopBuildInput(v *StopBuildInput, value smi return nil } +func awsAwsjson11_serializeOpDocumentUpdateFleetInput(v *UpdateFleetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("arn") + ok.String(*v.Arn) + } + + if v.BaseCapacity != nil { + ok := object.Key("baseCapacity") + ok.Integer(*v.BaseCapacity) + } + + if len(v.ComputeType) > 0 { + ok := object.Key("computeType") + ok.String(string(v.ComputeType)) + } + + if len(v.EnvironmentType) > 0 { + ok := object.Key("environmentType") + ok.String(string(v.EnvironmentType)) + } + + if v.ScalingConfiguration != nil { + ok := object.Key("scalingConfiguration") + if err := awsAwsjson11_serializeDocumentScalingConfigurationInput(v.ScalingConfiguration, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateProjectInput(v *UpdateProjectInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/codebuild/types/enums.go b/service/codebuild/types/enums.go index f80598db8c1..90c4b1fd35e 100644 --- a/service/codebuild/types/enums.go +++ b/service/codebuild/types/enums.go @@ -334,6 +334,104 @@ func (FileSystemType) Values() []FileSystemType { } } +type FleetContextCode string + +// Enum values for FleetContextCode +const ( + FleetContextCodeCreateFailed FleetContextCode = "CREATE_FAILED" + FleetContextCodeUpdateFailed FleetContextCode = "UPDATE_FAILED" +) + +// Values returns all known values for FleetContextCode. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (FleetContextCode) Values() []FleetContextCode { + return []FleetContextCode{ + "CREATE_FAILED", + "UPDATE_FAILED", + } +} + +type FleetScalingMetricType string + +// Enum values for FleetScalingMetricType +const ( + FleetScalingMetricTypeFleetUtilizationRate FleetScalingMetricType = "FLEET_UTILIZATION_RATE" +) + +// Values returns all known values for FleetScalingMetricType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (FleetScalingMetricType) Values() []FleetScalingMetricType { + return []FleetScalingMetricType{ + "FLEET_UTILIZATION_RATE", + } +} + +type FleetScalingType string + +// Enum values for FleetScalingType +const ( + FleetScalingTypeTargetTrackingScaling FleetScalingType = "TARGET_TRACKING_SCALING" +) + +// Values returns all known values for FleetScalingType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (FleetScalingType) Values() []FleetScalingType { + return []FleetScalingType{ + "TARGET_TRACKING_SCALING", + } +} + +type FleetSortByType string + +// Enum values for FleetSortByType +const ( + FleetSortByTypeName FleetSortByType = "NAME" + FleetSortByTypeCreatedTime FleetSortByType = "CREATED_TIME" + FleetSortByTypeLastModifiedTime FleetSortByType = "LAST_MODIFIED_TIME" +) + +// Values returns all known values for FleetSortByType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (FleetSortByType) Values() []FleetSortByType { + return []FleetSortByType{ + "NAME", + "CREATED_TIME", + "LAST_MODIFIED_TIME", + } +} + +type FleetStatusCode string + +// Enum values for FleetStatusCode +const ( + FleetStatusCodeCreating FleetStatusCode = "CREATING" + FleetStatusCodeUpdating FleetStatusCode = "UPDATING" + FleetStatusCodeRotating FleetStatusCode = "ROTATING" + FleetStatusCodeDeleting FleetStatusCode = "DELETING" + FleetStatusCodeCreateFailed FleetStatusCode = "CREATE_FAILED" + FleetStatusCodeUpdateRollbackFailed FleetStatusCode = "UPDATE_ROLLBACK_FAILED" + FleetStatusCodeActive FleetStatusCode = "ACTIVE" +) + +// Values returns all known values for FleetStatusCode. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (FleetStatusCode) Values() []FleetStatusCode { + return []FleetStatusCode{ + "CREATING", + "UPDATING", + "ROTATING", + "DELETING", + "CREATE_FAILED", + "UPDATE_ROLLBACK_FAILED", + "ACTIVE", + } +} + type ImagePullCredentialsType string // Enum values for ImagePullCredentialsType diff --git a/service/codebuild/types/types.go b/service/codebuild/types/types.go index beb53e84723..bce49ecf58f 100644 --- a/service/codebuild/types/types.go +++ b/service/codebuild/types/types.go @@ -734,6 +734,119 @@ type ExportedEnvironmentVariable struct { noSmithyDocumentSerde } +// A set of dedicated instances for your build environment. +type Fleet struct { + + // The ARN of the compute fleet. + Arn *string + + // The initial number of machines allocated to the compute fleet, which defines the + // number of builds that can run in parallel. + BaseCapacity *int32 + + // Information about the compute resources the compute fleet uses. Available + // values include: + // - BUILD_GENERAL1_SMALL : Use up to 3 GB memory and 2 vCPUs for builds. + // - BUILD_GENERAL1_MEDIUM : Use up to 7 GB memory and 4 vCPUs for builds. + // - BUILD_GENERAL1_LARGE : Use up to 16 GB memory and 8 vCPUs for builds, + // depending on your environment type. + // - BUILD_GENERAL1_XLARGE : Use up to 70 GB memory and 36 vCPUs for builds, + // depending on your environment type. + // - BUILD_GENERAL1_2XLARGE : Use up to 145 GB memory, 72 vCPUs, and 824 GB of + // SSD storage for builds. This compute type supports Docker images up to 100 GB + // uncompressed. + // If you use BUILD_GENERAL1_SMALL : + // - For environment type LINUX_CONTAINER , you can use up to 3 GB memory and 2 + // vCPUs for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GB memory, 4 + // vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + // - For environment type ARM_CONTAINER , you can use up to 4 GB memory and 2 + // vCPUs on ARM-based processors for builds. + // If you use BUILD_GENERAL1_LARGE : + // - For environment type LINUX_CONTAINER , you can use up to 15 GB memory and 8 + // vCPUs for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GB memory, + // 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. + // - For environment type ARM_CONTAINER , you can use up to 16 GB memory and 8 + // vCPUs on ARM-based processors for builds. + // For more information, see Build environment compute types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) + // in the CodeBuild User Guide. + ComputeType ComputeType + + // The time at which the compute fleet was created. + Created *time.Time + + // The environment type of the compute fleet. + // - The environment type ARM_CONTAINER is available only in regions US East (N. + // Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific + // (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), + // EU (Frankfurt), and South America (São Paulo). + // - The environment type LINUX_CONTAINER is available only in regions US East + // (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), + // Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South + // America (São Paulo), and Asia Pacific (Mumbai). + // - The environment type LINUX_GPU_CONTAINER is available only in regions US + // East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU + // (Frankfurt), Asia Pacific (Tokyo), and Asia Pacific (Sydney). + // - The environment type WINDOWS_SERVER_2019_CONTAINER is available only in + // regions US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific + // (Sydney), Asia Pacific (Tokyo), Asia Pacific (Mumbai) and EU (Ireland). + // - The environment type WINDOWS_SERVER_2022_CONTAINER is available only in + // regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), + // EU (Frankfurt), Asia Pacific (Sydney), Asia Pacific (Singapore), Asia Pacific + // (Tokyo), South America (São Paulo) and Asia Pacific (Mumbai). + // For more information, see Build environment compute types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) + // in the CodeBuild user guide. + EnvironmentType EnvironmentType + + // The ID of the compute fleet. + Id *string + + // The time at which the compute fleet was last modified. + LastModified *time.Time + + // The name of the compute fleet. + Name *string + + // The scaling configuration of the compute fleet. + ScalingConfiguration *ScalingConfigurationOutput + + // The status of the compute fleet. + Status *FleetStatus + + // A list of tag key and value pairs associated with this compute fleet. These + // tags are available for use by Amazon Web Services services that support + // CodeBuild build project tags. + Tags []Tag + + noSmithyDocumentSerde +} + +// The status of the compute fleet. +type FleetStatus struct { + + // Additional information about a compute fleet. Valid values include: + // - CREATE_FAILED : The compute fleet has failed to create. + // - UPDATE_FAILED : The compute fleet has failed to update. + Context FleetContextCode + + // A message associated with the status of a compute fleet. + Message *string + + // The status code of the compute fleet. Valid values include: + // - CREATING : The compute fleet is being created. + // - UPDATING : The compute fleet is being updated. + // - ROTATING : The compute fleet is being rotated. + // - DELETING : The compute fleet is being deleted. + // - CREATE_FAILED : The compute fleet has failed to create. + // - UPDATE_ROLLBACK_FAILED : The compute fleet has failed to update and could + // not rollback to previous state. + // - ACTIVE : The compute fleet has succeeded and is active. + StatusCode FleetStatusCode + + noSmithyDocumentSerde +} + // Information about the Git submodules configuration for an CodeBuild build // project. type GitSubmodulesConfig struct { @@ -1209,7 +1322,8 @@ type ProjectEnvironment struct { // 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. // - For environment type ARM_CONTAINER , you can use up to 16 GB memory and 8 // vCPUs on ARM-based processors for builds. - // For more information, see Build Environment Compute Types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) + // If you're using compute fleets during project creation, computeType will be + // ignored. For more information, see Build Environment Compute Types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) // in the CodeBuild User Guide. // // This member is required. @@ -1232,11 +1346,11 @@ type ProjectEnvironment struct { // - The environment type ARM_CONTAINER is available only in regions US East (N. // Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific // (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and EU (Frankfurt). - // - The environment type LINUX_CONTAINER with compute type - // build.general1.2xlarge is available only in regions US East (N. Virginia), US - // East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), EU (London), EU - // (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific - // (Singapore), Asia Pacific (Sydney), China (Beijing), and China (Ningxia). + // - The environment type LINUX_CONTAINER is available only in regions US East + // (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), + // EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia + // Pacific (Singapore), Asia Pacific (Sydney), China (Beijing), and China + // (Ningxia). // - The environment type LINUX_GPU_CONTAINER is available only in regions US // East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU // (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific @@ -1252,6 +1366,7 @@ type ProjectEnvironment struct { // - The environment types WINDOWS_CONTAINER and WINDOWS_SERVER_2019_CONTAINER // are available only in regions US East (N. Virginia), US East (Ohio), US West // (Oregon), and EU (Ireland). + // If you're using compute fleets during project creation, type will be ignored. // For more information, see Build environment compute types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) // in the CodeBuild user guide. // @@ -1268,6 +1383,9 @@ type ProjectEnvironment struct { // project. EnvironmentVariables []EnvironmentVariable + // A ProjectFleet object to use for this build project. + Fleet *ProjectFleet + // The type of credentials CodeBuild uses to pull images in your build. There are // two valid values: // - CODEBUILD specifies that CodeBuild uses its own credentials. This requires @@ -1340,6 +1458,17 @@ type ProjectFileSystemLocation struct { noSmithyDocumentSerde } +// Information about the compute fleet of the build project. For more information, +// see Working with reserved capacity in CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/fleets.html) +// . +type ProjectFleet struct { + + // Specifies the compute fleet ARN for the build project. + FleetArn *string + + noSmithyDocumentSerde +} + // Information about the build input source code for the build project. type ProjectSource struct { @@ -1739,6 +1868,39 @@ type S3ReportExportConfig struct { noSmithyDocumentSerde } +// The scaling configuration input of a compute fleet. +type ScalingConfigurationInput struct { + + // The maximum number of instances in the fleet when auto-scaling. + MaxCapacity *int32 + + // The scaling type for a compute fleet. + ScalingType FleetScalingType + + // A list of TargetTrackingScalingConfiguration objects. + TargetTrackingScalingConfigs []TargetTrackingScalingConfiguration + + noSmithyDocumentSerde +} + +// The scaling configuration output of a compute fleet. +type ScalingConfigurationOutput struct { + + // The desired number of instances in the fleet when auto-scaling. + DesiredCapacity *int32 + + // The maximum number of instances in the fleet when auto-scaling. + MaxCapacity *int32 + + // The scaling type for a compute fleet. + ScalingType FleetScalingType + + // A list of TargetTrackingScalingConfiguration objects. + TargetTrackingScalingConfigs []TargetTrackingScalingConfiguration + + noSmithyDocumentSerde +} + // Information about the authorization settings for CodeBuild to access the source // code to be built. This information is for the CodeBuild console's use only. Your // code should not get or set this information directly. @@ -1788,6 +1950,18 @@ type Tag struct { noSmithyDocumentSerde } +// Defines when a new instance is auto-scaled into the compute fleet. +type TargetTrackingScalingConfiguration struct { + + // The metric type to determine auto-scaling. + MetricType FleetScalingMetricType + + // The value of metricType when to start scaling. + TargetValue *float64 + + noSmithyDocumentSerde +} + // Information about a test case created using a framework such as NUnit or // Cucumber. A test case might be a unit test or a configuration test. type TestCase struct { diff --git a/service/codebuild/validators.go b/service/codebuild/validators.go index ab76aa5d549..dc3662aefae 100644 --- a/service/codebuild/validators.go +++ b/service/codebuild/validators.go @@ -70,6 +70,26 @@ func (m *validateOpBatchGetBuilds) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpBatchGetFleets struct { +} + +func (*validateOpBatchGetFleets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchGetFleets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchGetFleetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchGetFleetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpBatchGetProjects struct { } @@ -130,6 +150,26 @@ func (m *validateOpBatchGetReports) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpCreateFleet struct { +} + +func (*validateOpCreateFleet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateFleetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateFleetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateProject struct { } @@ -210,6 +250,26 @@ func (m *validateOpDeleteBuildBatch) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpDeleteFleet struct { +} + +func (*validateOpDeleteFleet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteFleetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteFleetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteProject struct { } @@ -590,6 +650,26 @@ func (m *validateOpStopBuild) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpUpdateFleet struct { +} + +func (*validateOpUpdateFleet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateFleetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateFleetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateProject struct { } @@ -682,6 +762,10 @@ func addOpBatchGetBuildsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchGetBuilds{}, middleware.After) } +func addOpBatchGetFleetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchGetFleets{}, middleware.After) +} + func addOpBatchGetProjectsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchGetProjects{}, middleware.After) } @@ -694,6 +778,10 @@ func addOpBatchGetReportsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchGetReports{}, middleware.After) } +func addOpCreateFleetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateFleet{}, middleware.After) +} + func addOpCreateProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateProject{}, middleware.After) } @@ -710,6 +798,10 @@ func addOpDeleteBuildBatchValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteBuildBatch{}, middleware.After) } +func addOpDeleteFleetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteFleet{}, middleware.After) +} + func addOpDeleteProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteProject{}, middleware.After) } @@ -786,6 +878,10 @@ func addOpStopBuildValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopBuild{}, middleware.After) } +func addOpUpdateFleetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateFleet{}, middleware.After) +} + func addOpUpdateProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateProject{}, middleware.After) } @@ -1189,6 +1285,21 @@ func validateOpBatchGetBuildsInput(v *BatchGetBuildsInput) error { } } +func validateOpBatchGetFleetsInput(v *BatchGetFleetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchGetFleetsInput"} + if v.Names == nil { + invalidParams.Add(smithy.NewErrParamRequired("Names")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpBatchGetProjectsInput(v *BatchGetProjectsInput) error { if v == nil { return nil @@ -1234,6 +1345,30 @@ func validateOpBatchGetReportsInput(v *BatchGetReportsInput) error { } } +func validateOpCreateFleetInput(v *CreateFleetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateFleetInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.BaseCapacity == nil { + invalidParams.Add(smithy.NewErrParamRequired("BaseCapacity")) + } + if len(v.EnvironmentType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("EnvironmentType")) + } + if len(v.ComputeType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ComputeType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateProjectInput(v *CreateProjectInput) error { if v == nil { return nil @@ -1354,6 +1489,21 @@ func validateOpDeleteBuildBatchInput(v *DeleteBuildBatchInput) error { } } +func validateOpDeleteFleetInput(v *DeleteFleetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteFleetInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteProjectInput(v *DeleteProjectInput) error { if v == nil { return nil @@ -1751,6 +1901,21 @@ func validateOpStopBuildInput(v *StopBuildInput) error { } } +func validateOpUpdateFleetInput(v *UpdateFleetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateFleetInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateProjectInput(v *UpdateProjectInput) error { if v == nil { return nil diff --git a/service/dynamodb/api_op_DisableKinesisStreamingDestination.go b/service/dynamodb/api_op_DisableKinesisStreamingDestination.go index 81b43d04dfe..61f0972ee73 100644 --- a/service/dynamodb/api_op_DisableKinesisStreamingDestination.go +++ b/service/dynamodb/api_op_DisableKinesisStreamingDestination.go @@ -42,6 +42,9 @@ type DisableKinesisStreamingDestinationInput struct { // This member is required. TableName *string + // The source for the Kinesis streaming information that is being enabled. + EnableKinesisStreamingConfiguration *types.EnableKinesisStreamingConfiguration + noSmithyDocumentSerde } @@ -50,6 +53,9 @@ type DisableKinesisStreamingDestinationOutput struct { // The current status of the replication. DestinationStatus types.DestinationStatus + // The destination for the Kinesis streaming information that is being enabled. + EnableKinesisStreamingConfiguration *types.EnableKinesisStreamingConfiguration + // The ARN for the specific Kinesis data stream. StreamArn *string diff --git a/service/dynamodb/api_op_EnableKinesisStreamingDestination.go b/service/dynamodb/api_op_EnableKinesisStreamingDestination.go index 6eee7606b65..9532e9e42a7 100644 --- a/service/dynamodb/api_op_EnableKinesisStreamingDestination.go +++ b/service/dynamodb/api_op_EnableKinesisStreamingDestination.go @@ -44,6 +44,9 @@ type EnableKinesisStreamingDestinationInput struct { // This member is required. TableName *string + // The source for the Kinesis streaming information that is being enabled. + EnableKinesisStreamingConfiguration *types.EnableKinesisStreamingConfiguration + noSmithyDocumentSerde } @@ -52,6 +55,9 @@ type EnableKinesisStreamingDestinationOutput struct { // The current status of the replication. DestinationStatus types.DestinationStatus + // The destination for the Kinesis streaming information that is being enabled. + EnableKinesisStreamingConfiguration *types.EnableKinesisStreamingConfiguration + // The ARN for the specific Kinesis data stream. StreamArn *string diff --git a/service/dynamodb/api_op_UpdateKinesisStreamingDestination.go b/service/dynamodb/api_op_UpdateKinesisStreamingDestination.go new file mode 100644 index 00000000000..4c727233ec6 --- /dev/null +++ b/service/dynamodb/api_op_UpdateKinesisStreamingDestination.go @@ -0,0 +1,207 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dynamodb + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The command to update the Kinesis stream destination. +func (c *Client) UpdateKinesisStreamingDestination(ctx context.Context, params *UpdateKinesisStreamingDestinationInput, optFns ...func(*Options)) (*UpdateKinesisStreamingDestinationOutput, error) { + if params == nil { + params = &UpdateKinesisStreamingDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateKinesisStreamingDestination", params, optFns, c.addOperationUpdateKinesisStreamingDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateKinesisStreamingDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateKinesisStreamingDestinationInput struct { + + // The ARN for the Kinesis stream input. + // + // This member is required. + StreamArn *string + + // The table name for the Kinesis streaming destination input. + // + // This member is required. + TableName *string + + // The command to update the Kinesis stream configuration. + UpdateKinesisStreamingConfiguration *types.UpdateKinesisStreamingConfiguration + + noSmithyDocumentSerde +} + +type UpdateKinesisStreamingDestinationOutput struct { + + // The status of the attempt to update the Kinesis streaming destination output. + DestinationStatus types.DestinationStatus + + // The ARN for the Kinesis stream input. + StreamArn *string + + // The table name for the Kinesis streaming destination output. + TableName *string + + // The command to update the Kinesis streaming destination configuration. + UpdateKinesisStreamingConfiguration *types.UpdateKinesisStreamingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateKinesisStreamingDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateKinesisStreamingDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateKinesisStreamingDestination"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateKinesisStreamingDestinationDiscoverEndpointMiddleware(stack, options, c); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateKinesisStreamingDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateKinesisStreamingDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addValidateResponseChecksum(stack, options); err != nil { + return err + } + if err = addAcceptEncodingGzip(stack, options); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func addOpUpdateKinesisStreamingDestinationDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ + func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { + opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS + opt.Logger = o.Logger + }, + }, + DiscoverOperation: c.fetchOpUpdateKinesisStreamingDestinationDiscoverEndpoint, + EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, + EndpointDiscoveryRequired: false, + Region: o.Region, + }, "ResolveEndpointV2", middleware.After) +} + +func (c *Client) fetchOpUpdateKinesisStreamingDestinationDiscoverEndpoint(ctx context.Context, region string, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) + in, ok := input.(*UpdateKinesisStreamingDestinationInput) + if !ok { + return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) + } + _ = in + + identifierMap := make(map[string]string, 0) + identifierMap["sdk#Region"] = region + + key := fmt.Sprintf("DynamoDB.%v", identifierMap) + + if v, ok := c.endpointCache.Get(key); ok { + return v, nil + } + + discoveryOperationInput := &DescribeEndpointsInput{} + + opt := internalEndpointDiscovery.DiscoverEndpointOptions{} + for _, fn := range optFns { + fn(&opt) + } + + go c.handleEndpointDiscoveryFromService(ctx, discoveryOperationInput, region, key, opt) + return internalEndpointDiscovery.WeightedAddress{}, nil +} + +func newServiceMetadataMiddleware_opUpdateKinesisStreamingDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateKinesisStreamingDestination", + } +} diff --git a/service/dynamodb/api_op_UpdateTable.go b/service/dynamodb/api_op_UpdateTable.go index 190bd78d1b9..5ff1bd9e917 100644 --- a/service/dynamodb/api_op_UpdateTable.go +++ b/service/dynamodb/api_op_UpdateTable.go @@ -94,8 +94,9 @@ type UpdateTableInput struct { SSESpecification *types.SSESpecification // Represents the DynamoDB Streams configuration for the table. You receive a - // ValidationException if you try to enable a stream on a table that already has a - // stream, or if you try to disable a stream on a table that doesn't have a stream. + // ResourceInUseException if you try to enable a stream on a table that already has + // a stream, or if you try to disable a stream on a table that doesn't have a + // stream. StreamSpecification *types.StreamSpecification // The table class of the table to be updated. Valid values are STANDARD and diff --git a/service/dynamodb/deserializers.go b/service/dynamodb/deserializers.go index ccb22609a36..002ce8b9d6c 100644 --- a/service/dynamodb/deserializers.go +++ b/service/dynamodb/deserializers.go @@ -6023,6 +6023,129 @@ func awsAwsjson10_deserializeOpErrorUpdateItem(response *smithyhttp.Response, me } } +type awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination struct { +} + +func (*awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateKinesisStreamingDestination(response, &metadata) + } + output := &UpdateKinesisStreamingDestinationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentUpdateKinesisStreamingDestinationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateKinesisStreamingDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidEndpointException", errorCode): + return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpUpdateTable struct { } @@ -9661,6 +9784,46 @@ func awsAwsjson10_deserializeDocumentDuplicateItemException(v **types.DuplicateI return nil } +func awsAwsjson10_deserializeDocumentEnableKinesisStreamingConfiguration(v **types.EnableKinesisStreamingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EnableKinesisStreamingConfiguration + if *v == nil { + sv = &types.EnableKinesisStreamingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApproximateCreationDateTimePrecision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApproximateCreationDateTimePrecision to be of type string, got %T instead", value) + } + sv.ApproximateCreationDateTimePrecision = types.ApproximateCreationDateTimePrecision(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentEndpoint(v **types.Endpoint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12184,6 +12347,15 @@ func awsAwsjson10_deserializeDocumentKinesisDataStreamDestination(v **types.Kine for key, value := range shape { switch key { + case "ApproximateCreationDateTimePrecision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApproximateCreationDateTimePrecision to be of type string, got %T instead", value) + } + sv.ApproximateCreationDateTimePrecision = types.ApproximateCreationDateTimePrecision(jtv) + } + case "DestinationStatus": if value != nil { jtv, ok := value.(string) @@ -15487,6 +15659,46 @@ func awsAwsjson10_deserializeDocumentTransactionInProgressException(v **types.Tr return nil } +func awsAwsjson10_deserializeDocumentUpdateKinesisStreamingConfiguration(v **types.UpdateKinesisStreamingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UpdateKinesisStreamingConfiguration + if *v == nil { + sv = &types.UpdateKinesisStreamingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApproximateCreationDateTimePrecision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApproximateCreationDateTimePrecision to be of type string, got %T instead", value) + } + sv.ApproximateCreationDateTimePrecision = types.ApproximateCreationDateTimePrecision(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentWriteRequest(v **types.WriteRequest, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16533,6 +16745,11 @@ func awsAwsjson10_deserializeOpDocumentDisableKinesisStreamingDestinationOutput( sv.DestinationStatus = types.DestinationStatus(jtv) } + case "EnableKinesisStreamingConfiguration": + if err := awsAwsjson10_deserializeDocumentEnableKinesisStreamingConfiguration(&sv.EnableKinesisStreamingConfiguration, value); err != nil { + return err + } + case "StreamArn": if value != nil { jtv, ok := value.(string) @@ -16591,6 +16808,11 @@ func awsAwsjson10_deserializeOpDocumentEnableKinesisStreamingDestinationOutput(v sv.DestinationStatus = types.DestinationStatus(jtv) } + case "EnableKinesisStreamingConfiguration": + if err := awsAwsjson10_deserializeDocumentEnableKinesisStreamingConfiguration(&sv.EnableKinesisStreamingConfiguration, value); err != nil { + return err + } + case "StreamArn": if value != nil { jtv, ok := value.(string) @@ -17707,6 +17929,69 @@ func awsAwsjson10_deserializeOpDocumentUpdateItemOutput(v **UpdateItemOutput, va return nil } +func awsAwsjson10_deserializeOpDocumentUpdateKinesisStreamingDestinationOutput(v **UpdateKinesisStreamingDestinationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateKinesisStreamingDestinationOutput + if *v == nil { + sv = &UpdateKinesisStreamingDestinationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DestinationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationStatus to be of type string, got %T instead", value) + } + sv.DestinationStatus = types.DestinationStatus(jtv) + } + + case "StreamArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value) + } + sv.StreamArn = ptr.String(jtv) + } + + case "TableName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TableName to be of type string, got %T instead", value) + } + sv.TableName = ptr.String(jtv) + } + + case "UpdateKinesisStreamingConfiguration": + if err := awsAwsjson10_deserializeDocumentUpdateKinesisStreamingConfiguration(&sv.UpdateKinesisStreamingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentUpdateTableOutput(v **UpdateTableOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/dynamodb/generated.json b/service/dynamodb/generated.json index 7043e391d65..215c30f52ab 100644 --- a/service/dynamodb/generated.json +++ b/service/dynamodb/generated.json @@ -62,6 +62,7 @@ "api_op_UpdateGlobalTable.go", "api_op_UpdateGlobalTableSettings.go", "api_op_UpdateItem.go", + "api_op_UpdateKinesisStreamingDestination.go", "api_op_UpdateTable.go", "api_op_UpdateTableReplicaAutoScaling.go", "api_op_UpdateTimeToLive.go", diff --git a/service/dynamodb/serializers.go b/service/dynamodb/serializers.go index 0317bd60ff7..833253c9199 100644 --- a/service/dynamodb/serializers.go +++ b/service/dynamodb/serializers.go @@ -2767,6 +2767,61 @@ func (m *awsAwsjson10_serializeOpUpdateItem) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpUpdateKinesisStreamingDestination struct { +} + +func (*awsAwsjson10_serializeOpUpdateKinesisStreamingDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateKinesisStreamingDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateKinesisStreamingDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("DynamoDB_20120810.UpdateKinesisStreamingDestination") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateKinesisStreamingDestinationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpUpdateTable struct { } @@ -3515,6 +3570,18 @@ func awsAwsjson10_serializeDocumentDeleteRequest(v *types.DeleteRequest, value s return nil } +func awsAwsjson10_serializeDocumentEnableKinesisStreamingConfiguration(v *types.EnableKinesisStreamingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ApproximateCreationDateTimePrecision) > 0 { + ok := object.Key("ApproximateCreationDateTimePrecision") + ok.String(string(v.ApproximateCreationDateTimePrecision)) + } + + return nil +} + func awsAwsjson10_serializeDocumentExpectedAttributeMap(v map[string]types.ExpectedAttributeValue, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4843,6 +4910,18 @@ func awsAwsjson10_serializeDocumentUpdateGlobalSecondaryIndexAction(v *types.Upd return nil } +func awsAwsjson10_serializeDocumentUpdateKinesisStreamingConfiguration(v *types.UpdateKinesisStreamingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ApproximateCreationDateTimePrecision) > 0 { + ok := object.Key("ApproximateCreationDateTimePrecision") + ok.String(string(v.ApproximateCreationDateTimePrecision)) + } + + return nil +} + func awsAwsjson10_serializeDocumentUpdateReplicationGroupMemberAction(v *types.UpdateReplicationGroupMemberAction, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5343,6 +5422,13 @@ func awsAwsjson10_serializeOpDocumentDisableKinesisStreamingDestinationInput(v * object := value.Object() defer object.Close() + if v.EnableKinesisStreamingConfiguration != nil { + ok := object.Key("EnableKinesisStreamingConfiguration") + if err := awsAwsjson10_serializeDocumentEnableKinesisStreamingConfiguration(v.EnableKinesisStreamingConfiguration, ok); err != nil { + return err + } + } + if v.StreamArn != nil { ok := object.Key("StreamArn") ok.String(*v.StreamArn) @@ -5360,6 +5446,13 @@ func awsAwsjson10_serializeOpDocumentEnableKinesisStreamingDestinationInput(v *E object := value.Object() defer object.Close() + if v.EnableKinesisStreamingConfiguration != nil { + ok := object.Key("EnableKinesisStreamingConfiguration") + if err := awsAwsjson10_serializeDocumentEnableKinesisStreamingConfiguration(v.EnableKinesisStreamingConfiguration, ok); err != nil { + return err + } + } + if v.StreamArn != nil { ok := object.Key("StreamArn") ok.String(*v.StreamArn) @@ -6412,6 +6505,30 @@ func awsAwsjson10_serializeOpDocumentUpdateItemInput(v *UpdateItemInput, value s return nil } +func awsAwsjson10_serializeOpDocumentUpdateKinesisStreamingDestinationInput(v *UpdateKinesisStreamingDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StreamArn != nil { + ok := object.Key("StreamArn") + ok.String(*v.StreamArn) + } + + if v.TableName != nil { + ok := object.Key("TableName") + ok.String(*v.TableName) + } + + if v.UpdateKinesisStreamingConfiguration != nil { + ok := object.Key("UpdateKinesisStreamingConfiguration") + if err := awsAwsjson10_serializeDocumentUpdateKinesisStreamingConfiguration(v.UpdateKinesisStreamingConfiguration, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeOpDocumentUpdateTableInput(v *UpdateTableInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/dynamodb/types/enums.go b/service/dynamodb/types/enums.go index a603b3406ef..ec617f936bd 100644 --- a/service/dynamodb/types/enums.go +++ b/service/dynamodb/types/enums.go @@ -2,6 +2,25 @@ package types +type ApproximateCreationDateTimePrecision string + +// Enum values for ApproximateCreationDateTimePrecision +const ( + ApproximateCreationDateTimePrecisionMillisecond ApproximateCreationDateTimePrecision = "MILLISECOND" + ApproximateCreationDateTimePrecisionMicrosecond ApproximateCreationDateTimePrecision = "MICROSECOND" +) + +// Values returns all known values for ApproximateCreationDateTimePrecision. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (ApproximateCreationDateTimePrecision) Values() []ApproximateCreationDateTimePrecision { + return []ApproximateCreationDateTimePrecision{ + "MILLISECOND", + "MICROSECOND", + } +} + type AttributeAction string // Enum values for AttributeAction @@ -265,6 +284,7 @@ const ( DestinationStatusDisabling DestinationStatus = "DISABLING" DestinationStatusDisabled DestinationStatus = "DISABLED" DestinationStatusEnableFailed DestinationStatus = "ENABLE_FAILED" + DestinationStatusUpdating DestinationStatus = "UPDATING" ) // Values returns all known values for DestinationStatus. Note that this can be @@ -277,6 +297,7 @@ func (DestinationStatus) Values() []DestinationStatus { "DISABLING", "DISABLED", "ENABLE_FAILED", + "UPDATING", } } diff --git a/service/dynamodb/types/types.go b/service/dynamodb/types/types.go index 037de7ce4c0..ce38bd1f41d 100644 --- a/service/dynamodb/types/types.go +++ b/service/dynamodb/types/types.go @@ -975,6 +975,16 @@ type DeleteRequest struct { noSmithyDocumentSerde } +// Enables setting the configuration for Kinesis Streaming. +type EnableKinesisStreamingConfiguration struct { + + // Toggle for the precision of Kinesis data stream timestamp. The values are + // either MILLISECOND or MICROSECOND . + ApproximateCreationDateTimePrecision ApproximateCreationDateTimePrecision + + noSmithyDocumentSerde +} + // An endpoint information details. type Endpoint struct { @@ -1775,6 +1785,10 @@ type KeySchemaElement struct { // Describes a Kinesis data stream destination. type KinesisDataStreamDestination struct { + // The precision of the Kinesis data stream timestamp. The values are either + // MILLISECOND or MICROSECOND . + ApproximateCreationDateTimePrecision ApproximateCreationDateTimePrecision + // The current status of replication. DestinationStatus DestinationStatus @@ -1886,10 +1900,10 @@ type LocalSecondaryIndexInfo struct { noSmithyDocumentSerde } -// Represents a PartiQL statment that uses parameters. +// Represents a PartiQL statement that uses parameters. type ParameterizedStatement struct { - // A PartiQL statment that uses parameters. + // A PartiQL statement that uses parameters. // // This member is required. Statement *string @@ -3016,6 +3030,15 @@ type UpdateGlobalSecondaryIndexAction struct { noSmithyDocumentSerde } +// Enables updating the configuration for Kinesis Streaming. +type UpdateKinesisStreamingConfiguration struct { + + // Enables updating the precision of Kinesis data stream timestamp. + ApproximateCreationDateTimePrecision ApproximateCreationDateTimePrecision + + noSmithyDocumentSerde +} + // Represents a replica to be modified. type UpdateReplicationGroupMemberAction struct { diff --git a/service/dynamodb/validators.go b/service/dynamodb/validators.go index 1c76f46d976..4762e130283 100644 --- a/service/dynamodb/validators.go +++ b/service/dynamodb/validators.go @@ -850,6 +850,26 @@ func (m *validateOpUpdateItem) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpUpdateKinesisStreamingDestination struct { +} + +func (*validateOpUpdateKinesisStreamingDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateKinesisStreamingDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateKinesisStreamingDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateKinesisStreamingDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateTable struct { } @@ -1078,6 +1098,10 @@ func addOpUpdateItemValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateItem{}, middleware.After) } +func addOpUpdateKinesisStreamingDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateKinesisStreamingDestination{}, middleware.After) +} + func addOpUpdateTableValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateTable{}, middleware.After) } @@ -3231,6 +3255,24 @@ func validateOpUpdateItemInput(v *UpdateItemInput) error { } } +func validateOpUpdateKinesisStreamingDestinationInput(v *UpdateKinesisStreamingDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateKinesisStreamingDestinationInput"} + if v.TableName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TableName")) + } + if v.StreamArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("StreamArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateTableInput(v *UpdateTableInput) error { if v == nil { return nil diff --git a/service/ssoadmin/internal/endpoints/endpoints.go b/service/ssoadmin/internal/endpoints/endpoints.go index 0cc54bc2319..66ad76ddca6 100644 --- a/service/ssoadmin/internal/endpoints/endpoints.go +++ b/service/ssoadmin/internal/endpoints/endpoints.go @@ -193,6 +193,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "il-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{},