diff --git a/.changelog/3d28213bd3b7461684f8a4d9aff7fcac.json b/.changelog/3d28213bd3b7461684f8a4d9aff7fcac.json new file mode 100644 index 00000000000..45b9f402fa9 --- /dev/null +++ b/.changelog/3d28213bd3b7461684f8a4d9aff7fcac.json @@ -0,0 +1,8 @@ +{ + "id": "3d28213b-d3b7-4616-84f8-a4d9aff7fcac", + "type": "feature", + "description": "Add support for managed Contributor Insights Rules", + "modules": [ + "service/cloudwatch" + ] +} \ No newline at end of file diff --git a/.changelog/572de1e90cda43128f24bd2e9175cd88.json b/.changelog/572de1e90cda43128f24bd2e9175cd88.json new file mode 100644 index 00000000000..eef5617885d --- /dev/null +++ b/.changelog/572de1e90cda43128f24bd2e9175cd88.json @@ -0,0 +1,8 @@ +{ + "id": "572de1e9-0cda-4312-8f24-bd2e9175cd88", + "type": "feature", + "description": "This release adds support for VPN log options , a new feature allowing S2S VPN connections to send IKE activity logs to CloudWatch Logs", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/95b47ffe284043c8b82f292b4c4eaded.json b/.changelog/95b47ffe284043c8b82f292b4c4eaded.json new file mode 100644 index 00000000000..669e5dd1d6c --- /dev/null +++ b/.changelog/95b47ffe284043c8b82f292b4c4eaded.json @@ -0,0 +1,8 @@ +{ + "id": "95b47ffe-2840-43c8-b82f-292b4c4eaded", + "type": "feature", + "description": "Add TransitGatewayPeeringAttachmentId property to TransitGatewayPeering Model", + "modules": [ + "service/networkmanager" + ] +} \ No newline at end of file diff --git a/.changelog/ae06c8f1749a428e9b95ba184aaf0484.json b/.changelog/ae06c8f1749a428e9b95ba184aaf0484.json new file mode 100644 index 00000000000..61ec8b48b2a --- /dev/null +++ b/.changelog/ae06c8f1749a428e9b95ba184aaf0484.json @@ -0,0 +1,8 @@ +{ + "id": "ae06c8f1-749a-428e-9b95-ba184aaf0484", + "type": "feature", + "description": "This release adds support for importing data from S3 into a new DynamoDB table", + "modules": [ + "service/dynamodb" + ] +} \ No newline at end of file diff --git a/.changelog/c004f934212c4494adea1effef715b16.json b/.changelog/c004f934212c4494adea1effef715b16.json new file mode 100644 index 00000000000..a1c280059cd --- /dev/null +++ b/.changelog/c004f934212c4494adea1effef715b16.json @@ -0,0 +1,8 @@ +{ + "id": "c004f934-212c-4494-adea-1effef715b16", + "type": "feature", + "description": "The Amazon Chime SDK now supports live streaming of real-time video from the Amazon Chime SDK sessions to streaming platforms such as Amazon IVS and Amazon Elemental MediaLive. We have also added support for concatenation to create a single media capture file.", + "modules": [ + "service/chimesdkmediapipelines" + ] +} \ No newline at end of file diff --git a/.changelog/f8a60b2548b047b4835337e2fff22525.json b/.changelog/f8a60b2548b047b4835337e2fff22525.json new file mode 100644 index 00000000000..af77824499f --- /dev/null +++ b/.changelog/f8a60b2548b047b4835337e2fff22525.json @@ -0,0 +1,8 @@ +{ + "id": "f8a60b25-48b0-47b4-8353-37e2fff22525", + "type": "documentation", + "description": "This change is being made simply to fix the public documentation based on the models. We have included the PasswordChange and ResendCode events, along with the Pass, Fail and InProgress status. We have removed the Success and Failure status which are never returned by our APIs.", + "modules": [ + "service/cognitoidentityprovider" + ] +} \ No newline at end of file diff --git a/service/chimesdkmediapipelines/api_op_CreateMediaCapturePipeline.go b/service/chimesdkmediapipelines/api_op_CreateMediaCapturePipeline.go index ffad5e64781..2c6b655ea53 100644 --- a/service/chimesdkmediapipelines/api_op_CreateMediaCapturePipeline.go +++ b/service/chimesdkmediapipelines/api_op_CreateMediaCapturePipeline.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a media capture pipeline. +// Creates a media pipeline. func (c *Client) CreateMediaCapturePipeline(ctx context.Context, params *CreateMediaCapturePipelineInput, optFns ...func(*Options)) (*CreateMediaCapturePipelineOutput, error) { if params == nil { params = &CreateMediaCapturePipelineInput{} @@ -52,14 +52,15 @@ type CreateMediaCapturePipelineInput struct { // This member is required. SourceType types.MediaPipelineSourceType - // The configuration for a specified media capture pipeline. SourceType must be + // The configuration for a specified media pipeline. SourceType must be // ChimeSdkMeeting. ChimeSdkMeetingConfiguration *types.ChimeSdkMeetingConfiguration - // The token assigned to the client making the pipeline request. + // The unique identifier for the client request. The token makes the API request + // idempotent. Use a unique token for each media pipeline request. ClientRequestToken *string - // The list of tags. + // The tag key-value pairs. Tags []types.Tag noSmithyDocumentSerde @@ -67,8 +68,8 @@ type CreateMediaCapturePipelineInput struct { type CreateMediaCapturePipelineOutput struct { - // A media capture pipeline object, the ID, source type, source ARN, sink type, and - // sink ARN of a media capture pipeline object. + // A media pipeline object, the ID, source type, source ARN, sink type, and sink + // ARN of a media pipeline object. MediaCapturePipeline *types.MediaCapturePipeline // Metadata pertaining to the operation's result. diff --git a/service/chimesdkmediapipelines/api_op_CreateMediaConcatenationPipeline.go b/service/chimesdkmediapipelines/api_op_CreateMediaConcatenationPipeline.go new file mode 100644 index 00000000000..a0d75024b4c --- /dev/null +++ b/service/chimesdkmediapipelines/api_op_CreateMediaConcatenationPipeline.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkmediapipelines + +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/chimesdkmediapipelines/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a media concatenation pipeline. +func (c *Client) CreateMediaConcatenationPipeline(ctx context.Context, params *CreateMediaConcatenationPipelineInput, optFns ...func(*Options)) (*CreateMediaConcatenationPipelineOutput, error) { + if params == nil { + params = &CreateMediaConcatenationPipelineInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateMediaConcatenationPipeline", params, optFns, c.addOperationCreateMediaConcatenationPipelineMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateMediaConcatenationPipelineOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateMediaConcatenationPipelineInput struct { + + // An object that specifies the data sinks for the media concatenation pipeline. + // + // This member is required. + Sinks []types.ConcatenationSink + + // An object that specifies the sources for the media concatenation pipeline. + // + // This member is required. + Sources []types.ConcatenationSource + + // The unique identifier for the client request. The token makes the API request + // idempotent. Use a unique token for each media concatenation pipeline request. + ClientRequestToken *string + + // The tags associated with the media concatenation pipeline. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateMediaConcatenationPipelineOutput struct { + + // A media concatenation pipeline object, the ID, source type, MediaPipelineARN, + // and sink of a media concatenation pipeline object. + MediaConcatenationPipeline *types.MediaConcatenationPipeline + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateMediaConcatenationPipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateMediaConcatenationPipeline{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateMediaConcatenationPipeline{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateMediaConcatenationPipelineMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateMediaConcatenationPipelineValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMediaConcatenationPipeline(options.Region), middleware.Before); 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 + } + return nil +} + +type idempotencyToken_initializeOpCreateMediaConcatenationPipeline struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateMediaConcatenationPipeline) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateMediaConcatenationPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateMediaConcatenationPipelineInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateMediaConcatenationPipelineInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateMediaConcatenationPipelineMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateMediaConcatenationPipeline{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateMediaConcatenationPipeline(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "CreateMediaConcatenationPipeline", + } +} diff --git a/service/chimesdkmediapipelines/api_op_CreateMediaLiveConnectorPipeline.go b/service/chimesdkmediapipelines/api_op_CreateMediaLiveConnectorPipeline.go new file mode 100644 index 00000000000..58e8d400dfc --- /dev/null +++ b/service/chimesdkmediapipelines/api_op_CreateMediaLiveConnectorPipeline.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkmediapipelines + +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/chimesdkmediapipelines/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a streaming media pipeline in an Amazon Chime SDK meeting. +func (c *Client) CreateMediaLiveConnectorPipeline(ctx context.Context, params *CreateMediaLiveConnectorPipelineInput, optFns ...func(*Options)) (*CreateMediaLiveConnectorPipelineOutput, error) { + if params == nil { + params = &CreateMediaLiveConnectorPipelineInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateMediaLiveConnectorPipeline", params, optFns, c.addOperationCreateMediaLiveConnectorPipelineMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateMediaLiveConnectorPipelineOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateMediaLiveConnectorPipelineInput struct { + + // The media pipeline's data sinks. + // + // This member is required. + Sinks []types.LiveConnectorSinkConfiguration + + // The media pipeline's data sources. + // + // This member is required. + Sources []types.LiveConnectorSourceConfiguration + + // The token assigned to the client making the request. + ClientRequestToken *string + + // The tags associated with the media pipeline. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateMediaLiveConnectorPipelineOutput struct { + + // The new media pipeline. + MediaLiveConnectorPipeline *types.MediaLiveConnectorPipeline + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateMediaLiveConnectorPipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateMediaLiveConnectorPipeline{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateMediaLiveConnectorPipeline{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateMediaLiveConnectorPipelineMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateMediaLiveConnectorPipelineValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMediaLiveConnectorPipeline(options.Region), middleware.Before); 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 + } + return nil +} + +type idempotencyToken_initializeOpCreateMediaLiveConnectorPipeline struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateMediaLiveConnectorPipeline) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateMediaLiveConnectorPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateMediaLiveConnectorPipelineInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateMediaLiveConnectorPipelineInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateMediaLiveConnectorPipelineMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateMediaLiveConnectorPipeline{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateMediaLiveConnectorPipeline(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "CreateMediaLiveConnectorPipeline", + } +} diff --git a/service/chimesdkmediapipelines/api_op_DeleteMediaCapturePipeline.go b/service/chimesdkmediapipelines/api_op_DeleteMediaCapturePipeline.go index dab67d4083a..0908e2524cf 100644 --- a/service/chimesdkmediapipelines/api_op_DeleteMediaCapturePipeline.go +++ b/service/chimesdkmediapipelines/api_op_DeleteMediaCapturePipeline.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the media capture pipeline. +// Deletes the media pipeline. func (c *Client) DeleteMediaCapturePipeline(ctx context.Context, params *DeleteMediaCapturePipelineInput, optFns ...func(*Options)) (*DeleteMediaCapturePipelineOutput, error) { if params == nil { params = &DeleteMediaCapturePipelineInput{} @@ -28,7 +28,7 @@ func (c *Client) DeleteMediaCapturePipeline(ctx context.Context, params *DeleteM type DeleteMediaCapturePipelineInput struct { - // The ID of the media capture pipeline being deleted. + // The ID of the media pipeline being deleted. // // This member is required. MediaPipelineId *string diff --git a/service/chimesdkmediapipelines/api_op_DeleteMediaPipeline.go b/service/chimesdkmediapipelines/api_op_DeleteMediaPipeline.go new file mode 100644 index 00000000000..2b1608bbd85 --- /dev/null +++ b/service/chimesdkmediapipelines/api_op_DeleteMediaPipeline.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkmediapipelines + +import ( + "context" + 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 the media pipeline. +func (c *Client) DeleteMediaPipeline(ctx context.Context, params *DeleteMediaPipelineInput, optFns ...func(*Options)) (*DeleteMediaPipelineOutput, error) { + if params == nil { + params = &DeleteMediaPipelineInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteMediaPipeline", params, optFns, c.addOperationDeleteMediaPipelineMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteMediaPipelineOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteMediaPipelineInput struct { + + // The ID of the media pipeline to delete. + // + // This member is required. + MediaPipelineId *string + + noSmithyDocumentSerde +} + +type DeleteMediaPipelineOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteMediaPipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteMediaPipeline{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteMediaPipeline{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteMediaPipelineValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMediaPipeline(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteMediaPipeline(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteMediaPipeline", + } +} diff --git a/service/chimesdkmediapipelines/api_op_GetMediaCapturePipeline.go b/service/chimesdkmediapipelines/api_op_GetMediaCapturePipeline.go index c11ac9447bc..2266159bd28 100644 --- a/service/chimesdkmediapipelines/api_op_GetMediaCapturePipeline.go +++ b/service/chimesdkmediapipelines/api_op_GetMediaCapturePipeline.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets an existing media capture pipeline. +// Gets an existing media pipeline. func (c *Client) GetMediaCapturePipeline(ctx context.Context, params *GetMediaCapturePipelineInput, optFns ...func(*Options)) (*GetMediaCapturePipelineOutput, error) { if params == nil { params = &GetMediaCapturePipelineInput{} @@ -39,7 +39,7 @@ type GetMediaCapturePipelineInput struct { type GetMediaCapturePipelineOutput struct { - // The media capture pipeline object. + // The media pipeline object. MediaCapturePipeline *types.MediaCapturePipeline // Metadata pertaining to the operation's result. diff --git a/service/chimesdkmediapipelines/api_op_GetMediaPipeline.go b/service/chimesdkmediapipelines/api_op_GetMediaPipeline.go new file mode 100644 index 00000000000..a5fc8bbe73e --- /dev/null +++ b/service/chimesdkmediapipelines/api_op_GetMediaPipeline.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkmediapipelines + +import ( + "context" + 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/chimesdkmediapipelines/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets an existing media pipeline. +func (c *Client) GetMediaPipeline(ctx context.Context, params *GetMediaPipelineInput, optFns ...func(*Options)) (*GetMediaPipelineOutput, error) { + if params == nil { + params = &GetMediaPipelineInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetMediaPipeline", params, optFns, c.addOperationGetMediaPipelineMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetMediaPipelineOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetMediaPipelineInput struct { + + // The ID of the pipeline that you want to get. + // + // This member is required. + MediaPipelineId *string + + noSmithyDocumentSerde +} + +type GetMediaPipelineOutput struct { + + // The media pipeline object. + MediaPipeline *types.MediaPipeline + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetMediaPipelineMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMediaPipeline{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMediaPipeline{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetMediaPipelineValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMediaPipeline(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetMediaPipeline(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetMediaPipeline", + } +} diff --git a/service/chimesdkmediapipelines/api_op_ListMediaCapturePipelines.go b/service/chimesdkmediapipelines/api_op_ListMediaCapturePipelines.go index a1392924f4e..135907ff6a4 100644 --- a/service/chimesdkmediapipelines/api_op_ListMediaCapturePipelines.go +++ b/service/chimesdkmediapipelines/api_op_ListMediaCapturePipelines.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of media capture pipelines. +// Returns a list of media pipelines. func (c *Client) ListMediaCapturePipelines(ctx context.Context, params *ListMediaCapturePipelinesInput, optFns ...func(*Options)) (*ListMediaCapturePipelinesOutput, error) { if params == nil { params = &ListMediaCapturePipelinesInput{} @@ -41,7 +41,7 @@ type ListMediaCapturePipelinesInput struct { type ListMediaCapturePipelinesOutput struct { - // The media capture pipeline objects in the list. + // The media pipeline objects in the list. MediaCapturePipelines []types.MediaCapturePipelineSummary // The token used to retrieve the next page of results. diff --git a/service/chimesdkmediapipelines/api_op_ListMediaPipelines.go b/service/chimesdkmediapipelines/api_op_ListMediaPipelines.go new file mode 100644 index 00000000000..92fe2dec965 --- /dev/null +++ b/service/chimesdkmediapipelines/api_op_ListMediaPipelines.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkmediapipelines + +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/chimesdkmediapipelines/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of media pipelines. +func (c *Client) ListMediaPipelines(ctx context.Context, params *ListMediaPipelinesInput, optFns ...func(*Options)) (*ListMediaPipelinesOutput, error) { + if params == nil { + params = &ListMediaPipelinesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListMediaPipelines", params, optFns, c.addOperationListMediaPipelinesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListMediaPipelinesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListMediaPipelinesInput struct { + + // The maximum number of results to return in a single call. Valid Range: 1 - 99. + MaxResults *int32 + + // The token used to retrieve the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListMediaPipelinesOutput struct { + + // The media pipeline objects in the list. + MediaPipelines []types.MediaPipelineSummary + + // The token used to retrieve the next page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListMediaPipelinesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListMediaPipelines{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListMediaPipelines{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMediaPipelines(options.Region), middleware.Before); 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 + } + return nil +} + +// ListMediaPipelinesAPIClient is a client that implements the ListMediaPipelines +// operation. +type ListMediaPipelinesAPIClient interface { + ListMediaPipelines(context.Context, *ListMediaPipelinesInput, ...func(*Options)) (*ListMediaPipelinesOutput, error) +} + +var _ ListMediaPipelinesAPIClient = (*Client)(nil) + +// ListMediaPipelinesPaginatorOptions is the paginator options for +// ListMediaPipelines +type ListMediaPipelinesPaginatorOptions struct { + // The maximum number of results to return in a single call. Valid Range: 1 - 99. + 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 +} + +// ListMediaPipelinesPaginator is a paginator for ListMediaPipelines +type ListMediaPipelinesPaginator struct { + options ListMediaPipelinesPaginatorOptions + client ListMediaPipelinesAPIClient + params *ListMediaPipelinesInput + nextToken *string + firstPage bool +} + +// NewListMediaPipelinesPaginator returns a new ListMediaPipelinesPaginator +func NewListMediaPipelinesPaginator(client ListMediaPipelinesAPIClient, params *ListMediaPipelinesInput, optFns ...func(*ListMediaPipelinesPaginatorOptions)) *ListMediaPipelinesPaginator { + if params == nil { + params = &ListMediaPipelinesInput{} + } + + options := ListMediaPipelinesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListMediaPipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMediaPipelinesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListMediaPipelines page. +func (p *ListMediaPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMediaPipelinesOutput, 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.ListMediaPipelines(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_opListMediaPipelines(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListMediaPipelines", + } +} diff --git a/service/chimesdkmediapipelines/api_op_ListTagsForResource.go b/service/chimesdkmediapipelines/api_op_ListTagsForResource.go index 97763b42143..ce6f56fda5a 100644 --- a/service/chimesdkmediapipelines/api_op_ListTagsForResource.go +++ b/service/chimesdkmediapipelines/api_op_ListTagsForResource.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the tags applied to an Amazon Chime SDK media capture pipeline. +// Lists the tags available for a media pipeline. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} @@ -29,7 +29,8 @@ func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForRes type ListTagsForResourceInput struct { - // The resource ARN. + // The ARN of the media pipeline associated with any tags. The ARN consists of the + // pipeline's region, resource ID, and pipeline ID. // // This member is required. ResourceARN *string @@ -39,7 +40,7 @@ type ListTagsForResourceInput struct { type ListTagsForResourceOutput struct { - // The tag key-value pairs. + // The tags associated with the specified media pipeline. Tags []types.Tag // Metadata pertaining to the operation's result. diff --git a/service/chimesdkmediapipelines/api_op_TagResource.go b/service/chimesdkmediapipelines/api_op_TagResource.go index 15cc757b087..0dd64aad72a 100644 --- a/service/chimesdkmediapipelines/api_op_TagResource.go +++ b/service/chimesdkmediapipelines/api_op_TagResource.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Applies the specified tags to the specified Amazon Chime SDK media capture -// pipeline. +// The ARN of the media pipeline that you want to tag. Consists of he pipeline's +// endpoint region, resource ID, and pipeline ID. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} @@ -30,12 +30,13 @@ func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optF type TagResourceInput struct { - // The resource ARN. + // The ARN of the media pipeline associated with any tags. The ARN consists of the + // pipeline's endpoint region, resource ID, and pipeline ID. // // This member is required. ResourceARN *string - // The tag key-value pairs. + // The tags associated with the specified media pipeline. // // This member is required. Tags []types.Tag diff --git a/service/chimesdkmediapipelines/api_op_UntagResource.go b/service/chimesdkmediapipelines/api_op_UntagResource.go index 60c2bfad8ea..5c7582772e3 100644 --- a/service/chimesdkmediapipelines/api_op_UntagResource.go +++ b/service/chimesdkmediapipelines/api_op_UntagResource.go @@ -10,8 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes the specified tags from the specified Amazon Chime SDK media capture -// pipeline. +// Removes any tags from a media pipeline. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} @@ -29,12 +28,12 @@ func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, type UntagResourceInput struct { - // The resource ARN. + // The ARN of the pipeline that you want to untag. // // This member is required. ResourceARN *string - // The tag keys. + // The key/value pairs in the tag that you want to remove. // // This member is required. TagKeys []string diff --git a/service/chimesdkmediapipelines/deserializers.go b/service/chimesdkmediapipelines/deserializers.go index 369c4aae49b..6e4a7cbe0b8 100644 --- a/service/chimesdkmediapipelines/deserializers.go +++ b/service/chimesdkmediapipelines/deserializers.go @@ -185,121 +185,14 @@ func awsRestjson1_deserializeOpDocumentCreateMediaCapturePipelineOutput(v **Crea return nil } -type awsRestjson1_deserializeOpDeleteMediaCapturePipeline struct { -} - -func (*awsRestjson1_deserializeOpDeleteMediaCapturePipeline) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteMediaCapturePipeline) 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, awsRestjson1_deserializeOpErrorDeleteMediaCapturePipeline(response, &metadata) - } - output := &DeleteMediaCapturePipelineOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteMediaCapturePipeline(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 - - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - code, 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(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - - case strings.EqualFold("ForbiddenException", errorCode): - return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceFailureException", errorCode): - return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - case strings.EqualFold("ThrottledClientException", errorCode): - return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) - - case strings.EqualFold("UnauthorizedClientException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpGetMediaCapturePipeline struct { +type awsRestjson1_deserializeOpCreateMediaConcatenationPipeline struct { } -func (*awsRestjson1_deserializeOpGetMediaCapturePipeline) ID() string { +func (*awsRestjson1_deserializeOpCreateMediaConcatenationPipeline) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetMediaCapturePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateMediaConcatenationPipeline) 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) @@ -313,9 +206,9 @@ func (m *awsRestjson1_deserializeOpGetMediaCapturePipeline) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetMediaCapturePipeline(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateMediaConcatenationPipeline(response, &metadata) } - output := &GetMediaCapturePipelineOutput{} + output := &CreateMediaConcatenationPipelineOutput{} out.Result = output var buff [1024]byte @@ -336,7 +229,7 @@ func (m *awsRestjson1_deserializeOpGetMediaCapturePipeline) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetMediaCapturePipelineOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateMediaConcatenationPipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -349,7 +242,7 @@ func (m *awsRestjson1_deserializeOpGetMediaCapturePipeline) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetMediaCapturePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateMediaConcatenationPipeline(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)} @@ -396,8 +289,8 @@ func awsRestjson1_deserializeOpErrorGetMediaCapturePipeline(response *smithyhttp case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) @@ -421,7 +314,7 @@ func awsRestjson1_deserializeOpErrorGetMediaCapturePipeline(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentGetMediaCapturePipelineOutput(v **GetMediaCapturePipelineOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateMediaConcatenationPipelineOutput(v **CreateMediaConcatenationPipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -434,17 +327,17 @@ func awsRestjson1_deserializeOpDocumentGetMediaCapturePipelineOutput(v **GetMedi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetMediaCapturePipelineOutput + var sv *CreateMediaConcatenationPipelineOutput if *v == nil { - sv = &GetMediaCapturePipelineOutput{} + sv = &CreateMediaConcatenationPipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "MediaCapturePipeline": - if err := awsRestjson1_deserializeDocumentMediaCapturePipeline(&sv.MediaCapturePipeline, value); err != nil { + case "MediaConcatenationPipeline": + if err := awsRestjson1_deserializeDocumentMediaConcatenationPipeline(&sv.MediaConcatenationPipeline, value); err != nil { return err } @@ -457,14 +350,14 @@ func awsRestjson1_deserializeOpDocumentGetMediaCapturePipelineOutput(v **GetMedi return nil } -type awsRestjson1_deserializeOpListMediaCapturePipelines struct { +type awsRestjson1_deserializeOpCreateMediaLiveConnectorPipeline struct { } -func (*awsRestjson1_deserializeOpListMediaCapturePipelines) ID() string { +func (*awsRestjson1_deserializeOpCreateMediaLiveConnectorPipeline) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListMediaCapturePipelines) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateMediaLiveConnectorPipeline) 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) @@ -478,9 +371,9 @@ func (m *awsRestjson1_deserializeOpListMediaCapturePipelines) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListMediaCapturePipelines(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateMediaLiveConnectorPipeline(response, &metadata) } - output := &ListMediaCapturePipelinesOutput{} + output := &CreateMediaLiveConnectorPipelineOutput{} out.Result = output var buff [1024]byte @@ -501,7 +394,7 @@ func (m *awsRestjson1_deserializeOpListMediaCapturePipelines) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMediaCapturePipelinesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateMediaLiveConnectorPipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -514,7 +407,7 @@ func (m *awsRestjson1_deserializeOpListMediaCapturePipelines) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMediaCapturePipelines(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateMediaLiveConnectorPipeline(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)} @@ -586,7 +479,7 @@ func awsRestjson1_deserializeOpErrorListMediaCapturePipelines(response *smithyht } } -func awsRestjson1_deserializeOpDocumentListMediaCapturePipelinesOutput(v **ListMediaCapturePipelinesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateMediaLiveConnectorPipelineOutput(v **CreateMediaLiveConnectorPipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -599,29 +492,20 @@ func awsRestjson1_deserializeOpDocumentListMediaCapturePipelinesOutput(v **ListM return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMediaCapturePipelinesOutput + var sv *CreateMediaLiveConnectorPipelineOutput if *v == nil { - sv = &ListMediaCapturePipelinesOutput{} + sv = &CreateMediaLiveConnectorPipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "MediaCapturePipelines": - if err := awsRestjson1_deserializeDocumentMediaCapturePipelineSummaryList(&sv.MediaCapturePipelines, value); err != nil { + case "MediaLiveConnectorPipeline": + if err := awsRestjson1_deserializeDocumentMediaLiveConnectorPipeline(&sv.MediaLiveConnectorPipeline, 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 @@ -631,14 +515,14 @@ func awsRestjson1_deserializeOpDocumentListMediaCapturePipelinesOutput(v **ListM return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpDeleteMediaCapturePipeline struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpDeleteMediaCapturePipeline) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteMediaCapturePipeline) 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) @@ -652,43 +536,21 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteMediaCapturePipeline(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &DeleteMediaCapturePipelineOutput{} 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 = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteMediaCapturePipeline(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)} @@ -760,50 +622,14 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, 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 *ListTagsForResourceOutput - if *v == nil { - sv = &ListTagsForResourceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Tags": - if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpDeleteMediaPipeline struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpDeleteMediaPipeline) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteMediaPipeline) 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) @@ -817,15 +643,21 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteMediaPipeline(response, &metadata) } - output := &TagResourceOutput{} + output := &DeleteMediaPipelineOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteMediaPipeline(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)} @@ -897,14 +729,14 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +type awsRestjson1_deserializeOpGetMediaCapturePipeline struct { } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +func (*awsRestjson1_deserializeOpGetMediaCapturePipeline) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetMediaCapturePipeline) 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) @@ -918,26 +750,54 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetMediaCapturePipeline(response, &metadata) } - output := &UntagResourceOutput{} + output := &GetMediaCapturePipelineOutput{} out.Result = output - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUntagResource(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()) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) - errorCode := "UnknownError" - errorMessage := errorCode + body := io.TeeReader(response.Body, ringBuffer) - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { + 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 = awsRestjson1_deserializeOpDocumentGetMediaCapturePipelineOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetMediaCapturePipeline(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { errorCode = restjson.SanitizeErrorCode(code) } @@ -998,48 +858,73 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.BadRequestException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +func awsRestjson1_deserializeOpDocumentGetMediaCapturePipelineOutput(v **GetMediaCapturePipelineOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - body := io.TeeReader(errorBody, 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 err + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) + var sv *GetMediaCapturePipelineOutput + if *v == nil { + sv = &GetMediaCapturePipelineOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MediaCapturePipeline": + if err := awsRestjson1_deserializeDocumentMediaCapturePipeline(&sv.MediaCapturePipeline, value); err != nil { + return err + } + + default: + _, _ = key, value - 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 } + *v = sv + return nil +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpGetMediaPipeline struct { +} - return output +func (*awsRestjson1_deserializeOpGetMediaPipeline) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ForbiddenException{} +func (m *awsRestjson1_deserializeOpGetMediaPipeline) 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, awsRestjson1_deserializeOpErrorGetMediaPipeline(response, &metadata) + } + output := &GetMediaPipelineOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -1050,36 +935,45 @@ func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Respon Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentGetMediaPipelineOutput(&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), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NotFoundException{} +func awsRestjson1_deserializeOpErrorGetMediaPipeline(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1089,29 +983,113 @@ func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Respons return err } - err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - 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(), + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +func awsRestjson1_deserializeOpDocumentGetMediaPipelineOutput(v **GetMediaPipelineOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - return output + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetMediaPipelineOutput + if *v == nil { + sv = &GetMediaPipelineOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MediaPipeline": + if err := awsRestjson1_deserializeDocumentMediaPipeline(&sv.MediaPipeline, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func awsRestjson1_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceLimitExceededException{} +type awsRestjson1_deserializeOpListMediaCapturePipelines struct { +} + +func (*awsRestjson1_deserializeOpListMediaCapturePipelines) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListMediaCapturePipelines) 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, awsRestjson1_deserializeOpErrorListMediaCapturePipelines(response, &metadata) + } + output := &ListMediaCapturePipelinesOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -1122,11 +1100,44 @@ func awsRestjson1_deserializeErrorResourceLimitExceededException(response *smith Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentResourceLimitExceededException(&output, shape) + err = awsRestjson1_deserializeOpDocumentListMediaCapturePipelinesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListMediaCapturePipelines(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1138,20 +1149,170 @@ func awsRestjson1_deserializeErrorResourceLimitExceededException(response *smith } errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - return output + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -func awsRestjson1_deserializeErrorServiceFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceFailureException{} +func awsRestjson1_deserializeOpDocumentListMediaCapturePipelinesOutput(v **ListMediaCapturePipelinesOutput, 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 *ListMediaCapturePipelinesOutput + if *v == nil { + sv = &ListMediaCapturePipelinesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MediaCapturePipelines": + if err := awsRestjson1_deserializeDocumentMediaCapturePipelineSummaryList(&sv.MediaCapturePipelines, 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 +} + +type awsRestjson1_deserializeOpListMediaPipelines struct { +} + +func (*awsRestjson1_deserializeOpListMediaPipelines) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListMediaPipelines) 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, awsRestjson1_deserializeOpErrorListMediaPipelines(response, &metadata) + } + output := &ListMediaPipelinesOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + 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 = awsRestjson1_deserializeOpDocumentListMediaPipelinesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListMediaPipelines(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1161,132 +1322,1752 @@ func awsRestjson1_deserializeErrorServiceFailureException(response *smithyhttp.R return err } - err := awsRestjson1_deserializeDocumentServiceFailureException(&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 err + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListMediaPipelinesOutput(v **ListMediaPipelinesOutput, 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 *ListMediaPipelinesOutput + if *v == nil { + sv = &ListMediaPipelinesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MediaPipelines": + if err := awsRestjson1_deserializeDocumentMediaPipelineList(&sv.MediaPipelines, 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 +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) 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, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + 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 = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, 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 *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) 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, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) 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, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.BadRequestException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + err := awsRestjson1_deserializeDocumentBadRequestException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ForbiddenException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + err := awsRestjson1_deserializeDocumentForbiddenException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + err := awsRestjson1_deserializeDocumentNotFoundException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceLimitExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + err := awsRestjson1_deserializeDocumentResourceLimitExceededException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceFailureException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + err := awsRestjson1_deserializeDocumentServiceFailureException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceUnavailableException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + err := awsRestjson1_deserializeDocumentServiceUnavailableException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottledClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottledClientException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + err := awsRestjson1_deserializeDocumentThrottledClientException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorUnauthorizedClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnauthorizedClientException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + err := awsRestjson1_deserializeDocumentUnauthorizedClientException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentArtifactsConcatenationConfiguration(v **types.ArtifactsConcatenationConfiguration, 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.ArtifactsConcatenationConfiguration + if *v == nil { + sv = &types.ArtifactsConcatenationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Audio": + if err := awsRestjson1_deserializeDocumentAudioConcatenationConfiguration(&sv.Audio, value); err != nil { + return err + } + + case "CompositedVideo": + if err := awsRestjson1_deserializeDocumentCompositedVideoConcatenationConfiguration(&sv.CompositedVideo, value); err != nil { + return err + } + + case "Content": + if err := awsRestjson1_deserializeDocumentContentConcatenationConfiguration(&sv.Content, value); err != nil { + return err + } + + case "DataChannel": + if err := awsRestjson1_deserializeDocumentDataChannelConcatenationConfiguration(&sv.DataChannel, value); err != nil { + return err + } + + case "MeetingEvents": + if err := awsRestjson1_deserializeDocumentMeetingEventsConcatenationConfiguration(&sv.MeetingEvents, value); err != nil { + return err + } + + case "TranscriptionMessages": + if err := awsRestjson1_deserializeDocumentTranscriptionMessagesConcatenationConfiguration(&sv.TranscriptionMessages, value); err != nil { + return err + } + + case "Video": + if err := awsRestjson1_deserializeDocumentVideoConcatenationConfiguration(&sv.Video, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentArtifactsConfiguration(v **types.ArtifactsConfiguration, 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.ArtifactsConfiguration + if *v == nil { + sv = &types.ArtifactsConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Audio": + if err := awsRestjson1_deserializeDocumentAudioArtifactsConfiguration(&sv.Audio, value); err != nil { + return err + } + + case "CompositedVideo": + if err := awsRestjson1_deserializeDocumentCompositedVideoArtifactsConfiguration(&sv.CompositedVideo, value); err != nil { + return err + } + + case "Content": + if err := awsRestjson1_deserializeDocumentContentArtifactsConfiguration(&sv.Content, value); err != nil { + return err + } + + case "Video": + if err := awsRestjson1_deserializeDocumentVideoArtifactsConfiguration(&sv.Video, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAttendeeIdList(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 GuidString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAudioArtifactsConfiguration(v **types.AudioArtifactsConfiguration, 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.AudioArtifactsConfiguration + if *v == nil { + sv = &types.AudioArtifactsConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MuxType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AudioMuxType to be of type string, got %T instead", value) + } + sv.MuxType = types.AudioMuxType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAudioConcatenationConfiguration(v **types.AudioConcatenationConfiguration, 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.AudioConcatenationConfiguration + if *v == nil { + sv = &types.AudioConcatenationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AudioArtifactsConcatenationState to be of type string, got %T instead", value) + } + sv.State = types.AudioArtifactsConcatenationState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, 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.BadRequestException + if *v == nil { + sv = &types.BadRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(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 "RequestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentChimeSdkMeetingConcatenationConfiguration(v **types.ChimeSdkMeetingConcatenationConfiguration, 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.ChimeSdkMeetingConcatenationConfiguration + if *v == nil { + sv = &types.ChimeSdkMeetingConcatenationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ArtifactsConfiguration": + if err := awsRestjson1_deserializeDocumentArtifactsConcatenationConfiguration(&sv.ArtifactsConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentChimeSdkMeetingConfiguration(v **types.ChimeSdkMeetingConfiguration, 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.ChimeSdkMeetingConfiguration + if *v == nil { + sv = &types.ChimeSdkMeetingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ArtifactsConfiguration": + if err := awsRestjson1_deserializeDocumentArtifactsConfiguration(&sv.ArtifactsConfiguration, value); err != nil { + return err + } + + case "SourceConfiguration": + if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentChimeSdkMeetingLiveConnectorConfiguration(v **types.ChimeSdkMeetingLiveConnectorConfiguration, 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.ChimeSdkMeetingLiveConnectorConfiguration + if *v == nil { + sv = &types.ChimeSdkMeetingLiveConnectorConfiguration{} + } 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 Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CompositedVideo": + if err := awsRestjson1_deserializeDocumentCompositedVideoArtifactsConfiguration(&sv.CompositedVideo, value); err != nil { + return err + } + + case "MuxType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LiveConnectorMuxType to be of type string, got %T instead", value) + } + sv.MuxType = types.LiveConnectorMuxType(jtv) + } + + case "SourceConfiguration": + if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCompositedVideoArtifactsConfiguration(v **types.CompositedVideoArtifactsConfiguration, 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.CompositedVideoArtifactsConfiguration + if *v == nil { + sv = &types.CompositedVideoArtifactsConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "GridViewConfiguration": + if err := awsRestjson1_deserializeDocumentGridViewConfiguration(&sv.GridViewConfiguration, value); err != nil { + return err + } + + case "Layout": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutOption to be of type string, got %T instead", value) + } + sv.Layout = types.LayoutOption(jtv) + } + + case "Resolution": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResolutionOption to be of type string, got %T instead", value) + } + sv.Resolution = types.ResolutionOption(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCompositedVideoConcatenationConfiguration(v **types.CompositedVideoConcatenationConfiguration, 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.CompositedVideoConcatenationConfiguration + if *v == nil { + sv = &types.CompositedVideoConcatenationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) + } + sv.State = types.ArtifactsConcatenationState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConcatenationSink(v **types.ConcatenationSink, 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.ConcatenationSink + if *v == nil { + sv = &types.ConcatenationSink{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "S3BucketSinkConfiguration": + if err := awsRestjson1_deserializeDocumentS3BucketSinkConfiguration(&sv.S3BucketSinkConfiguration, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConcatenationSinkType to be of type string, got %T instead", value) + } + sv.Type = types.ConcatenationSinkType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConcatenationSinkList(v *[]types.ConcatenationSink, 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.ConcatenationSink + if *v == nil { + cv = []types.ConcatenationSink{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConcatenationSink + destAddr := &col + if err := awsRestjson1_deserializeDocumentConcatenationSink(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConcatenationSource(v **types.ConcatenationSource, 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.ConcatenationSource + if *v == nil { + sv = &types.ConcatenationSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MediaCapturePipelineSourceConfiguration": + if err := awsRestjson1_deserializeDocumentMediaCapturePipelineSourceConfiguration(&sv.MediaCapturePipelineSourceConfiguration, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConcatenationSourceType to be of type string, got %T instead", value) + } + sv.Type = types.ConcatenationSourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConcatenationSourceList(v *[]types.ConcatenationSource, 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.ConcatenationSource + if *v == nil { + cv = []types.ConcatenationSource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConcatenationSource + destAddr := &col + if err := awsRestjson1_deserializeDocumentConcatenationSource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentContentArtifactsConfiguration(v **types.ContentArtifactsConfiguration, 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.ContentArtifactsConfiguration + if *v == nil { + sv = &types.ContentArtifactsConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MuxType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContentMuxType to be of type string, got %T instead", value) + } + sv.MuxType = types.ContentMuxType(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactsState to be of type string, got %T instead", value) + } + sv.State = types.ArtifactsState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContentConcatenationConfiguration(v **types.ContentConcatenationConfiguration, 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.ContentConcatenationConfiguration + if *v == nil { + sv = &types.ContentConcatenationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) + } + sv.State = types.ArtifactsConcatenationState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDataChannelConcatenationConfiguration(v **types.DataChannelConcatenationConfiguration, 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.DataChannelConcatenationConfiguration + if *v == nil { + sv = &types.DataChannelConcatenationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) + } + sv.State = types.ArtifactsConcatenationState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentExternalUserIdList(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 ExternalUserIdType to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, 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.ForbiddenException + if *v == nil { + sv = &types.ForbiddenException{} + } else { + sv = *v } - errorBody.Seek(0, io.SeekStart) + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } - return output -} + 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) + } -func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceUnavailableException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "RequestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value - body := io.TeeReader(errorBody, 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 err + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGridViewConfiguration(v **types.GridViewConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - err := awsRestjson1_deserializeDocumentServiceUnavailableException(&output, shape) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - 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 + var sv *types.GridViewConfiguration + if *v == nil { + sv = &types.GridViewConfiguration{} + } else { + sv = *v } - errorBody.Seek(0, io.SeekStart) + for key, value := range shape { + switch key { + case "ContentShareLayout": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContentShareLayoutOption to be of type string, got %T instead", value) + } + sv.ContentShareLayout = types.ContentShareLayoutOption(jtv) + } - return output -} + case "PresenterOnlyConfiguration": + if err := awsRestjson1_deserializeDocumentPresenterOnlyConfiguration(&sv.PresenterOnlyConfiguration, value); err != nil { + return err + } -func awsRestjson1_deserializeErrorThrottledClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottledClientException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + default: + _, _ = key, value - body := io.TeeReader(errorBody, 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 err } + *v = sv + return nil +} - err := awsRestjson1_deserializeDocumentThrottledClientException(&output, shape) +func awsRestjson1_deserializeDocumentLiveConnectorRTMPConfiguration(v **types.LiveConnectorRTMPConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - 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 + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - errorBody.Seek(0, io.SeekStart) + var sv *types.LiveConnectorRTMPConfiguration + if *v == nil { + sv = &types.LiveConnectorRTMPConfiguration{} + } else { + sv = *v + } - return output -} + for key, value := range shape { + switch key { + case "AudioChannels": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AudioChannelsOption to be of type string, got %T instead", value) + } + sv.AudioChannels = types.AudioChannelsOption(jtv) + } -func awsRestjson1_deserializeErrorUnauthorizedClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.UnauthorizedClientException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "AudioSampleRate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AudioSampleRateOption to be of type string, got %T instead", value) + } + sv.AudioSampleRate = ptr.String(jtv) + } - body := io.TeeReader(errorBody, 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 err - } + case "Url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } - err := awsRestjson1_deserializeDocumentUnauthorizedClientException(&output, shape) + default: + _, _ = key, value - 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) - - return output + *v = sv + return nil } -func awsRestjson1_deserializeDocumentArtifactsConfiguration(v **types.ArtifactsConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentLiveConnectorSinkConfiguration(v **types.LiveConnectorSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1299,28 +3080,27 @@ func awsRestjson1_deserializeDocumentArtifactsConfiguration(v **types.ArtifactsC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ArtifactsConfiguration + var sv *types.LiveConnectorSinkConfiguration if *v == nil { - sv = &types.ArtifactsConfiguration{} + sv = &types.LiveConnectorSinkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "Audio": - if err := awsRestjson1_deserializeDocumentAudioArtifactsConfiguration(&sv.Audio, value); err != nil { + case "RTMPConfiguration": + if err := awsRestjson1_deserializeDocumentLiveConnectorRTMPConfiguration(&sv.RTMPConfiguration, value); err != nil { return err } - case "Content": - if err := awsRestjson1_deserializeDocumentContentArtifactsConfiguration(&sv.Content, value); err != nil { - return err - } - - case "Video": - if err := awsRestjson1_deserializeDocumentVideoArtifactsConfiguration(&sv.Video, value); err != nil { - return err + case "SinkType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LiveConnectorSinkType to be of type string, got %T instead", value) + } + sv.SinkType = types.LiveConnectorSinkType(jtv) } default: @@ -1332,7 +3112,7 @@ func awsRestjson1_deserializeDocumentArtifactsConfiguration(v **types.ArtifactsC return nil } -func awsRestjson1_deserializeDocumentAttendeeIdList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentLiveConnectorSinkList(v *[]types.LiveConnectorSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1345,22 +3125,20 @@ func awsRestjson1_deserializeDocumentAttendeeIdList(v *[]string, value interface return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.LiveConnectorSinkConfiguration if *v == nil { - cv = []string{} + cv = []types.LiveConnectorSinkConfiguration{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) - } - col = jtv + var col types.LiveConnectorSinkConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentLiveConnectorSinkConfiguration(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -1368,7 +3146,7 @@ func awsRestjson1_deserializeDocumentAttendeeIdList(v *[]string, value interface return nil } -func awsRestjson1_deserializeDocumentAudioArtifactsConfiguration(v **types.AudioArtifactsConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentLiveConnectorSourceConfiguration(v **types.LiveConnectorSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1381,34 +3159,73 @@ func awsRestjson1_deserializeDocumentAudioArtifactsConfiguration(v **types.Audio return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AudioArtifactsConfiguration + var sv *types.LiveConnectorSourceConfiguration if *v == nil { - sv = &types.AudioArtifactsConfiguration{} + sv = &types.LiveConnectorSourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "MuxType": + case "ChimeSdkMeetingLiveConnectorConfiguration": + if err := awsRestjson1_deserializeDocumentChimeSdkMeetingLiveConnectorConfiguration(&sv.ChimeSdkMeetingLiveConnectorConfiguration, value); err != nil { + return err + } + + case "SourceType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AudioMuxType to be of type string, got %T instead", value) + return fmt.Errorf("expected LiveConnectorSourceType to be of type string, got %T instead", value) } - sv.MuxType = types.AudioMuxType(jtv) + sv.SourceType = types.LiveConnectorSourceType(jtv) } - default: - _, _ = key, value + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLiveConnectorSourceList(v *[]types.LiveConnectorSourceConfiguration, 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.LiveConnectorSourceConfiguration + if *v == nil { + cv = []types.LiveConnectorSourceConfiguration{} + } else { + cv = *v + } + for _, value := range shape { + var col types.LiveConnectorSourceConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentLiveConnectorSourceConfiguration(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { +func awsRestjson1_deserializeDocumentMediaCapturePipeline(v **types.MediaCapturePipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1421,40 +3238,107 @@ func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestExc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BadRequestException + var sv *types.MediaCapturePipeline if *v == nil { - sv = &types.BadRequestException{} + sv = &types.MediaCapturePipeline{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "ChimeSdkMeetingConfiguration": + if err := awsRestjson1_deserializeDocumentChimeSdkMeetingConfiguration(&sv.ChimeSdkMeetingConfiguration, value); err != nil { + return err + } + + case "CreatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } - sv.Code = types.ErrorCode(jtv) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) } - case "Message": + case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.MediaPipelineArn = ptr.String(jtv) } - case "RequestId": + case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } - sv.RequestId = ptr.String(jtv) + sv.MediaPipelineId = ptr.String(jtv) + } + + case "SinkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.SinkArn = ptr.String(jtv) + } + + case "SinkType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MediaPipelineSinkType to be of type string, got %T instead", value) + } + sv.SinkType = types.MediaPipelineSinkType(jtv) + } + + case "SourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.SourceArn = ptr.String(jtv) + } + + case "SourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MediaPipelineSourceType to be of type string, got %T instead", value) + } + sv.SourceType = types.MediaPipelineSourceType(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MediaPipelineStatus to be of type string, got %T instead", value) + } + sv.Status = types.MediaPipelineStatus(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(t) } default: @@ -1466,7 +3350,7 @@ func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestExc return nil } -func awsRestjson1_deserializeDocumentChimeSdkMeetingConfiguration(v **types.ChimeSdkMeetingConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentMediaCapturePipelineSourceConfiguration(v **types.MediaCapturePipelineSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1479,23 +3363,27 @@ func awsRestjson1_deserializeDocumentChimeSdkMeetingConfiguration(v **types.Chim return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ChimeSdkMeetingConfiguration + var sv *types.MediaCapturePipelineSourceConfiguration if *v == nil { - sv = &types.ChimeSdkMeetingConfiguration{} + sv = &types.MediaCapturePipelineSourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "ArtifactsConfiguration": - if err := awsRestjson1_deserializeDocumentArtifactsConfiguration(&sv.ArtifactsConfiguration, value); err != nil { + case "ChimeSdkMeetingConfiguration": + if err := awsRestjson1_deserializeDocumentChimeSdkMeetingConcatenationConfiguration(&sv.ChimeSdkMeetingConfiguration, value); err != nil { return err } - case "SourceConfiguration": - if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { - return err + case "MediaPipelineArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.MediaPipelineArn = ptr.String(jtv) } default: @@ -1507,7 +3395,7 @@ func awsRestjson1_deserializeDocumentChimeSdkMeetingConfiguration(v **types.Chim return nil } -func awsRestjson1_deserializeDocumentContentArtifactsConfiguration(v **types.ContentArtifactsConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentMediaCapturePipelineSummary(v **types.MediaCapturePipelineSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1520,31 +3408,31 @@ func awsRestjson1_deserializeDocumentContentArtifactsConfiguration(v **types.Con return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ContentArtifactsConfiguration + var sv *types.MediaCapturePipelineSummary if *v == nil { - sv = &types.ContentArtifactsConfiguration{} + sv = &types.MediaCapturePipelineSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "MuxType": + case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ContentMuxType to be of type string, got %T instead", value) + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } - sv.MuxType = types.ContentMuxType(jtv) + sv.MediaPipelineArn = ptr.String(jtv) } - case "State": + case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ArtifactsState to be of type string, got %T instead", value) + return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } - sv.State = types.ArtifactsState(jtv) + sv.MediaPipelineId = ptr.String(jtv) } default: @@ -1556,7 +3444,7 @@ func awsRestjson1_deserializeDocumentContentArtifactsConfiguration(v **types.Con return nil } -func awsRestjson1_deserializeDocumentExternalUserIdList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentMediaCapturePipelineSummaryList(v *[]types.MediaCapturePipelineSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1569,22 +3457,20 @@ func awsRestjson1_deserializeDocumentExternalUserIdList(v *[]string, value inter return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.MediaCapturePipelineSummary if *v == nil { - cv = []string{} + cv = []types.MediaCapturePipelineSummary{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExternalUserIdType to be of type string, got %T instead", value) - } - col = jtv + var col types.MediaCapturePipelineSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentMediaCapturePipelineSummary(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -1592,7 +3478,7 @@ func awsRestjson1_deserializeDocumentExternalUserIdList(v *[]string, value inter return nil } -func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, value interface{}) error { +func awsRestjson1_deserializeDocumentMediaConcatenationPipeline(v **types.MediaConcatenationPipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1605,40 +3491,76 @@ func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenExcep return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ForbiddenException + var sv *types.MediaConcatenationPipeline if *v == nil { - sv = &types.ForbiddenException{} + sv = &types.MediaConcatenationPipeline{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "CreatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } - sv.Code = types.ErrorCode(jtv) + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) } - case "Message": + case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.MediaPipelineArn = ptr.String(jtv) } - case "RequestId": + case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } - sv.RequestId = ptr.String(jtv) + sv.MediaPipelineId = ptr.String(jtv) + } + + case "Sinks": + if err := awsRestjson1_deserializeDocumentConcatenationSinkList(&sv.Sinks, value); err != nil { + return err + } + + case "Sources": + if err := awsRestjson1_deserializeDocumentConcatenationSourceList(&sv.Sources, value); err != nil { + return err + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MediaPipelineStatus to be of type string, got %T instead", value) + } + sv.Status = types.MediaPipelineStatus(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(t) } default: @@ -1650,7 +3572,7 @@ func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenExcep return nil } -func awsRestjson1_deserializeDocumentMediaCapturePipeline(v **types.MediaCapturePipeline, value interface{}) error { +func awsRestjson1_deserializeDocumentMediaLiveConnectorPipeline(v **types.MediaLiveConnectorPipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1663,20 +3585,15 @@ func awsRestjson1_deserializeDocumentMediaCapturePipeline(v **types.MediaCapture return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MediaCapturePipeline + var sv *types.MediaLiveConnectorPipeline if *v == nil { - sv = &types.MediaCapturePipeline{} + sv = &types.MediaLiveConnectorPipeline{} } else { sv = *v } for key, value := range shape { switch key { - case "ChimeSdkMeetingConfiguration": - if err := awsRestjson1_deserializeDocumentChimeSdkMeetingConfiguration(&sv.ChimeSdkMeetingConfiguration, value); err != nil { - return err - } - case "CreatedTimestamp": if value != nil { jtv, ok := value.(string) @@ -1690,58 +3607,32 @@ func awsRestjson1_deserializeDocumentMediaCapturePipeline(v **types.MediaCapture sv.CreatedTimestamp = ptr.Time(t) } - case "MediaPipelineArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) - } - sv.MediaPipelineArn = ptr.String(jtv) - } - - case "MediaPipelineId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) - } - sv.MediaPipelineId = ptr.String(jtv) - } - - case "SinkArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.SinkArn = ptr.String(jtv) - } - - case "SinkType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MediaPipelineSinkType to be of type string, got %T instead", value) - } - sv.SinkType = types.MediaPipelineSinkType(jtv) - } - - case "SourceArn": + case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } - sv.SourceArn = ptr.String(jtv) + sv.MediaPipelineArn = ptr.String(jtv) } - case "SourceType": + case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MediaPipelineSourceType to be of type string, got %T instead", value) + return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } - sv.SourceType = types.MediaPipelineSourceType(jtv) + sv.MediaPipelineId = ptr.String(jtv) + } + + case "Sinks": + if err := awsRestjson1_deserializeDocumentLiveConnectorSinkList(&sv.Sinks, value); err != nil { + return err + } + + case "Sources": + if err := awsRestjson1_deserializeDocumentLiveConnectorSourceList(&sv.Sources, value); err != nil { + return err } case "Status": @@ -1775,7 +3666,7 @@ func awsRestjson1_deserializeDocumentMediaCapturePipeline(v **types.MediaCapture return nil } -func awsRestjson1_deserializeDocumentMediaCapturePipelineSummary(v **types.MediaCapturePipelineSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentMediaPipeline(v **types.MediaPipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1788,9 +3679,89 @@ func awsRestjson1_deserializeDocumentMediaCapturePipelineSummary(v **types.Media return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MediaCapturePipelineSummary + var sv *types.MediaPipeline if *v == nil { - sv = &types.MediaCapturePipelineSummary{} + sv = &types.MediaPipeline{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MediaCapturePipeline": + if err := awsRestjson1_deserializeDocumentMediaCapturePipeline(&sv.MediaCapturePipeline, value); err != nil { + return err + } + + case "MediaConcatenationPipeline": + if err := awsRestjson1_deserializeDocumentMediaConcatenationPipeline(&sv.MediaConcatenationPipeline, value); err != nil { + return err + } + + case "MediaLiveConnectorPipeline": + if err := awsRestjson1_deserializeDocumentMediaLiveConnectorPipeline(&sv.MediaLiveConnectorPipeline, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMediaPipelineList(v *[]types.MediaPipelineSummary, 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.MediaPipelineSummary + if *v == nil { + cv = []types.MediaPipelineSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MediaPipelineSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentMediaPipelineSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMediaPipelineSummary(v **types.MediaPipelineSummary, 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.MediaPipelineSummary + if *v == nil { + sv = &types.MediaPipelineSummary{} } else { sv = *v } @@ -1824,7 +3795,7 @@ func awsRestjson1_deserializeDocumentMediaCapturePipelineSummary(v **types.Media return nil } -func awsRestjson1_deserializeDocumentMediaCapturePipelineSummaryList(v *[]types.MediaCapturePipelineSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentMeetingEventsConcatenationConfiguration(v **types.MeetingEventsConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1832,29 +3803,35 @@ func awsRestjson1_deserializeDocumentMediaCapturePipelineSummaryList(v *[]types. return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.MediaCapturePipelineSummary + var sv *types.MeetingEventsConcatenationConfiguration if *v == nil { - cv = []types.MediaCapturePipelineSummary{} + sv = &types.MeetingEventsConcatenationConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.MediaCapturePipelineSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentMediaCapturePipelineSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) + } + sv.State = types.ArtifactsConcatenationState(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } @@ -1916,6 +3893,46 @@ func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundExcepti return nil } +func awsRestjson1_deserializeDocumentPresenterOnlyConfiguration(v **types.PresenterOnlyConfiguration, 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.PresenterOnlyConfiguration + if *v == nil { + sv = &types.PresenterOnlyConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PresenterPosition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PresenterPosition to be of type string, got %T instead", value) + } + sv.PresenterPosition = types.PresenterPosition(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1974,6 +3991,46 @@ func awsRestjson1_deserializeDocumentResourceLimitExceededException(v **types.Re return nil } +func awsRestjson1_deserializeDocumentS3BucketSinkConfiguration(v **types.S3BucketSinkConfiguration, 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.S3BucketSinkConfiguration + if *v == nil { + sv = &types.S3BucketSinkConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Destination": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Destination = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentSelectedVideoStreams(v **types.SelectedVideoStreams, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2308,6 +4365,46 @@ func awsRestjson1_deserializeDocumentThrottledClientException(v **types.Throttle return nil } +func awsRestjson1_deserializeDocumentTranscriptionMessagesConcatenationConfiguration(v **types.TranscriptionMessagesConcatenationConfiguration, 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.TranscriptionMessagesConcatenationConfiguration + if *v == nil { + sv = &types.TranscriptionMessagesConcatenationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) + } + sv.State = types.ArtifactsConcatenationState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentUnauthorizedClientException(v **types.UnauthorizedClientException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2414,3 +4511,43 @@ func awsRestjson1_deserializeDocumentVideoArtifactsConfiguration(v **types.Video *v = sv return nil } + +func awsRestjson1_deserializeDocumentVideoConcatenationConfiguration(v **types.VideoConcatenationConfiguration, 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.VideoConcatenationConfiguration + if *v == nil { + sv = &types.VideoConcatenationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) + } + sv.State = types.ArtifactsConcatenationState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/chimesdkmediapipelines/doc.go b/service/chimesdkmediapipelines/doc.go index ef6fe7e77ae..9ef91a38748 100644 --- a/service/chimesdkmediapipelines/doc.go +++ b/service/chimesdkmediapipelines/doc.go @@ -4,8 +4,8 @@ // parameter types for Amazon Chime SDK Media Pipelines. // // The Amazon Chime SDK media pipeline APIs in this section allow software -// developers to create Amazon Chime SDK media pipelines and capture audio, video, -// events, and data messages from Amazon Chime SDK meetings. For more information -// about media pipleines, see Amzon Chime SDK media pipelines -// (https://docs.aws.amazon.com/chime/latest/APIReference/API_Operations_Amazon_Chime_SDK_Media_Pipelines.html). +// developers to create Amazon Chime SDK media pipelines that capture, concatenate, +// or stream your Amazon Chime SDK meetings. For more information about media +// pipleines, see Amazon Chime SDK media pipelines +// (http://amazonaws.com/chime/latest/APIReference/API_Operations_Amazon_Chime_SDK_Media_Pipelines.html). package chimesdkmediapipelines diff --git a/service/chimesdkmediapipelines/generated.json b/service/chimesdkmediapipelines/generated.json index b0fbae641fa..c730bb11a98 100644 --- a/service/chimesdkmediapipelines/generated.json +++ b/service/chimesdkmediapipelines/generated.json @@ -9,9 +9,14 @@ "api_client.go", "api_client_test.go", "api_op_CreateMediaCapturePipeline.go", + "api_op_CreateMediaConcatenationPipeline.go", + "api_op_CreateMediaLiveConnectorPipeline.go", "api_op_DeleteMediaCapturePipeline.go", + "api_op_DeleteMediaPipeline.go", "api_op_GetMediaCapturePipeline.go", + "api_op_GetMediaPipeline.go", "api_op_ListMediaCapturePipelines.go", + "api_op_ListMediaPipelines.go", "api_op_ListTagsForResource.go", "api_op_TagResource.go", "api_op_UntagResource.go", diff --git a/service/chimesdkmediapipelines/serializers.go b/service/chimesdkmediapipelines/serializers.go index 49f0e2b0624..c3c217b13e8 100644 --- a/service/chimesdkmediapipelines/serializers.go +++ b/service/chimesdkmediapipelines/serializers.go @@ -116,14 +116,14 @@ func awsRestjson1_serializeOpDocumentCreateMediaCapturePipelineInput(v *CreateMe return nil } -type awsRestjson1_serializeOpDeleteMediaCapturePipeline struct { +type awsRestjson1_serializeOpCreateMediaConcatenationPipeline struct { } -func (*awsRestjson1_serializeOpDeleteMediaCapturePipeline) ID() string { +func (*awsRestjson1_serializeOpCreateMediaConcatenationPipeline) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDeleteMediaCapturePipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateMediaConcatenationPipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -131,22 +131,29 @@ func (m *awsRestjson1_serializeOpDeleteMediaCapturePipeline) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteMediaCapturePipelineInput) + input, ok := in.Parameters.(*CreateMediaConcatenationPipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/sdk-media-capture-pipelines/{MediaPipelineId}") + opPath, opQuery := httpbinding.SplitURI("/sdk-media-concatenation-pipelines") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" + request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDeleteMediaCapturePipelineInput(input, restEncoder); err != nil { + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateMediaConcatenationPipelineInput(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} } @@ -157,16 +164,40 @@ func (m *awsRestjson1_serializeOpDeleteMediaCapturePipeline) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDeleteMediaCapturePipelineInput(v *DeleteMediaCapturePipelineInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateMediaConcatenationPipelineInput(v *CreateMediaConcatenationPipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MediaPipelineId == nil || len(*v.MediaPipelineId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member MediaPipelineId must not be empty")} + return nil +} + +func awsRestjson1_serializeOpDocumentCreateMediaConcatenationPipelineInput(v *CreateMediaConcatenationPipelineInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) } - if v.MediaPipelineId != nil { - if err := encoder.SetURI("MediaPipelineId").String(*v.MediaPipelineId); err != nil { + + if v.Sinks != nil { + ok := object.Key("Sinks") + if err := awsRestjson1_serializeDocumentConcatenationSinkList(v.Sinks, ok); err != nil { + return err + } + } + + if v.Sources != nil { + ok := object.Key("Sources") + if err := awsRestjson1_serializeDocumentConcatenationSourceList(v.Sources, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } @@ -174,14 +205,14 @@ func awsRestjson1_serializeOpHttpBindingsDeleteMediaCapturePipelineInput(v *Dele return nil } -type awsRestjson1_serializeOpGetMediaCapturePipeline struct { +type awsRestjson1_serializeOpCreateMediaLiveConnectorPipeline struct { } -func (*awsRestjson1_serializeOpGetMediaCapturePipeline) ID() string { +func (*awsRestjson1_serializeOpCreateMediaLiveConnectorPipeline) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetMediaCapturePipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpCreateMediaLiveConnectorPipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -189,22 +220,29 @@ func (m *awsRestjson1_serializeOpGetMediaCapturePipeline) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetMediaCapturePipelineInput) + input, ok := in.Parameters.(*CreateMediaLiveConnectorPipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/sdk-media-capture-pipelines/{MediaPipelineId}") + opPath, opQuery := httpbinding.SplitURI("/sdk-media-live-connector-pipelines") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetMediaCapturePipelineInput(input, restEncoder); err != nil { + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateMediaLiveConnectorPipelineInput(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} } @@ -215,16 +253,40 @@ func (m *awsRestjson1_serializeOpGetMediaCapturePipeline) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetMediaCapturePipelineInput(v *GetMediaCapturePipelineInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsCreateMediaLiveConnectorPipelineInput(v *CreateMediaLiveConnectorPipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MediaPipelineId == nil || len(*v.MediaPipelineId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member MediaPipelineId must not be empty")} + return nil +} + +func awsRestjson1_serializeOpDocumentCreateMediaLiveConnectorPipelineInput(v *CreateMediaLiveConnectorPipelineInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) } - if v.MediaPipelineId != nil { - if err := encoder.SetURI("MediaPipelineId").String(*v.MediaPipelineId); err != nil { + + if v.Sinks != nil { + ok := object.Key("Sinks") + if err := awsRestjson1_serializeDocumentLiveConnectorSinkList(v.Sinks, ok); err != nil { + return err + } + } + + if v.Sources != nil { + ok := object.Key("Sources") + if err := awsRestjson1_serializeDocumentLiveConnectorSourceList(v.Sources, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } @@ -232,14 +294,14 @@ func awsRestjson1_serializeOpHttpBindingsGetMediaCapturePipelineInput(v *GetMedi return nil } -type awsRestjson1_serializeOpListMediaCapturePipelines struct { +type awsRestjson1_serializeOpDeleteMediaCapturePipeline struct { } -func (*awsRestjson1_serializeOpListMediaCapturePipelines) ID() string { +func (*awsRestjson1_serializeOpDeleteMediaCapturePipeline) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListMediaCapturePipelines) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteMediaCapturePipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -247,22 +309,22 @@ func (m *awsRestjson1_serializeOpListMediaCapturePipelines) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListMediaCapturePipelinesInput) + input, ok := in.Parameters.(*DeleteMediaCapturePipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/sdk-media-capture-pipelines") + opPath, opQuery := httpbinding.SplitURI("/sdk-media-capture-pipelines/{MediaPipelineId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListMediaCapturePipelinesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteMediaCapturePipelineInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -273,30 +335,31 @@ func (m *awsRestjson1_serializeOpListMediaCapturePipelines) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListMediaCapturePipelinesInput(v *ListMediaCapturePipelinesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteMediaCapturePipelineInput(v *DeleteMediaCapturePipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MaxResults != nil { - encoder.SetQuery("max-results").Integer(*v.MaxResults) + if v.MediaPipelineId == nil || len(*v.MediaPipelineId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member MediaPipelineId must not be empty")} } - - if v.NextToken != nil { - encoder.SetQuery("next-token").String(*v.NextToken) + if v.MediaPipelineId != nil { + if err := encoder.SetURI("MediaPipelineId").String(*v.MediaPipelineId); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpListTagsForResource struct { +type awsRestjson1_serializeOpDeleteMediaPipeline struct { } -func (*awsRestjson1_serializeOpListTagsForResource) ID() string { +func (*awsRestjson1_serializeOpDeleteMediaPipeline) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDeleteMediaPipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -304,22 +367,22 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListTagsForResourceInput) + input, ok := in.Parameters.(*DeleteMediaPipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/tags") + opPath, opQuery := httpbinding.SplitURI("/sdk-media-pipelines/{MediaPipelineId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDeleteMediaPipelineInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -330,26 +393,31 @@ func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDeleteMediaPipelineInput(v *DeleteMediaPipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ResourceARN != nil { - encoder.SetQuery("arn").String(*v.ResourceARN) + if v.MediaPipelineId == nil || len(*v.MediaPipelineId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member MediaPipelineId must not be empty")} + } + if v.MediaPipelineId != nil { + if err := encoder.SetURI("MediaPipelineId").String(*v.MediaPipelineId); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpTagResource struct { +type awsRestjson1_serializeOpGetMediaCapturePipeline struct { } -func (*awsRestjson1_serializeOpTagResource) ID() string { +func (*awsRestjson1_serializeOpGetMediaCapturePipeline) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetMediaCapturePipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -357,29 +425,22 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*TagResourceInput) + input, ok := in.Parameters.(*GetMediaCapturePipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/tags?operation=tag-resource") + opPath, opQuery := httpbinding.SplitURI("/sdk-media-capture-pipelines/{MediaPipelineId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetMediaCapturePipelineInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -390,26 +451,16 @@ func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetMediaCapturePipelineInput(v *GetMediaCapturePipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - return nil -} - -func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ResourceARN != nil { - ok := object.Key("ResourceARN") - ok.String(*v.ResourceARN) + if v.MediaPipelineId == nil || len(*v.MediaPipelineId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member MediaPipelineId must not be empty")} } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + if v.MediaPipelineId != nil { + if err := encoder.SetURI("MediaPipelineId").String(*v.MediaPipelineId); err != nil { return err } } @@ -417,14 +468,14 @@ func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value return nil } -type awsRestjson1_serializeOpUntagResource struct { +type awsRestjson1_serializeOpGetMediaPipeline struct { } -func (*awsRestjson1_serializeOpUntagResource) ID() string { +func (*awsRestjson1_serializeOpGetMediaPipeline) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetMediaPipeline) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -432,29 +483,22 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UntagResourceInput) + input, ok := in.Parameters.(*GetMediaPipelineInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/tags?operation=untag-resource") + opPath, opQuery := httpbinding.SplitURI("/sdk-media-pipelines/{MediaPipelineId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetMediaPipelineInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -465,26 +509,16 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetMediaPipelineInput(v *GetMediaPipelineInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - return nil -} - -func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ResourceARN != nil { - ok := object.Key("ResourceARN") - ok.String(*v.ResourceARN) + if v.MediaPipelineId == nil || len(*v.MediaPipelineId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member MediaPipelineId must not be empty")} } - - if v.TagKeys != nil { - ok := object.Key("TagKeys") - if err := awsRestjson1_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { + if v.MediaPipelineId != nil { + if err := encoder.SetURI("MediaPipelineId").String(*v.MediaPipelineId); err != nil { return err } } @@ -492,75 +526,612 @@ func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, v return nil } -func awsRestjson1_serializeDocumentArtifactsConfiguration(v *types.ArtifactsConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() +type awsRestjson1_serializeOpListMediaCapturePipelines struct { +} - if v.Audio != nil { - ok := object.Key("Audio") - if err := awsRestjson1_serializeDocumentAudioArtifactsConfiguration(v.Audio, ok); err != nil { - return err - } +func (*awsRestjson1_serializeOpListMediaCapturePipelines) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListMediaCapturePipelines) 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)} } - if v.Content != nil { - ok := object.Key("Content") - if err := awsRestjson1_serializeDocumentContentArtifactsConfiguration(v.Content, ok); err != nil { - return err - } + input, ok := in.Parameters.(*ListMediaCapturePipelinesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - if v.Video != nil { - ok := object.Key("Video") - if err := awsRestjson1_serializeDocumentVideoArtifactsConfiguration(v.Video, ok); err != nil { - return err - } + opPath, opQuery := httpbinding.SplitURI("/sdk-media-capture-pipelines") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} } - return nil -} + if err := awsRestjson1_serializeOpHttpBindingsListMediaCapturePipelinesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } -func awsRestjson1_serializeDocumentAttendeeIdList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request - for i := range v { + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListMediaCapturePipelinesInput(v *ListMediaCapturePipelinesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListMediaPipelines struct { +} + +func (*awsRestjson1_serializeOpListMediaPipelines) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListMediaPipelines) 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.(*ListMediaPipelinesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sdk-media-pipelines") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListMediaPipelinesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListMediaPipelinesInput(v *ListMediaPipelinesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) 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.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceARN != nil { + encoder.SetQuery("arn").String(*v.ResourceARN) + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) 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.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags?operation=tag-resource") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(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 = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) 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.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags?operation=untag-resource") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUntagResourceInput(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 = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsRestjson1_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentArtifactsConcatenationConfiguration(v *types.ArtifactsConcatenationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Audio != nil { + ok := object.Key("Audio") + if err := awsRestjson1_serializeDocumentAudioConcatenationConfiguration(v.Audio, ok); err != nil { + return err + } + } + + if v.CompositedVideo != nil { + ok := object.Key("CompositedVideo") + if err := awsRestjson1_serializeDocumentCompositedVideoConcatenationConfiguration(v.CompositedVideo, ok); err != nil { + return err + } + } + + if v.Content != nil { + ok := object.Key("Content") + if err := awsRestjson1_serializeDocumentContentConcatenationConfiguration(v.Content, ok); err != nil { + return err + } + } + + if v.DataChannel != nil { + ok := object.Key("DataChannel") + if err := awsRestjson1_serializeDocumentDataChannelConcatenationConfiguration(v.DataChannel, ok); err != nil { + return err + } + } + + if v.MeetingEvents != nil { + ok := object.Key("MeetingEvents") + if err := awsRestjson1_serializeDocumentMeetingEventsConcatenationConfiguration(v.MeetingEvents, ok); err != nil { + return err + } + } + + if v.TranscriptionMessages != nil { + ok := object.Key("TranscriptionMessages") + if err := awsRestjson1_serializeDocumentTranscriptionMessagesConcatenationConfiguration(v.TranscriptionMessages, ok); err != nil { + return err + } + } + + if v.Video != nil { + ok := object.Key("Video") + if err := awsRestjson1_serializeDocumentVideoConcatenationConfiguration(v.Video, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentArtifactsConfiguration(v *types.ArtifactsConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Audio != nil { + ok := object.Key("Audio") + if err := awsRestjson1_serializeDocumentAudioArtifactsConfiguration(v.Audio, ok); err != nil { + return err + } + } + + if v.CompositedVideo != nil { + ok := object.Key("CompositedVideo") + if err := awsRestjson1_serializeDocumentCompositedVideoArtifactsConfiguration(v.CompositedVideo, ok); err != nil { + return err + } + } + + if v.Content != nil { + ok := object.Key("Content") + if err := awsRestjson1_serializeDocumentContentArtifactsConfiguration(v.Content, ok); err != nil { + return err + } + } + + if v.Video != nil { + ok := object.Key("Video") + if err := awsRestjson1_serializeDocumentVideoArtifactsConfiguration(v.Video, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAttendeeIdList(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 awsRestjson1_serializeDocumentAudioArtifactsConfiguration(v *types.AudioArtifactsConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentAudioArtifactsConfiguration(v *types.AudioArtifactsConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.MuxType) > 0 { + ok := object.Key("MuxType") + ok.String(string(v.MuxType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentAudioConcatenationConfiguration(v *types.AudioConcatenationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + return nil +} + +func awsRestjson1_serializeDocumentChimeSdkMeetingConcatenationConfiguration(v *types.ChimeSdkMeetingConcatenationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ArtifactsConfiguration != nil { + ok := object.Key("ArtifactsConfiguration") + if err := awsRestjson1_serializeDocumentArtifactsConcatenationConfiguration(v.ArtifactsConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentChimeSdkMeetingConfiguration(v *types.ChimeSdkMeetingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ArtifactsConfiguration != nil { + ok := object.Key("ArtifactsConfiguration") + if err := awsRestjson1_serializeDocumentArtifactsConfiguration(v.ArtifactsConfiguration, ok); err != nil { + return err + } + } + + if v.SourceConfiguration != nil { + ok := object.Key("SourceConfiguration") + if err := awsRestjson1_serializeDocumentSourceConfiguration(v.SourceConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentChimeSdkMeetingLiveConnectorConfiguration(v *types.ChimeSdkMeetingLiveConnectorConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + if v.CompositedVideo != nil { + ok := object.Key("CompositedVideo") + if err := awsRestjson1_serializeDocumentCompositedVideoArtifactsConfiguration(v.CompositedVideo, ok); err != nil { + return err + } + } + if len(v.MuxType) > 0 { ok := object.Key("MuxType") ok.String(string(v.MuxType)) } + if v.SourceConfiguration != nil { + ok := object.Key("SourceConfiguration") + if err := awsRestjson1_serializeDocumentSourceConfiguration(v.SourceConfiguration, ok); err != nil { + return err + } + } + return nil } -func awsRestjson1_serializeDocumentChimeSdkMeetingConfiguration(v *types.ChimeSdkMeetingConfiguration, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentCompositedVideoArtifactsConfiguration(v *types.CompositedVideoArtifactsConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.ArtifactsConfiguration != nil { - ok := object.Key("ArtifactsConfiguration") - if err := awsRestjson1_serializeDocumentArtifactsConfiguration(v.ArtifactsConfiguration, ok); err != nil { + if v.GridViewConfiguration != nil { + ok := object.Key("GridViewConfiguration") + if err := awsRestjson1_serializeDocumentGridViewConfiguration(v.GridViewConfiguration, ok); err != nil { return err } } - if v.SourceConfiguration != nil { - ok := object.Key("SourceConfiguration") - if err := awsRestjson1_serializeDocumentSourceConfiguration(v.SourceConfiguration, ok); err != nil { + if len(v.Layout) > 0 { + ok := object.Key("Layout") + ok.String(string(v.Layout)) + } + + if len(v.Resolution) > 0 { + ok := object.Key("Resolution") + ok.String(string(v.Resolution)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCompositedVideoConcatenationConfiguration(v *types.CompositedVideoConcatenationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + return nil +} + +func awsRestjson1_serializeDocumentConcatenationSink(v *types.ConcatenationSink, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3BucketSinkConfiguration != nil { + ok := object.Key("S3BucketSinkConfiguration") + if err := awsRestjson1_serializeDocumentS3BucketSinkConfiguration(v.S3BucketSinkConfiguration, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentConcatenationSinkList(v []types.ConcatenationSink, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentConcatenationSink(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentConcatenationSource(v *types.ConcatenationSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MediaCapturePipelineSourceConfiguration != nil { + ok := object.Key("MediaCapturePipelineSourceConfiguration") + if err := awsRestjson1_serializeDocumentMediaCapturePipelineSourceConfiguration(v.MediaCapturePipelineSourceConfiguration, ok); err != nil { return err } } + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentConcatenationSourceList(v []types.ConcatenationSource, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentConcatenationSource(&v[i], av); err != nil { + return err + } + } return nil } @@ -581,6 +1152,30 @@ func awsRestjson1_serializeDocumentContentArtifactsConfiguration(v *types.Conten return nil } +func awsRestjson1_serializeDocumentContentConcatenationConfiguration(v *types.ContentConcatenationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + return nil +} + +func awsRestjson1_serializeDocumentDataChannelConcatenationConfiguration(v *types.DataChannelConcatenationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + return nil +} + func awsRestjson1_serializeDocumentExternalUserIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -592,6 +1187,166 @@ func awsRestjson1_serializeDocumentExternalUserIdList(v []string, value smithyjs return nil } +func awsRestjson1_serializeDocumentGridViewConfiguration(v *types.GridViewConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ContentShareLayout) > 0 { + ok := object.Key("ContentShareLayout") + ok.String(string(v.ContentShareLayout)) + } + + if v.PresenterOnlyConfiguration != nil { + ok := object.Key("PresenterOnlyConfiguration") + if err := awsRestjson1_serializeDocumentPresenterOnlyConfiguration(v.PresenterOnlyConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentLiveConnectorRTMPConfiguration(v *types.LiveConnectorRTMPConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AudioChannels) > 0 { + ok := object.Key("AudioChannels") + ok.String(string(v.AudioChannels)) + } + + if v.AudioSampleRate != nil { + ok := object.Key("AudioSampleRate") + ok.String(*v.AudioSampleRate) + } + + if v.Url != nil { + ok := object.Key("Url") + ok.String(*v.Url) + } + + return nil +} + +func awsRestjson1_serializeDocumentLiveConnectorSinkConfiguration(v *types.LiveConnectorSinkConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RTMPConfiguration != nil { + ok := object.Key("RTMPConfiguration") + if err := awsRestjson1_serializeDocumentLiveConnectorRTMPConfiguration(v.RTMPConfiguration, ok); err != nil { + return err + } + } + + if len(v.SinkType) > 0 { + ok := object.Key("SinkType") + ok.String(string(v.SinkType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentLiveConnectorSinkList(v []types.LiveConnectorSinkConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentLiveConnectorSinkConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentLiveConnectorSourceConfiguration(v *types.LiveConnectorSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChimeSdkMeetingLiveConnectorConfiguration != nil { + ok := object.Key("ChimeSdkMeetingLiveConnectorConfiguration") + if err := awsRestjson1_serializeDocumentChimeSdkMeetingLiveConnectorConfiguration(v.ChimeSdkMeetingLiveConnectorConfiguration, ok); err != nil { + return err + } + } + + if len(v.SourceType) > 0 { + ok := object.Key("SourceType") + ok.String(string(v.SourceType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentLiveConnectorSourceList(v []types.LiveConnectorSourceConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentLiveConnectorSourceConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentMediaCapturePipelineSourceConfiguration(v *types.MediaCapturePipelineSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChimeSdkMeetingConfiguration != nil { + ok := object.Key("ChimeSdkMeetingConfiguration") + if err := awsRestjson1_serializeDocumentChimeSdkMeetingConcatenationConfiguration(v.ChimeSdkMeetingConfiguration, ok); err != nil { + return err + } + } + + if v.MediaPipelineArn != nil { + ok := object.Key("MediaPipelineArn") + ok.String(*v.MediaPipelineArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentMeetingEventsConcatenationConfiguration(v *types.MeetingEventsConcatenationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + return nil +} + +func awsRestjson1_serializeDocumentPresenterOnlyConfiguration(v *types.PresenterOnlyConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.PresenterPosition) > 0 { + ok := object.Key("PresenterPosition") + ok.String(string(v.PresenterPosition)) + } + + return nil +} + +func awsRestjson1_serializeDocumentS3BucketSinkConfiguration(v *types.S3BucketSinkConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Destination != nil { + ok := object.Key("Destination") + ok.String(*v.Destination) + } + + return nil +} + func awsRestjson1_serializeDocumentSelectedVideoStreams(v *types.SelectedVideoStreams, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -668,6 +1423,18 @@ func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value return nil } +func awsRestjson1_serializeDocumentTranscriptionMessagesConcatenationConfiguration(v *types.TranscriptionMessagesConcatenationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + return nil +} + func awsRestjson1_serializeDocumentVideoArtifactsConfiguration(v *types.VideoArtifactsConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -684,3 +1451,15 @@ func awsRestjson1_serializeDocumentVideoArtifactsConfiguration(v *types.VideoArt return nil } + +func awsRestjson1_serializeDocumentVideoConcatenationConfiguration(v *types.VideoConcatenationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + return nil +} diff --git a/service/chimesdkmediapipelines/types/enums.go b/service/chimesdkmediapipelines/types/enums.go index 384576fc32d..ddf7f1b1b3a 100644 --- a/service/chimesdkmediapipelines/types/enums.go +++ b/service/chimesdkmediapipelines/types/enums.go @@ -2,6 +2,24 @@ package types +type ArtifactsConcatenationState string + +// Enum values for ArtifactsConcatenationState +const ( + ArtifactsConcatenationStateEnabled ArtifactsConcatenationState = "Enabled" + ArtifactsConcatenationStateDisabled ArtifactsConcatenationState = "Disabled" +) + +// Values returns all known values for ArtifactsConcatenationState. 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 (ArtifactsConcatenationState) Values() []ArtifactsConcatenationState { + return []ArtifactsConcatenationState{ + "Enabled", + "Disabled", + } +} + type ArtifactsState string // Enum values for ArtifactsState @@ -20,12 +38,48 @@ func (ArtifactsState) Values() []ArtifactsState { } } +type AudioArtifactsConcatenationState string + +// Enum values for AudioArtifactsConcatenationState +const ( + AudioArtifactsConcatenationStateEnabled AudioArtifactsConcatenationState = "Enabled" +) + +// Values returns all known values for AudioArtifactsConcatenationState. 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 (AudioArtifactsConcatenationState) Values() []AudioArtifactsConcatenationState { + return []AudioArtifactsConcatenationState{ + "Enabled", + } +} + +type AudioChannelsOption string + +// Enum values for AudioChannelsOption +const ( + AudioChannelsOptionStereo AudioChannelsOption = "Stereo" + AudioChannelsOptionMono AudioChannelsOption = "Mono" +) + +// Values returns all known values for AudioChannelsOption. 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 (AudioChannelsOption) Values() []AudioChannelsOption { + return []AudioChannelsOption{ + "Stereo", + "Mono", + } +} + type AudioMuxType string // Enum values for AudioMuxType const ( AudioMuxTypeAudioOnly AudioMuxType = "AudioOnly" AudioMuxTypeAudioWithActiveSpeakerVideo AudioMuxType = "AudioWithActiveSpeakerVideo" + AudioMuxTypeAudioWithCompositedVideo AudioMuxType = "AudioWithCompositedVideo" ) // Values returns all known values for AudioMuxType. Note that this can be expanded @@ -35,6 +89,39 @@ func (AudioMuxType) Values() []AudioMuxType { return []AudioMuxType{ "AudioOnly", "AudioWithActiveSpeakerVideo", + "AudioWithCompositedVideo", + } +} + +type ConcatenationSinkType string + +// Enum values for ConcatenationSinkType +const ( + ConcatenationSinkTypeS3Bucket ConcatenationSinkType = "S3Bucket" +) + +// Values returns all known values for ConcatenationSinkType. 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 (ConcatenationSinkType) Values() []ConcatenationSinkType { + return []ConcatenationSinkType{ + "S3Bucket", + } +} + +type ConcatenationSourceType string + +// Enum values for ConcatenationSourceType +const ( + ConcatenationSourceTypeMediaCapturePipeline ConcatenationSourceType = "MediaCapturePipeline" +) + +// Values returns all known values for ConcatenationSourceType. 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 (ConcatenationSourceType) Values() []ConcatenationSourceType { + return []ConcatenationSourceType{ + "MediaCapturePipeline", } } @@ -54,6 +141,26 @@ func (ContentMuxType) Values() []ContentMuxType { } } +type ContentShareLayoutOption string + +// Enum values for ContentShareLayoutOption +const ( + ContentShareLayoutOptionPresenterOnly ContentShareLayoutOption = "PresenterOnly" + ContentShareLayoutOptionHorizontal ContentShareLayoutOption = "Horizontal" + ContentShareLayoutOptionVertical ContentShareLayoutOption = "Vertical" +) + +// Values returns all known values for ContentShareLayoutOption. 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 (ContentShareLayoutOption) Values() []ContentShareLayoutOption { + return []ContentShareLayoutOption{ + "PresenterOnly", + "Horizontal", + "Vertical", + } +} + type ErrorCode string // Enum values for ErrorCode @@ -82,6 +189,72 @@ func (ErrorCode) Values() []ErrorCode { } } +type LayoutOption string + +// Enum values for LayoutOption +const ( + LayoutOptionGridView LayoutOption = "GridView" +) + +// Values returns all known values for LayoutOption. 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 (LayoutOption) Values() []LayoutOption { + return []LayoutOption{ + "GridView", + } +} + +type LiveConnectorMuxType string + +// Enum values for LiveConnectorMuxType +const ( + LiveConnectorMuxTypeAudioWithCompositedVideo LiveConnectorMuxType = "AudioWithCompositedVideo" + LiveConnectorMuxTypeAudioWithActiveSpeakerVideo LiveConnectorMuxType = "AudioWithActiveSpeakerVideo" +) + +// Values returns all known values for LiveConnectorMuxType. 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 (LiveConnectorMuxType) Values() []LiveConnectorMuxType { + return []LiveConnectorMuxType{ + "AudioWithCompositedVideo", + "AudioWithActiveSpeakerVideo", + } +} + +type LiveConnectorSinkType string + +// Enum values for LiveConnectorSinkType +const ( + LiveConnectorSinkTypeRtmp LiveConnectorSinkType = "RTMP" +) + +// Values returns all known values for LiveConnectorSinkType. 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 (LiveConnectorSinkType) Values() []LiveConnectorSinkType { + return []LiveConnectorSinkType{ + "RTMP", + } +} + +type LiveConnectorSourceType string + +// Enum values for LiveConnectorSourceType +const ( + LiveConnectorSourceTypeChimeSdkMeeting LiveConnectorSourceType = "ChimeSdkMeeting" +) + +// Values returns all known values for LiveConnectorSourceType. 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 (LiveConnectorSourceType) Values() []LiveConnectorSourceType { + return []LiveConnectorSourceType{ + "ChimeSdkMeeting", + } +} + type MediaPipelineSinkType string // Enum values for MediaPipelineSinkType @@ -138,6 +311,46 @@ func (MediaPipelineStatus) Values() []MediaPipelineStatus { } } +type PresenterPosition string + +// Enum values for PresenterPosition +const ( + PresenterPositionTopLeft PresenterPosition = "TopLeft" + PresenterPositionTopRight PresenterPosition = "TopRight" + PresenterPositionBottomLeft PresenterPosition = "BottomLeft" + PresenterPositionBottomRight PresenterPosition = "BottomRight" +) + +// Values returns all known values for PresenterPosition. 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 (PresenterPosition) Values() []PresenterPosition { + return []PresenterPosition{ + "TopLeft", + "TopRight", + "BottomLeft", + "BottomRight", + } +} + +type ResolutionOption string + +// Enum values for ResolutionOption +const ( + ResolutionOptionHd ResolutionOption = "HD" + ResolutionOptionFhd ResolutionOption = "FHD" +) + +// Values returns all known values for ResolutionOption. 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 (ResolutionOption) Values() []ResolutionOption { + return []ResolutionOption{ + "HD", + "FHD", + } +} + type VideoMuxType string // Enum values for VideoMuxType diff --git a/service/chimesdkmediapipelines/types/types.go b/service/chimesdkmediapipelines/types/types.go index 9d58cc9f6f2..4d15f72ee83 100644 --- a/service/chimesdkmediapipelines/types/types.go +++ b/service/chimesdkmediapipelines/types/types.go @@ -7,6 +7,47 @@ import ( "time" ) +// The configuration for the artifacts concatenation. +type ArtifactsConcatenationConfiguration struct { + + // The configuration for the audio artifacts concatenation. + // + // This member is required. + Audio *AudioConcatenationConfiguration + + // The configuration for the composited video artifacts concatenation. + // + // This member is required. + CompositedVideo *CompositedVideoConcatenationConfiguration + + // The configuration for the content artifacts concatenation. + // + // This member is required. + Content *ContentConcatenationConfiguration + + // The configuration for the data channel artifacts concatenation. + // + // This member is required. + DataChannel *DataChannelConcatenationConfiguration + + // The configuration for the meeting events artifacts concatenation. + // + // This member is required. + MeetingEvents *MeetingEventsConcatenationConfiguration + + // The configuration for the transcription messages artifacts concatenation. + // + // This member is required. + TranscriptionMessages *TranscriptionMessagesConcatenationConfiguration + + // The configuration for the video artifacts concatenation. + // + // This member is required. + Video *VideoConcatenationConfiguration + + noSmithyDocumentSerde +} + // The configuration for the artifacts. type ArtifactsConfiguration struct { @@ -25,6 +66,9 @@ type ArtifactsConfiguration struct { // This member is required. Video *VideoArtifactsConfiguration + // Enables video compositing. + CompositedVideo *CompositedVideoArtifactsConfiguration + noSmithyDocumentSerde } @@ -39,19 +83,129 @@ type AudioArtifactsConfiguration struct { noSmithyDocumentSerde } +// The audio artifact concatenation configuration object. +type AudioConcatenationConfiguration struct { + + // Enables the name object, where name is the name of the configuration object, + // such as AudioConcatenation. + // + // This member is required. + State AudioArtifactsConcatenationState + + noSmithyDocumentSerde +} + +// The configuration object of the Amazon Chime SDK meeting concatenation for a +// specified media pipeline. +type ChimeSdkMeetingConcatenationConfiguration struct { + + // The configuration for the artifacts in an Amazon Chime SDK meeting + // concatenation. + // + // This member is required. + ArtifactsConfiguration *ArtifactsConcatenationConfiguration + + noSmithyDocumentSerde +} + // The configuration object of the Amazon Chime SDK meeting for a specified media -// capture pipeline. SourceType must be ChimeSdkMeeting. +// pipeline. SourceType must be ChimeSdkMeeting. type ChimeSdkMeetingConfiguration struct { // The configuration for the artifacts in an Amazon Chime SDK meeting. ArtifactsConfiguration *ArtifactsConfiguration - // The source configuration for a specified media capture pipline. + // The source configuration for a specified media pipline. SourceConfiguration *SourceConfiguration noSmithyDocumentSerde } +// The media pipeline's configuration object. +type ChimeSdkMeetingLiveConnectorConfiguration struct { + + // The configuration object's Chime SDK meeting ARN. + // + // This member is required. + Arn *string + + // The configuration object's multiplex type. + // + // This member is required. + MuxType LiveConnectorMuxType + + // The media pipeline's composited video. + CompositedVideo *CompositedVideoArtifactsConfiguration + + // The source configuration settings of the media pipeline's configuration object. + SourceConfiguration *SourceConfiguration + + noSmithyDocumentSerde +} + +// Describes the configuration for the composited video artifacts. +type CompositedVideoArtifactsConfiguration struct { + + // The GridView configuration setting. + // + // This member is required. + GridViewConfiguration *GridViewConfiguration + + // The layout setting, such as GridView in the configuration object. + Layout LayoutOption + + // The video resolution setting in the configuration object. Default: HD at 1280 x + // 720. FHD resolution: 1920 x 1080. + Resolution ResolutionOption + + noSmithyDocumentSerde +} + +// The composited video configuration object for a specified media pipeline. +// SourceType must be ChimeSdkMeeting. +type CompositedVideoConcatenationConfiguration struct { + + // Enables or disables the configuration object. + // + // This member is required. + State ArtifactsConcatenationState + + noSmithyDocumentSerde +} + +// The data sink of the configuration object. +type ConcatenationSink struct { + + // The configuration settings for an Amazon S3 bucket sink. + // + // This member is required. + S3BucketSinkConfiguration *S3BucketSinkConfiguration + + // The type of data sink in the configuration object. + // + // This member is required. + Type ConcatenationSinkType + + noSmithyDocumentSerde +} + +// The source type and media pipeline configuration settings in a configuration +// object. +type ConcatenationSource struct { + + // The concatenation settings for the media pipeline in a configuration object. + // + // This member is required. + MediaCapturePipelineSourceConfiguration *MediaCapturePipelineSourceConfiguration + + // The type of concatenation source in a configuration object. + // + // This member is required. + Type ConcatenationSourceType + + noSmithyDocumentSerde +} + // The content artifact object. type ContentArtifactsConfiguration struct { @@ -66,21 +220,106 @@ type ContentArtifactsConfiguration struct { noSmithyDocumentSerde } -// A media capture pipeline object consisting of an ID, source type, source ARN, a -// sink type, a sink ARN, and a configuration object. +// The composited content configuration object for a specified media pipeline. +type ContentConcatenationConfiguration struct { + + // Enables or disables the configuration object. + // + // This member is required. + State ArtifactsConcatenationState + + noSmithyDocumentSerde +} + +// The content configuration object's data channel. +type DataChannelConcatenationConfiguration struct { + + // Enables or disables the configuration object. + // + // This member is required. + State ArtifactsConcatenationState + + noSmithyDocumentSerde +} + +// Specifies the type of grid layout. +type GridViewConfiguration struct { + + // Defines the layout of the video tiles when content sharing is enabled. + // + // This member is required. + ContentShareLayout ContentShareLayoutOption + + // Defines the configuration options for a presenter only video tile. + PresenterOnlyConfiguration *PresenterOnlyConfiguration + + noSmithyDocumentSerde +} + +// The media pipeline's RTMP configuration object. +type LiveConnectorRTMPConfiguration struct { + + // The URL of the RTMP configuration. + // + // This member is required. + Url *string + + // The audio channels set for the RTMP configuration + AudioChannels AudioChannelsOption + + // The audio sample rate set for the RTMP configuration. Default: 48000. + AudioSampleRate *string + + noSmithyDocumentSerde +} + +// The media pipeline's sink configuration settings. +type LiveConnectorSinkConfiguration struct { + + // The sink configuration's RTMP configuration setttings. + // + // This member is required. + RTMPConfiguration *LiveConnectorRTMPConfiguration + + // The sink configuration's sink type. + // + // This member is required. + SinkType LiveConnectorSinkType + + noSmithyDocumentSerde +} + +// The data source configuration object of a streaming media pipeline. +type LiveConnectorSourceConfiguration struct { + + // The configuration settings of the connector pipeline. + // + // This member is required. + ChimeSdkMeetingLiveConnectorConfiguration *ChimeSdkMeetingLiveConnectorConfiguration + + // The source configuration's media source type. + // + // This member is required. + SourceType LiveConnectorSourceType + + noSmithyDocumentSerde +} + +// A media pipeline object consisting of an ID, source type, source ARN, a sink +// type, a sink ARN, and a configuration object. type MediaCapturePipeline struct { - // The configuration for a specified media capture pipeline. SourceType must be + // The configuration for a specified media pipeline. SourceType must be // ChimeSdkMeeting. ChimeSdkMeetingConfiguration *ChimeSdkMeetingConfiguration - // The time at which the capture pipeline was created, in ISO 8601 format. + // The time at which the pipeline was created, in ISO 8601 format. CreatedTimestamp *time.Time - // The ARN of a media capture pipeline. + // The ARN of the media capture pipeline MediaPipelineArn *string - // The ID of a media capture pipeline. + // The ID of a media pipeline. MediaPipelineId *string // ARN of the destination to which the media artifacts are saved. @@ -96,59 +335,190 @@ type MediaCapturePipeline struct { // Source type from which media artifacts are saved. You must use ChimeMeeting. SourceType MediaPipelineSourceType - // The status of the media capture pipeline. + // The status of the media pipeline. Status MediaPipelineStatus - // The time at which the capture pipeline was updated, in ISO 8601 format. + // The time at which the pipeline was updated, in ISO 8601 format. UpdatedTimestamp *time.Time noSmithyDocumentSerde } -// A summary of a media capture pipeline. +// The source configuration object of a media capture pipeline. +type MediaCapturePipelineSourceConfiguration struct { + + // The meeting configuration settings in a media capture pipeline configuration + // object. + // + // This member is required. + ChimeSdkMeetingConfiguration *ChimeSdkMeetingConcatenationConfiguration + + // The media pipeline ARN in the configuration object of a media capture pipeline. + // + // This member is required. + MediaPipelineArn *string + + noSmithyDocumentSerde +} + +// The summary data of a media capture pipeline. type MediaCapturePipelineSummary struct { - // The ARN of a media capture pipeline. + // The ARN of the media pipeline in the summary. MediaPipelineArn *string - // The ID of a media capture pipeline. + // The ID of the media pipeline in the summary. MediaPipelineId *string noSmithyDocumentSerde } -// The video streams to capture for a specified media capture pipeline. The total -// number of video streams can't exceed 25. +// Concatenates audio and video data from one or more data streams. +type MediaConcatenationPipeline struct { + + // The time at which the concatenation pipeline was created. + CreatedTimestamp *time.Time + + // The ARN of the media pipeline that you specify in the SourceConfiguration + // object. + MediaPipelineArn *string + + // The ID of the media pipeline being concatenated. + MediaPipelineId *string + + // The data sinks of the concatenation pipeline. + Sinks []ConcatenationSink + + // The data sources being concatnated. + Sources []ConcatenationSource + + // The status of the concatenation pipeline. + Status MediaPipelineStatus + + // The time at which the concatenation pipeline was last updated. + UpdatedTimestamp *time.Time + + noSmithyDocumentSerde +} + +// The connector pipeline. +type MediaLiveConnectorPipeline struct { + + // Thetime at which the connector pipeline was created. + CreatedTimestamp *time.Time + + // The connector pipeline's ARN. + MediaPipelineArn *string + + // The connector pipeline's ID. + MediaPipelineId *string + + // The connector pipeline's data sinks. + Sinks []LiveConnectorSinkConfiguration + + // The connector pipeline's data sources. + Sources []LiveConnectorSourceConfiguration + + // The connector pipeline's status. + Status MediaPipelineStatus + + // The time at which the connector pipeline was last updated. + UpdatedTimestamp *time.Time + + noSmithyDocumentSerde +} + +// A pipeline consisting of a media capture, media concatenation, or live-streaming +// pipeline. +type MediaPipeline struct { + + // A pipeline that enables users to capture audio and video. + MediaCapturePipeline *MediaCapturePipeline + + // The media concatenation pipeline in a media pipeline. + MediaConcatenationPipeline *MediaConcatenationPipeline + + // The connector pipeline of the media pipeline. + MediaLiveConnectorPipeline *MediaLiveConnectorPipeline + + noSmithyDocumentSerde +} + +// The summary of the media pipeline. +type MediaPipelineSummary struct { + + // The ARN of the media pipeline in the summary. + MediaPipelineArn *string + + // The ID of the media pipeline in the summary. + MediaPipelineId *string + + noSmithyDocumentSerde +} + +// The configuration object for an event concatenation pipeline. +type MeetingEventsConcatenationConfiguration struct { + + // Enables or disables the configuration object. + // + // This member is required. + State ArtifactsConcatenationState + + noSmithyDocumentSerde +} + +// Defines the configuration for a presenter only video tile. +type PresenterOnlyConfiguration struct { + + // Defines the position of the presenter video tile. Default: TopRight. + PresenterPosition PresenterPosition + + noSmithyDocumentSerde +} + +// The configuration settings for the S3 bucket. +type S3BucketSinkConfiguration struct { + + // The destination URL of the S3 bucket. + // + // This member is required. + Destination *string + + noSmithyDocumentSerde +} + +// The video streams for a specified media pipeline. The total number of video +// streams can't exceed 25. type SelectedVideoStreams struct { - // The attendee IDs of the streams selected for a media capture pipeline. + // The attendee IDs of the streams selected for a media pipeline. AttendeeIds []string - // The external user IDs of the streams selected for a media capture pipeline. + // The external user IDs of the streams selected for a media pipeline. ExternalUserIds []string noSmithyDocumentSerde } -// Source configuration for a specified media capture pipeline. +// Source configuration for a specified media pipeline. type SourceConfiguration struct { - // The selected video streams to capture for a specified media capture pipeline. - // The number of video streams can't exceed 25. + // The selected video streams for a specified media pipeline. The number of video + // streams can't exceed 25. SelectedVideoStreams *SelectedVideoStreams noSmithyDocumentSerde } -// Describes a tag applied to a resource. +// A key/value pair that grants users access to meeting resources. type Tag struct { - // The key of the tag. + // The key half of a tag. // // This member is required. Key *string - // The value of the tag. + // The value half of a tag. // // This member is required. Value *string @@ -156,6 +526,17 @@ type Tag struct { noSmithyDocumentSerde } +// The configuration object for concatenating transcription messages. +type TranscriptionMessagesConcatenationConfiguration struct { + + // Enables or disables the configuration object. + // + // This member is required. + State ArtifactsConcatenationState + + noSmithyDocumentSerde +} + // The video artifact configuration object. type VideoArtifactsConfiguration struct { @@ -170,4 +551,15 @@ type VideoArtifactsConfiguration struct { noSmithyDocumentSerde } +// The configuration object of a video contacatentation pipeline. +type VideoConcatenationConfiguration struct { + + // Enables or disables the configuration object. + // + // This member is required. + State ArtifactsConcatenationState + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/chimesdkmediapipelines/validators.go b/service/chimesdkmediapipelines/validators.go index 25b6ded8e33..3da56371b03 100644 --- a/service/chimesdkmediapipelines/validators.go +++ b/service/chimesdkmediapipelines/validators.go @@ -30,6 +30,46 @@ func (m *validateOpCreateMediaCapturePipeline) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpCreateMediaConcatenationPipeline struct { +} + +func (*validateOpCreateMediaConcatenationPipeline) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateMediaConcatenationPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateMediaConcatenationPipelineInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateMediaConcatenationPipelineInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateMediaLiveConnectorPipeline struct { +} + +func (*validateOpCreateMediaLiveConnectorPipeline) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateMediaLiveConnectorPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateMediaLiveConnectorPipelineInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateMediaLiveConnectorPipelineInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteMediaCapturePipeline struct { } @@ -50,6 +90,26 @@ func (m *validateOpDeleteMediaCapturePipeline) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpDeleteMediaPipeline struct { +} + +func (*validateOpDeleteMediaPipeline) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteMediaPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteMediaPipelineInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteMediaPipelineInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetMediaCapturePipeline struct { } @@ -70,6 +130,26 @@ func (m *validateOpGetMediaCapturePipeline) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpGetMediaPipeline struct { +} + +func (*validateOpGetMediaPipeline) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetMediaPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetMediaPipelineInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetMediaPipelineInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -134,14 +214,30 @@ func addOpCreateMediaCapturePipelineValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpCreateMediaCapturePipeline{}, middleware.After) } +func addOpCreateMediaConcatenationPipelineValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateMediaConcatenationPipeline{}, middleware.After) +} + +func addOpCreateMediaLiveConnectorPipelineValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateMediaLiveConnectorPipeline{}, middleware.After) +} + func addOpDeleteMediaCapturePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMediaCapturePipeline{}, middleware.After) } +func addOpDeleteMediaPipelineValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteMediaPipeline{}, middleware.After) +} + func addOpGetMediaCapturePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetMediaCapturePipeline{}, middleware.After) } +func addOpGetMediaPipelineValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetMediaPipeline{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -154,6 +250,67 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func validateArtifactsConcatenationConfiguration(v *types.ArtifactsConcatenationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ArtifactsConcatenationConfiguration"} + if v.Audio == nil { + invalidParams.Add(smithy.NewErrParamRequired("Audio")) + } else if v.Audio != nil { + if err := validateAudioConcatenationConfiguration(v.Audio); err != nil { + invalidParams.AddNested("Audio", err.(smithy.InvalidParamsError)) + } + } + if v.Video == nil { + invalidParams.Add(smithy.NewErrParamRequired("Video")) + } else if v.Video != nil { + if err := validateVideoConcatenationConfiguration(v.Video); err != nil { + invalidParams.AddNested("Video", err.(smithy.InvalidParamsError)) + } + } + if v.Content == nil { + invalidParams.Add(smithy.NewErrParamRequired("Content")) + } else if v.Content != nil { + if err := validateContentConcatenationConfiguration(v.Content); err != nil { + invalidParams.AddNested("Content", err.(smithy.InvalidParamsError)) + } + } + if v.DataChannel == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataChannel")) + } else if v.DataChannel != nil { + if err := validateDataChannelConcatenationConfiguration(v.DataChannel); err != nil { + invalidParams.AddNested("DataChannel", err.(smithy.InvalidParamsError)) + } + } + if v.TranscriptionMessages == nil { + invalidParams.Add(smithy.NewErrParamRequired("TranscriptionMessages")) + } else if v.TranscriptionMessages != nil { + if err := validateTranscriptionMessagesConcatenationConfiguration(v.TranscriptionMessages); err != nil { + invalidParams.AddNested("TranscriptionMessages", err.(smithy.InvalidParamsError)) + } + } + if v.MeetingEvents == nil { + invalidParams.Add(smithy.NewErrParamRequired("MeetingEvents")) + } else if v.MeetingEvents != nil { + if err := validateMeetingEventsConcatenationConfiguration(v.MeetingEvents); err != nil { + invalidParams.AddNested("MeetingEvents", err.(smithy.InvalidParamsError)) + } + } + if v.CompositedVideo == nil { + invalidParams.Add(smithy.NewErrParamRequired("CompositedVideo")) + } else if v.CompositedVideo != nil { + if err := validateCompositedVideoConcatenationConfiguration(v.CompositedVideo); err != nil { + invalidParams.AddNested("CompositedVideo", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateArtifactsConfiguration(v *types.ArtifactsConfiguration) error { if v == nil { return nil @@ -180,6 +337,11 @@ func validateArtifactsConfiguration(v *types.ArtifactsConfiguration) error { invalidParams.AddNested("Content", err.(smithy.InvalidParamsError)) } } + if v.CompositedVideo != nil { + if err := validateCompositedVideoArtifactsConfiguration(v.CompositedVideo); err != nil { + invalidParams.AddNested("CompositedVideo", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -202,6 +364,40 @@ func validateAudioArtifactsConfiguration(v *types.AudioArtifactsConfiguration) e } } +func validateAudioConcatenationConfiguration(v *types.AudioConcatenationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AudioConcatenationConfiguration"} + if len(v.State) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateChimeSdkMeetingConcatenationConfiguration(v *types.ChimeSdkMeetingConcatenationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ChimeSdkMeetingConcatenationConfiguration"} + if v.ArtifactsConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("ArtifactsConfiguration")) + } else if v.ArtifactsConfiguration != nil { + if err := validateArtifactsConcatenationConfiguration(v.ArtifactsConfiguration); err != nil { + invalidParams.AddNested("ArtifactsConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateChimeSdkMeetingConfiguration(v *types.ChimeSdkMeetingConfiguration) error { if v == nil { return nil @@ -219,6 +415,141 @@ func validateChimeSdkMeetingConfiguration(v *types.ChimeSdkMeetingConfiguration) } } +func validateChimeSdkMeetingLiveConnectorConfiguration(v *types.ChimeSdkMeetingLiveConnectorConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ChimeSdkMeetingLiveConnectorConfiguration"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if len(v.MuxType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("MuxType")) + } + if v.CompositedVideo != nil { + if err := validateCompositedVideoArtifactsConfiguration(v.CompositedVideo); err != nil { + invalidParams.AddNested("CompositedVideo", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCompositedVideoArtifactsConfiguration(v *types.CompositedVideoArtifactsConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CompositedVideoArtifactsConfiguration"} + if v.GridViewConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("GridViewConfiguration")) + } else if v.GridViewConfiguration != nil { + if err := validateGridViewConfiguration(v.GridViewConfiguration); err != nil { + invalidParams.AddNested("GridViewConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCompositedVideoConcatenationConfiguration(v *types.CompositedVideoConcatenationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CompositedVideoConcatenationConfiguration"} + if len(v.State) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConcatenationSink(v *types.ConcatenationSink) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConcatenationSink"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.S3BucketSinkConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3BucketSinkConfiguration")) + } else if v.S3BucketSinkConfiguration != nil { + if err := validateS3BucketSinkConfiguration(v.S3BucketSinkConfiguration); err != nil { + invalidParams.AddNested("S3BucketSinkConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConcatenationSinkList(v []types.ConcatenationSink) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConcatenationSinkList"} + for i := range v { + if err := validateConcatenationSink(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConcatenationSource(v *types.ConcatenationSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConcatenationSource"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.MediaCapturePipelineSourceConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("MediaCapturePipelineSourceConfiguration")) + } else if v.MediaCapturePipelineSourceConfiguration != nil { + if err := validateMediaCapturePipelineSourceConfiguration(v.MediaCapturePipelineSourceConfiguration); err != nil { + invalidParams.AddNested("MediaCapturePipelineSourceConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConcatenationSourceList(v []types.ConcatenationSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConcatenationSourceList"} + for i := range v { + if err := validateConcatenationSource(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateContentArtifactsConfiguration(v *types.ContentArtifactsConfiguration) error { if v == nil { return nil @@ -234,6 +565,196 @@ func validateContentArtifactsConfiguration(v *types.ContentArtifactsConfiguratio } } +func validateContentConcatenationConfiguration(v *types.ContentConcatenationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ContentConcatenationConfiguration"} + if len(v.State) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDataChannelConcatenationConfiguration(v *types.DataChannelConcatenationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataChannelConcatenationConfiguration"} + if len(v.State) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateGridViewConfiguration(v *types.GridViewConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GridViewConfiguration"} + if len(v.ContentShareLayout) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ContentShareLayout")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLiveConnectorRTMPConfiguration(v *types.LiveConnectorRTMPConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LiveConnectorRTMPConfiguration"} + if v.Url == nil { + invalidParams.Add(smithy.NewErrParamRequired("Url")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLiveConnectorSinkConfiguration(v *types.LiveConnectorSinkConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LiveConnectorSinkConfiguration"} + if len(v.SinkType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SinkType")) + } + if v.RTMPConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("RTMPConfiguration")) + } else if v.RTMPConfiguration != nil { + if err := validateLiveConnectorRTMPConfiguration(v.RTMPConfiguration); err != nil { + invalidParams.AddNested("RTMPConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLiveConnectorSinkList(v []types.LiveConnectorSinkConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LiveConnectorSinkList"} + for i := range v { + if err := validateLiveConnectorSinkConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLiveConnectorSourceConfiguration(v *types.LiveConnectorSourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LiveConnectorSourceConfiguration"} + if len(v.SourceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SourceType")) + } + if v.ChimeSdkMeetingLiveConnectorConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("ChimeSdkMeetingLiveConnectorConfiguration")) + } else if v.ChimeSdkMeetingLiveConnectorConfiguration != nil { + if err := validateChimeSdkMeetingLiveConnectorConfiguration(v.ChimeSdkMeetingLiveConnectorConfiguration); err != nil { + invalidParams.AddNested("ChimeSdkMeetingLiveConnectorConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLiveConnectorSourceList(v []types.LiveConnectorSourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LiveConnectorSourceList"} + for i := range v { + if err := validateLiveConnectorSourceConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMediaCapturePipelineSourceConfiguration(v *types.MediaCapturePipelineSourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MediaCapturePipelineSourceConfiguration"} + if v.MediaPipelineArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("MediaPipelineArn")) + } + if v.ChimeSdkMeetingConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("ChimeSdkMeetingConfiguration")) + } else if v.ChimeSdkMeetingConfiguration != nil { + if err := validateChimeSdkMeetingConcatenationConfiguration(v.ChimeSdkMeetingConfiguration); err != nil { + invalidParams.AddNested("ChimeSdkMeetingConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMeetingEventsConcatenationConfiguration(v *types.MeetingEventsConcatenationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MeetingEventsConcatenationConfiguration"} + if len(v.State) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateS3BucketSinkConfiguration(v *types.S3BucketSinkConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "S3BucketSinkConfiguration"} + if v.Destination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -269,6 +790,21 @@ func validateTagList(v []types.Tag) error { } } +func validateTranscriptionMessagesConcatenationConfiguration(v *types.TranscriptionMessagesConcatenationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TranscriptionMessagesConcatenationConfiguration"} + if len(v.State) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateVideoArtifactsConfiguration(v *types.VideoArtifactsConfiguration) error { if v == nil { return nil @@ -284,6 +820,21 @@ func validateVideoArtifactsConfiguration(v *types.VideoArtifactsConfiguration) e } } +func validateVideoConcatenationConfiguration(v *types.VideoConcatenationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VideoConcatenationConfiguration"} + if len(v.State) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateMediaCapturePipelineInput(v *CreateMediaCapturePipelineInput) error { if v == nil { return nil @@ -318,6 +869,68 @@ func validateOpCreateMediaCapturePipelineInput(v *CreateMediaCapturePipelineInpu } } +func validateOpCreateMediaConcatenationPipelineInput(v *CreateMediaConcatenationPipelineInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateMediaConcatenationPipelineInput"} + if v.Sources == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sources")) + } else if v.Sources != nil { + if err := validateConcatenationSourceList(v.Sources); err != nil { + invalidParams.AddNested("Sources", err.(smithy.InvalidParamsError)) + } + } + if v.Sinks == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sinks")) + } else if v.Sinks != nil { + if err := validateConcatenationSinkList(v.Sinks); err != nil { + invalidParams.AddNested("Sinks", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateMediaLiveConnectorPipelineInput(v *CreateMediaLiveConnectorPipelineInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateMediaLiveConnectorPipelineInput"} + if v.Sources == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sources")) + } else if v.Sources != nil { + if err := validateLiveConnectorSourceList(v.Sources); err != nil { + invalidParams.AddNested("Sources", err.(smithy.InvalidParamsError)) + } + } + if v.Sinks == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sinks")) + } else if v.Sinks != nil { + if err := validateLiveConnectorSinkList(v.Sinks); err != nil { + invalidParams.AddNested("Sinks", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteMediaCapturePipelineInput(v *DeleteMediaCapturePipelineInput) error { if v == nil { return nil @@ -333,6 +946,21 @@ func validateOpDeleteMediaCapturePipelineInput(v *DeleteMediaCapturePipelineInpu } } +func validateOpDeleteMediaPipelineInput(v *DeleteMediaPipelineInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteMediaPipelineInput"} + if v.MediaPipelineId == nil { + invalidParams.Add(smithy.NewErrParamRequired("MediaPipelineId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetMediaCapturePipelineInput(v *GetMediaCapturePipelineInput) error { if v == nil { return nil @@ -348,6 +976,21 @@ func validateOpGetMediaCapturePipelineInput(v *GetMediaCapturePipelineInput) err } } +func validateOpGetMediaPipelineInput(v *GetMediaPipelineInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetMediaPipelineInput"} + if v.MediaPipelineId == nil { + invalidParams.Add(smithy.NewErrParamRequired("MediaPipelineId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil diff --git a/service/cloudwatch/api_op_DescribeAnomalyDetectors.go b/service/cloudwatch/api_op_DescribeAnomalyDetectors.go index 09922da7e21..47dcd1519bb 100644 --- a/service/cloudwatch/api_op_DescribeAnomalyDetectors.go +++ b/service/cloudwatch/api_op_DescribeAnomalyDetectors.go @@ -4,6 +4,7 @@ package cloudwatch 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/cloudwatch/types" @@ -142,6 +143,100 @@ func (c *Client) addOperationDescribeAnomalyDetectorsMiddlewares(stack *middlewa return nil } +// DescribeAnomalyDetectorsAPIClient is a client that implements the +// DescribeAnomalyDetectors operation. +type DescribeAnomalyDetectorsAPIClient interface { + DescribeAnomalyDetectors(context.Context, *DescribeAnomalyDetectorsInput, ...func(*Options)) (*DescribeAnomalyDetectorsOutput, error) +} + +var _ DescribeAnomalyDetectorsAPIClient = (*Client)(nil) + +// DescribeAnomalyDetectorsPaginatorOptions is the paginator options for +// DescribeAnomalyDetectors +type DescribeAnomalyDetectorsPaginatorOptions struct { + // The maximum number of results to return in one operation. The maximum value that + // you can specify is 100. To retrieve the remaining results, make another call + // with the returned NextToken value. + 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 +} + +// DescribeAnomalyDetectorsPaginator is a paginator for DescribeAnomalyDetectors +type DescribeAnomalyDetectorsPaginator struct { + options DescribeAnomalyDetectorsPaginatorOptions + client DescribeAnomalyDetectorsAPIClient + params *DescribeAnomalyDetectorsInput + nextToken *string + firstPage bool +} + +// NewDescribeAnomalyDetectorsPaginator returns a new +// DescribeAnomalyDetectorsPaginator +func NewDescribeAnomalyDetectorsPaginator(client DescribeAnomalyDetectorsAPIClient, params *DescribeAnomalyDetectorsInput, optFns ...func(*DescribeAnomalyDetectorsPaginatorOptions)) *DescribeAnomalyDetectorsPaginator { + if params == nil { + params = &DescribeAnomalyDetectorsInput{} + } + + options := DescribeAnomalyDetectorsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeAnomalyDetectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAnomalyDetectorsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeAnomalyDetectors page. +func (p *DescribeAnomalyDetectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAnomalyDetectorsOutput, 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.DescribeAnomalyDetectors(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_opDescribeAnomalyDetectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_GetMetricStream.go b/service/cloudwatch/api_op_GetMetricStream.go index 0133e3192d4..74929c4e693 100644 --- a/service/cloudwatch/api_op_GetMetricStream.go +++ b/service/cloudwatch/api_op_GetMetricStream.go @@ -67,7 +67,7 @@ type GetMetricStreamOutput struct { Name *string // The output format for the stream. Valid values are json and opentelemetry0.7. - // For more information about metric stream output formats, see Metric streams + // For more information about metric stream output formats, see Metric streams // output formats // (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html). OutputFormat types.MetricStreamOutputFormat diff --git a/service/cloudwatch/api_op_ListManagedInsightRules.go b/service/cloudwatch/api_op_ListManagedInsightRules.go new file mode 100644 index 00000000000..039d968feae --- /dev/null +++ b/service/cloudwatch/api_op_ListManagedInsightRules.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatch + +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/cloudwatch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list that contains the number of managed Contributor Insights rules in +// your account. +func (c *Client) ListManagedInsightRules(ctx context.Context, params *ListManagedInsightRulesInput, optFns ...func(*Options)) (*ListManagedInsightRulesOutput, error) { + if params == nil { + params = &ListManagedInsightRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListManagedInsightRules", params, optFns, c.addOperationListManagedInsightRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListManagedInsightRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListManagedInsightRulesInput struct { + + // The ARN of an Amazon Web Services resource that has managed Contributor Insights + // rules. + // + // This member is required. + ResourceARN *string + + // The maximum number of results to return in one operation. If you omit this + // parameter, the default number is used. The default number is 100. + MaxResults *int32 + + // Include this value to get the next set of rules if the value was returned by the + // previous operation. + NextToken *string + + noSmithyDocumentSerde +} + +type ListManagedInsightRulesOutput struct { + + // The managed rules that are available for the specified Amazon Web Services + // resource. + ManagedRules []types.ManagedRuleDescription + + // Include this value to get the next set of rules if the value was returned by the + // previous operation. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListManagedInsightRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsquery_serializeOpListManagedInsightRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListManagedInsightRules{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListManagedInsightRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListManagedInsightRules(options.Region), middleware.Before); 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 + } + return nil +} + +// ListManagedInsightRulesAPIClient is a client that implements the +// ListManagedInsightRules operation. +type ListManagedInsightRulesAPIClient interface { + ListManagedInsightRules(context.Context, *ListManagedInsightRulesInput, ...func(*Options)) (*ListManagedInsightRulesOutput, error) +} + +var _ ListManagedInsightRulesAPIClient = (*Client)(nil) + +// ListManagedInsightRulesPaginatorOptions is the paginator options for +// ListManagedInsightRules +type ListManagedInsightRulesPaginatorOptions struct { + // The maximum number of results to return in one operation. If you omit this + // parameter, the default number is used. The default number is 100. + 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 +} + +// ListManagedInsightRulesPaginator is a paginator for ListManagedInsightRules +type ListManagedInsightRulesPaginator struct { + options ListManagedInsightRulesPaginatorOptions + client ListManagedInsightRulesAPIClient + params *ListManagedInsightRulesInput + nextToken *string + firstPage bool +} + +// NewListManagedInsightRulesPaginator returns a new +// ListManagedInsightRulesPaginator +func NewListManagedInsightRulesPaginator(client ListManagedInsightRulesAPIClient, params *ListManagedInsightRulesInput, optFns ...func(*ListManagedInsightRulesPaginatorOptions)) *ListManagedInsightRulesPaginator { + if params == nil { + params = &ListManagedInsightRulesInput{} + } + + options := ListManagedInsightRulesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListManagedInsightRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListManagedInsightRulesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListManagedInsightRules page. +func (p *ListManagedInsightRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListManagedInsightRulesOutput, 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.ListManagedInsightRules(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_opListManagedInsightRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "monitoring", + OperationName: "ListManagedInsightRules", + } +} diff --git a/service/cloudwatch/api_op_PutManagedInsightRules.go b/service/cloudwatch/api_op_PutManagedInsightRules.go new file mode 100644 index 00000000000..b5165e88db3 --- /dev/null +++ b/service/cloudwatch/api_op_PutManagedInsightRules.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatch + +import ( + "context" + 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/cloudwatch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a managed Contributor Insights rule for a specified Amazon Web Services +// resource. When you enable a managed rule, you create a Contributor Insights rule +// that collects data from Amazon Web Services services. You cannot edit these +// rules with PutInsightRule. The rules can be enabled, disabled, and deleted using +// EnableInsightRules, DisableInsightRules, and DeleteInsightRules. If a previously +// created managed rule is currently disabled, a subsequent call to this API will +// re-enable it. Use ListManagedInsightRules to describe all available rules. +func (c *Client) PutManagedInsightRules(ctx context.Context, params *PutManagedInsightRulesInput, optFns ...func(*Options)) (*PutManagedInsightRulesOutput, error) { + if params == nil { + params = &PutManagedInsightRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutManagedInsightRules", params, optFns, c.addOperationPutManagedInsightRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutManagedInsightRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutManagedInsightRulesInput struct { + + // A list of ManagedRules to enable. + // + // This member is required. + ManagedRules []types.ManagedRule + + noSmithyDocumentSerde +} + +type PutManagedInsightRulesOutput struct { + + // An array that lists the rules that could not be enabled. + Failures []types.PartialFailure + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutManagedInsightRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsquery_serializeOpPutManagedInsightRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpPutManagedInsightRules{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutManagedInsightRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutManagedInsightRules(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opPutManagedInsightRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "monitoring", + OperationName: "PutManagedInsightRules", + } +} diff --git a/service/cloudwatch/deserializers.go b/service/cloudwatch/deserializers.go index ad8e301f103..b9f6195a940 100644 --- a/service/cloudwatch/deserializers.go +++ b/service/cloudwatch/deserializers.go @@ -2257,6 +2257,120 @@ func awsAwsquery_deserializeOpErrorListDashboards(response *smithyhttp.Response, } } +type awsAwsquery_deserializeOpListManagedInsightRules struct { +} + +func (*awsAwsquery_deserializeOpListManagedInsightRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListManagedInsightRules) 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, awsAwsquery_deserializeOpErrorListManagedInsightRules(response, &metadata) + } + output := &ListManagedInsightRulesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ListManagedInsightRulesResult") + 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 + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListManagedInsightRulesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorListManagedInsightRules(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidNextToken", errorCode): + return awsAwsquery_deserializeErrorInvalidNextToken(response, errorBody) + + case strings.EqualFold("InvalidParameterValue", errorCode): + return awsAwsquery_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("MissingParameter", errorCode): + return awsAwsquery_deserializeErrorMissingRequiredParameterException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpListMetrics struct { } @@ -3017,6 +3131,117 @@ func awsAwsquery_deserializeOpErrorPutInsightRule(response *smithyhttp.Response, } } +type awsAwsquery_deserializeOpPutManagedInsightRules struct { +} + +func (*awsAwsquery_deserializeOpPutManagedInsightRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpPutManagedInsightRules) 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, awsAwsquery_deserializeOpErrorPutManagedInsightRules(response, &metadata) + } + output := &PutManagedInsightRulesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("PutManagedInsightRulesResult") + 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 + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentPutManagedInsightRulesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorPutManagedInsightRules(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidParameterValue", errorCode): + return awsAwsquery_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("MissingParameter", errorCode): + return awsAwsquery_deserializeErrorMissingRequiredParameterException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpPutMetricAlarm struct { } @@ -6339,6 +6564,22 @@ func awsAwsquery_deserializeDocumentInsightRule(v **types.InsightRule, decoder s sv.Definition = ptr.String(xtv) } + case strings.EqualFold("ManagedRule", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected InsightRuleIsManaged to be of type *bool, got %T instead", val) + } + sv.ManagedRule = xtv + } + case strings.EqualFold("Name", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -7474,6 +7715,204 @@ func awsAwsquery_deserializeDocumentLimitExceededFault(v **types.LimitExceededFa return nil } +func awsAwsquery_deserializeDocumentManagedRuleDescription(v **types.ManagedRuleDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ManagedRuleDescription + if *v == nil { + sv = &types.ManagedRuleDescription{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ResourceARN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceARN = ptr.String(xtv) + } + + case strings.EqualFold("RuleState", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentManagedRuleState(&sv.RuleState, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TemplateName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TemplateName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentManagedRuleDescriptions(v *[]types.ManagedRuleDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ManagedRuleDescription + if *v == nil { + sv = make([]types.ManagedRuleDescription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.ManagedRuleDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentManagedRuleDescription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentManagedRuleDescriptionsUnwrapped(v *[]types.ManagedRuleDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.ManagedRuleDescription + if *v == nil { + sv = make([]types.ManagedRuleDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ManagedRuleDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentManagedRuleDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentManagedRuleState(v **types.ManagedRuleState, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ManagedRuleState + if *v == nil { + sv = &types.ManagedRuleState{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("RuleName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RuleName = ptr.String(xtv) + } + + case strings.EqualFold("State", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeDocumentMessageData(v **types.MessageData, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11095,6 +11534,61 @@ func awsAwsquery_deserializeOpDocumentListDashboardsOutput(v **ListDashboardsOut return nil } +func awsAwsquery_deserializeOpDocumentListManagedInsightRulesOutput(v **ListManagedInsightRulesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListManagedInsightRulesOutput + if *v == nil { + sv = &ListManagedInsightRulesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ManagedRules", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentManagedRuleDescriptions(&sv.ManagedRules, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeOpDocumentListMetricsOutput(v **ListMetricsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11361,6 +11855,48 @@ func awsAwsquery_deserializeOpDocumentPutInsightRuleOutput(v **PutInsightRuleOut return nil } +func awsAwsquery_deserializeOpDocumentPutManagedInsightRulesOutput(v **PutManagedInsightRulesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *PutManagedInsightRulesOutput + if *v == nil { + sv = &PutManagedInsightRulesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Failures", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentBatchFailures(&sv.Failures, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeOpDocumentPutMetricStreamOutput(v **PutMetricStreamOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/cloudwatch/generated.json b/service/cloudwatch/generated.json index a38e85addc5..64010530502 100644 --- a/service/cloudwatch/generated.json +++ b/service/cloudwatch/generated.json @@ -30,6 +30,7 @@ "api_op_GetMetricStream.go", "api_op_GetMetricWidgetImage.go", "api_op_ListDashboards.go", + "api_op_ListManagedInsightRules.go", "api_op_ListMetricStreams.go", "api_op_ListMetrics.go", "api_op_ListTagsForResource.go", @@ -37,6 +38,7 @@ "api_op_PutCompositeAlarm.go", "api_op_PutDashboard.go", "api_op_PutInsightRule.go", + "api_op_PutManagedInsightRules.go", "api_op_PutMetricAlarm.go", "api_op_PutMetricData.go", "api_op_PutMetricStream.go", diff --git a/service/cloudwatch/serializers.go b/service/cloudwatch/serializers.go index b43db5e270b..8888e8d8656 100644 --- a/service/cloudwatch/serializers.go +++ b/service/cloudwatch/serializers.go @@ -1361,6 +1361,70 @@ func (m *awsAwsquery_serializeOpListDashboards) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpListManagedInsightRules struct { +} + +func (*awsAwsquery_serializeOpListManagedInsightRules) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListManagedInsightRules) 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.(*ListManagedInsightRulesInput) + _ = 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-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ListManagedInsightRules") + body.Key("Version").String("2010-08-01") + + if err := awsAwsquery_serializeOpDocumentListManagedInsightRulesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpListMetrics struct { } @@ -1809,6 +1873,70 @@ func (m *awsAwsquery_serializeOpPutInsightRule) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpPutManagedInsightRules struct { +} + +func (*awsAwsquery_serializeOpPutManagedInsightRules) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpPutManagedInsightRules) 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.(*PutManagedInsightRulesInput) + _ = 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-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("PutManagedInsightRules") + body.Key("Version").String("2010-08-01") + + if err := awsAwsquery_serializeOpDocumentPutManagedInsightRulesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpPutMetricAlarm struct { } @@ -2547,6 +2675,45 @@ func awsAwsquery_serializeDocumentLabelOptions(v *types.LabelOptions, value quer return nil } +func awsAwsquery_serializeDocumentManagedRule(v *types.ManagedRule, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceARN != nil { + objectKey := object.Key("ResourceARN") + objectKey.String(*v.ResourceARN) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TemplateName != nil { + objectKey := object.Key("TemplateName") + objectKey.String(*v.TemplateName) + } + + return nil +} + +func awsAwsquery_serializeDocumentManagedRules(v []types.ManagedRule, value query.Value) error { + if len(v) == 0 { + return nil + } + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentManagedRule(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsquery_serializeDocumentMetric(v *types.Metric, value query.Value) error { object := value.Object() _ = object @@ -3670,6 +3837,28 @@ func awsAwsquery_serializeOpDocumentListDashboardsInput(v *ListDashboardsInput, return nil } +func awsAwsquery_serializeOpDocumentListManagedInsightRulesInput(v *ListManagedInsightRulesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.MaxResults != nil { + objectKey := object.Key("MaxResults") + objectKey.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + if v.ResourceARN != nil { + objectKey := object.Key("ResourceARN") + objectKey.String(*v.ResourceARN) + } + + return nil +} + func awsAwsquery_serializeOpDocumentListMetricsInput(v *ListMetricsInput, value query.Value) error { object := value.Object() _ = object @@ -3899,6 +4088,20 @@ func awsAwsquery_serializeOpDocumentPutInsightRuleInput(v *PutInsightRuleInput, return nil } +func awsAwsquery_serializeOpDocumentPutManagedInsightRulesInput(v *PutManagedInsightRulesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ManagedRules != nil { + objectKey := object.Key("ManagedRules") + if err := awsAwsquery_serializeDocumentManagedRules(v.ManagedRules, objectKey); err != nil { + return err + } + } + + return nil +} + func awsAwsquery_serializeOpDocumentPutMetricAlarmInput(v *PutMetricAlarmInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/cloudwatch/types/types.go b/service/cloudwatch/types/types.go index e94e0c39bd6..95e2dc2e159 100644 --- a/service/cloudwatch/types/types.go +++ b/service/cloudwatch/types/types.go @@ -312,6 +312,9 @@ type InsightRule struct { // This member is required. State *string + // An optional built-in rule that Amazon Web Services manages. + ManagedRule bool + noSmithyDocumentSerde } @@ -430,6 +433,73 @@ type LabelOptions struct { noSmithyDocumentSerde } +// Contains the information that's required to enable a managed Contributor +// Insights rule for an Amazon Web Services resource. +type ManagedRule struct { + + // The ARN of an Amazon Web Services resource that has managed Contributor Insights + // rules. + // + // This member is required. + ResourceARN *string + + // The template name for the managed Contributor Insights rule, as returned by + // ListManagedInsightRules. + // + // This member is required. + TemplateName *string + + // A list of key-value pairs that you can associate with a managed Contributor + // Insights rule. You can associate as many as 50 tags with a rule. Tags can help + // you organize and categorize your resources. You also can use them to scope user + // permissions by granting a user permission to access or change only the resources + // that have certain tag values. To associate tags with a rule, you must have the + // cloudwatch:TagResource permission in addition to the cloudwatch:PutInsightRule + // permission. If you are using this operation to update an existing Contributor + // Insights rule, any tags that you specify in this parameter are ignored. To + // change the tags of an existing rule, use TagResource. + Tags []Tag + + noSmithyDocumentSerde +} + +// Contains information about managed Contributor Insights rules, as returned by +// ListManagedInsightRules. +type ManagedRuleDescription struct { + + // If a managed rule is enabled, this is the ARN for the related Amazon Web + // Services resource. + ResourceARN *string + + // Describes the state of a managed rule. If present, it contains information about + // the Contributor Insights rule that contains information about the related Amazon + // Web Services resource. + RuleState *ManagedRuleState + + // The template name for the managed rule. Used to enable managed rules using + // PutManagedInsightRules. + TemplateName *string + + noSmithyDocumentSerde +} + +// The status of a managed Contributor Insights rule. +type ManagedRuleState struct { + + // The name of the Contributor Insights rule that contains data for the specified + // Amazon Web Services resource. + // + // This member is required. + RuleName *string + + // Indicates whether the rule is enabled or disabled. + // + // This member is required. + State *string + + noSmithyDocumentSerde +} + // A message returned by the GetMetricDataAPI, including a code and a description. // If a cross-Region GetMetricData operation fails with a code of Forbidden and a // value of Authentication too complex to retrieve cross region data, you can @@ -739,7 +809,7 @@ type MetricDatum struct { // Array of numbers representing the values for the metric during the period. Each // unique value is listed just once in this array, and the corresponding number in // the Counts array specifies the number of times that value occurred during the - // period. You can include up to 500 unique values in each PutMetricData action + // period. You can include up to 150 unique values in each PutMetricData action // that specifies a Values array. Although the Values array accepts numbers of type // Double, CloudWatch rejects values that are either too small or too large. Values // must be in the range of -2^360 to 2^360. In addition, special values (for diff --git a/service/cloudwatch/validators.go b/service/cloudwatch/validators.go index df14e800c8c..bf0e7108c46 100644 --- a/service/cloudwatch/validators.go +++ b/service/cloudwatch/validators.go @@ -350,6 +350,26 @@ func (m *validateOpGetMetricWidgetImage) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpListManagedInsightRules struct { +} + +func (*validateOpListManagedInsightRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListManagedInsightRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListManagedInsightRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListManagedInsightRulesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListMetrics struct { } @@ -470,6 +490,26 @@ func (m *validateOpPutInsightRule) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpPutManagedInsightRules struct { +} + +func (*validateOpPutManagedInsightRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutManagedInsightRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutManagedInsightRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutManagedInsightRulesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutMetricAlarm struct { } @@ -698,6 +738,10 @@ func addOpGetMetricWidgetImageValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpGetMetricWidgetImage{}, middleware.After) } +func addOpListManagedInsightRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListManagedInsightRules{}, middleware.After) +} + func addOpListMetricsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListMetrics{}, middleware.After) } @@ -722,6 +766,10 @@ func addOpPutInsightRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutInsightRule{}, middleware.After) } +func addOpPutManagedInsightRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutManagedInsightRules{}, middleware.After) +} + func addOpPutMetricAlarmValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutMetricAlarm{}, middleware.After) } @@ -855,6 +903,46 @@ func validateDimensions(v []types.Dimension) error { } } +func validateManagedRule(v *types.ManagedRule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ManagedRule"} + if v.TemplateName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateName")) + } + if v.ResourceARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARN")) + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateManagedRules(v []types.ManagedRule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ManagedRules"} + for i := range v { + if err := validateManagedRule(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateMetric(v *types.Metric) error { if v == nil { return nil @@ -1474,6 +1562,21 @@ func validateOpGetMetricWidgetImageInput(v *GetMetricWidgetImageInput) error { } } +func validateOpListManagedInsightRulesInput(v *ListManagedInsightRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListManagedInsightRulesInput"} + if v.ResourceARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListMetricsInput(v *ListMetricsInput) error { if v == nil { return nil @@ -1602,6 +1705,25 @@ func validateOpPutInsightRuleInput(v *PutInsightRuleInput) error { } } +func validateOpPutManagedInsightRulesInput(v *PutManagedInsightRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutManagedInsightRulesInput"} + if v.ManagedRules == nil { + invalidParams.Add(smithy.NewErrParamRequired("ManagedRules")) + } else if v.ManagedRules != nil { + if err := validateManagedRules(v.ManagedRules); err != nil { + invalidParams.AddNested("ManagedRules", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutMetricAlarmInput(v *PutMetricAlarmInput) error { if v == nil { return nil diff --git a/service/cognitoidentityprovider/types/enums.go b/service/cognitoidentityprovider/types/enums.go index e8352dd19d7..0492cbc30d8 100644 --- a/service/cognitoidentityprovider/types/enums.go +++ b/service/cognitoidentityprovider/types/enums.go @@ -358,8 +358,9 @@ type EventResponseType string // Enum values for EventResponseType const ( - EventResponseTypeSuccess EventResponseType = "Success" - EventResponseTypeFailure EventResponseType = "Failure" + EventResponseTypePass EventResponseType = "Pass" + EventResponseTypeFail EventResponseType = "Fail" + EventResponseTypeInProgress EventResponseType = "InProgress" ) // Values returns all known values for EventResponseType. Note that this can be @@ -367,8 +368,9 @@ const ( // ordering of this slice is not guaranteed to be stable across updates. func (EventResponseType) Values() []EventResponseType { return []EventResponseType{ - "Success", - "Failure", + "Pass", + "Fail", + "InProgress", } } @@ -379,6 +381,8 @@ const ( EventTypeSignIn EventType = "SignIn" EventTypeSignUp EventType = "SignUp" EventTypeForgotPassword EventType = "ForgotPassword" + EventTypePasswordChange EventType = "PasswordChange" + EventTypeResendCode EventType = "ResendCode" ) // Values returns all known values for EventType. Note that this can be expanded in @@ -389,6 +393,8 @@ func (EventType) Values() []EventType { "SignIn", "SignUp", "ForgotPassword", + "PasswordChange", + "ResendCode", } } diff --git a/service/dynamodb/api_op_DescribeImport.go b/service/dynamodb/api_op_DescribeImport.go new file mode 100644 index 00000000000..8c3a3190692 --- /dev/null +++ b/service/dynamodb/api_op_DescribeImport.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dynamodb + +import ( + "context" + 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" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Represents the properties of the import. +func (c *Client) DescribeImport(ctx context.Context, params *DescribeImportInput, optFns ...func(*Options)) (*DescribeImportOutput, error) { + if params == nil { + params = &DescribeImportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeImport", params, optFns, c.addOperationDescribeImportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeImportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeImportInput struct { + + // The Amazon Resource Name (ARN) associated with the table you're importing to. + // + // This member is required. + ImportArn *string + + noSmithyDocumentSerde +} + +type DescribeImportOutput struct { + + // Represents the properties of the table created for the import, and parameters of + // the import. The import parameters include import status, how many items were + // processed, and how many errors were encountered. + // + // This member is required. + ImportTableDescription *types.ImportTableDescription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeImportMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeImport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeImport{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeImportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeImport(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeImport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "dynamodb", + OperationName: "DescribeImport", + } +} diff --git a/service/dynamodb/api_op_ExportTableToPointInTime.go b/service/dynamodb/api_op_ExportTableToPointInTime.go index b37ece15198..66f6821e62e 100644 --- a/service/dynamodb/api_op_ExportTableToPointInTime.go +++ b/service/dynamodb/api_op_ExportTableToPointInTime.go @@ -51,7 +51,7 @@ type ExportTableToPointInTimeInput struct { // token for more than 8 hours, or the result might not be idempotent. If you // submit a request with the same client token but a change in other parameters // within the 8-hour idempotency window, DynamoDB returns an - // IdempotentParameterMismatch exception. + // ImportConflictException. ClientToken *string // The format for the exported data. Valid values for ExportFormat are diff --git a/service/dynamodb/api_op_ImportTable.go b/service/dynamodb/api_op_ImportTable.go new file mode 100644 index 00000000000..763f8e49fa1 --- /dev/null +++ b/service/dynamodb/api_op_ImportTable.go @@ -0,0 +1,195 @@ +// 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" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Imports table data from an S3 bucket. +func (c *Client) ImportTable(ctx context.Context, params *ImportTableInput, optFns ...func(*Options)) (*ImportTableOutput, error) { + if params == nil { + params = &ImportTableInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ImportTable", params, optFns, c.addOperationImportTableMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ImportTableOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ImportTableInput struct { + + // The format of the source data. Valid values for ImportFormat are CSV, + // DYNAMODB_JSON or ION. + // + // This member is required. + InputFormat types.InputFormat + + // The S3 bucket that provides the source for the import. + // + // This member is required. + S3BucketSource *types.S3BucketSource + + // Parameters for the table to import the data into. + // + // This member is required. + TableCreationParameters *types.TableCreationParameters + + // Providing a ClientToken makes the call to ImportTableInput idempotent, meaning + // that multiple identical calls have the same effect as one single call. A client + // token is valid for 8 hours after the first request that uses it is completed. + // After 8 hours, any request with the same client token is treated as a new + // request. Do not resubmit the same request with the same client token for more + // than 8 hours, or the result might not be idempotent. If you submit a request + // with the same client token but a change in other parameters within the 8-hour + // idempotency window, DynamoDB returns an IdempotentParameterMismatch exception. + ClientToken *string + + // Type of compression to be used on the input coming from the imported table. + InputCompressionType types.InputCompressionType + + // Additional properties that specify how the input is formatted, + InputFormatOptions *types.InputFormatOptions + + noSmithyDocumentSerde +} + +type ImportTableOutput struct { + + // Represents the properties of the table created for the import, and parameters of + // the import. The import parameters include import status, how many items were + // processed, and how many errors were encountered. + // + // This member is required. + ImportTableDescription *types.ImportTableDescription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationImportTableMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpImportTable{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpImportTable{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opImportTableMiddleware(stack, options); err != nil { + return err + } + if err = addOpImportTableValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opImportTable(options.Region), middleware.Before); 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 + } + return nil +} + +type idempotencyToken_initializeOpImportTable struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpImportTable) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpImportTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*ImportTableInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *ImportTableInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opImportTableMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpImportTable{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opImportTable(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "dynamodb", + OperationName: "ImportTable", + } +} diff --git a/service/dynamodb/api_op_ListImports.go b/service/dynamodb/api_op_ListImports.go new file mode 100644 index 00000000000..df8575e134c --- /dev/null +++ b/service/dynamodb/api_op_ListImports.go @@ -0,0 +1,224 @@ +// 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" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists completed imports within the past 90 days. +func (c *Client) ListImports(ctx context.Context, params *ListImportsInput, optFns ...func(*Options)) (*ListImportsOutput, error) { + if params == nil { + params = &ListImportsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListImports", params, optFns, c.addOperationListImportsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListImportsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListImportsInput struct { + + // An optional string that, if supplied, must be copied from the output of a + // previous call to ListImports. When provided in this manner, the API fetches the + // next page of results. + NextToken *string + + // The number of ImportSummary objects returned in a single page. + PageSize *int32 + + // The Amazon Resource Name (ARN) associated with the table that was imported to. + TableArn *string + + noSmithyDocumentSerde +} + +type ListImportsOutput struct { + + // A list of ImportSummary objects. + ImportSummaryList []types.ImportSummary + + // If this value is returned, there are additional results to be displayed. To + // retrieve them, call ListImports again, with NextToken set to this value. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListImportsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListImports{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListImports{}, middleware.After) + if 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 = addHTTPSignerV4Middleware(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); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImports(options.Region), middleware.Before); 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 + } + return nil +} + +// ListImportsAPIClient is a client that implements the ListImports operation. +type ListImportsAPIClient interface { + ListImports(context.Context, *ListImportsInput, ...func(*Options)) (*ListImportsOutput, error) +} + +var _ ListImportsAPIClient = (*Client)(nil) + +// ListImportsPaginatorOptions is the paginator options for ListImports +type ListImportsPaginatorOptions struct { + // The number of ImportSummary objects returned in a single page. + 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 +} + +// ListImportsPaginator is a paginator for ListImports +type ListImportsPaginator struct { + options ListImportsPaginatorOptions + client ListImportsAPIClient + params *ListImportsInput + nextToken *string + firstPage bool +} + +// NewListImportsPaginator returns a new ListImportsPaginator +func NewListImportsPaginator(client ListImportsAPIClient, params *ListImportsInput, optFns ...func(*ListImportsPaginatorOptions)) *ListImportsPaginator { + if params == nil { + params = &ListImportsInput{} + } + + options := ListImportsPaginatorOptions{} + if params.PageSize != nil { + options.Limit = *params.PageSize + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListImportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImportsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListImports page. +func (p *ListImportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportsOutput, 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.PageSize = limit + + result, err := p.client.ListImports(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_opListImports(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "dynamodb", + OperationName: "ListImports", + } +} diff --git a/service/dynamodb/deserializers.go b/service/dynamodb/deserializers.go index 09c525d5f39..100bbedd5e6 100644 --- a/service/dynamodb/deserializers.go +++ b/service/dynamodb/deserializers.go @@ -1942,6 +1942,117 @@ func awsAwsjson10_deserializeOpErrorDescribeGlobalTableSettings(response *smithy } } +type awsAwsjson10_deserializeOpDescribeImport struct { +} + +func (*awsAwsjson10_deserializeOpDescribeImport) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDescribeImport) 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_deserializeOpErrorDescribeImport(response, &metadata) + } + output := &DescribeImportOutput{} + 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_deserializeOpDocumentDescribeImportOutput(&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_deserializeOpErrorDescribeImport(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ImportNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorImportNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpDescribeKinesisStreamingDestination struct { } @@ -3277,14 +3388,14 @@ func awsAwsjson10_deserializeOpErrorGetItem(response *smithyhttp.Response, metad } } -type awsAwsjson10_deserializeOpListBackups struct { +type awsAwsjson10_deserializeOpImportTable struct { } -func (*awsAwsjson10_deserializeOpListBackups) ID() string { +func (*awsAwsjson10_deserializeOpImportTable) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListBackups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpImportTable) 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) @@ -3298,9 +3409,9 @@ func (m *awsAwsjson10_deserializeOpListBackups) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListBackups(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorImportTable(response, &metadata) } - output := &ListBackupsOutput{} + output := &ImportTableOutput{} out.Result = output var buff [1024]byte @@ -3320,7 +3431,7 @@ func (m *awsAwsjson10_deserializeOpListBackups) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListBackupsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentImportTableOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3334,7 +3445,7 @@ func (m *awsAwsjson10_deserializeOpListBackups) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListBackups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorImportTable(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)} @@ -3375,11 +3486,14 @@ func awsAwsjson10_deserializeOpErrorListBackups(response *smithyhttp.Response, m } switch { - case strings.EqualFold("InternalServerError", errorCode): - return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("ImportConflictException", errorCode): + return awsAwsjson10_deserializeErrorImportConflictException(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) default: genericError := &smithy.GenericAPIError{ @@ -3391,14 +3505,14 @@ func awsAwsjson10_deserializeOpErrorListBackups(response *smithyhttp.Response, m } } -type awsAwsjson10_deserializeOpListContributorInsights struct { +type awsAwsjson10_deserializeOpListBackups struct { } -func (*awsAwsjson10_deserializeOpListContributorInsights) ID() string { +func (*awsAwsjson10_deserializeOpListBackups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListContributorInsights) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListBackups) 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) @@ -3412,9 +3526,9 @@ func (m *awsAwsjson10_deserializeOpListContributorInsights) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListContributorInsights(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListBackups(response, &metadata) } - output := &ListContributorInsightsOutput{} + output := &ListBackupsOutput{} out.Result = output var buff [1024]byte @@ -3434,7 +3548,7 @@ func (m *awsAwsjson10_deserializeOpListContributorInsights) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListContributorInsightsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListBackupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3448,7 +3562,7 @@ func (m *awsAwsjson10_deserializeOpListContributorInsights) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListContributorInsights(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListBackups(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)} @@ -3492,8 +3606,8 @@ func awsAwsjson10_deserializeOpErrorListContributorInsights(response *smithyhttp case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("InvalidEndpointException", errorCode): + return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3505,14 +3619,14 @@ func awsAwsjson10_deserializeOpErrorListContributorInsights(response *smithyhttp } } -type awsAwsjson10_deserializeOpListExports struct { +type awsAwsjson10_deserializeOpListContributorInsights struct { } -func (*awsAwsjson10_deserializeOpListExports) ID() string { +func (*awsAwsjson10_deserializeOpListContributorInsights) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListExports) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListContributorInsights) 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) @@ -3526,9 +3640,9 @@ func (m *awsAwsjson10_deserializeOpListExports) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListExports(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListContributorInsights(response, &metadata) } - output := &ListExportsOutput{} + output := &ListContributorInsightsOutput{} out.Result = output var buff [1024]byte @@ -3548,7 +3662,7 @@ func (m *awsAwsjson10_deserializeOpListExports) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListExportsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListContributorInsightsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3562,7 +3676,7 @@ func (m *awsAwsjson10_deserializeOpListExports) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListExports(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListContributorInsights(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)} @@ -3606,8 +3720,8 @@ func awsAwsjson10_deserializeOpErrorListExports(response *smithyhttp.Response, m case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3619,14 +3733,14 @@ func awsAwsjson10_deserializeOpErrorListExports(response *smithyhttp.Response, m } } -type awsAwsjson10_deserializeOpListGlobalTables struct { +type awsAwsjson10_deserializeOpListExports struct { } -func (*awsAwsjson10_deserializeOpListGlobalTables) ID() string { +func (*awsAwsjson10_deserializeOpListExports) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListGlobalTables) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListExports) 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) @@ -3640,9 +3754,9 @@ func (m *awsAwsjson10_deserializeOpListGlobalTables) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListGlobalTables(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListExports(response, &metadata) } - output := &ListGlobalTablesOutput{} + output := &ListExportsOutput{} out.Result = output var buff [1024]byte @@ -3662,7 +3776,7 @@ func (m *awsAwsjson10_deserializeOpListGlobalTables) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListGlobalTablesOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListExportsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3676,7 +3790,7 @@ func (m *awsAwsjson10_deserializeOpListGlobalTables) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListGlobalTables(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListExports(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)} @@ -3720,8 +3834,8 @@ func awsAwsjson10_deserializeOpErrorListGlobalTables(response *smithyhttp.Respon 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) default: genericError := &smithy.GenericAPIError{ @@ -3733,14 +3847,14 @@ func awsAwsjson10_deserializeOpErrorListGlobalTables(response *smithyhttp.Respon } } -type awsAwsjson10_deserializeOpListTables struct { +type awsAwsjson10_deserializeOpListGlobalTables struct { } -func (*awsAwsjson10_deserializeOpListTables) ID() string { +func (*awsAwsjson10_deserializeOpListGlobalTables) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListTables) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListGlobalTables) 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) @@ -3754,9 +3868,9 @@ func (m *awsAwsjson10_deserializeOpListTables) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListTables(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListGlobalTables(response, &metadata) } - output := &ListTablesOutput{} + output := &ListGlobalTablesOutput{} out.Result = output var buff [1024]byte @@ -3776,7 +3890,7 @@ func (m *awsAwsjson10_deserializeOpListTables) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListTablesOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListGlobalTablesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3790,7 +3904,7 @@ func (m *awsAwsjson10_deserializeOpListTables) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListTables(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListGlobalTables(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)} @@ -3847,14 +3961,14 @@ func awsAwsjson10_deserializeOpErrorListTables(response *smithyhttp.Response, me } } -type awsAwsjson10_deserializeOpListTagsOfResource struct { +type awsAwsjson10_deserializeOpListImports struct { } -func (*awsAwsjson10_deserializeOpListTagsOfResource) ID() string { +func (*awsAwsjson10_deserializeOpListImports) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListTagsOfResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListImports) 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) @@ -3868,9 +3982,9 @@ func (m *awsAwsjson10_deserializeOpListTagsOfResource) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListTagsOfResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListImports(response, &metadata) } - output := &ListTagsOfResourceOutput{} + output := &ListImportsOutput{} out.Result = output var buff [1024]byte @@ -3890,7 +4004,7 @@ func (m *awsAwsjson10_deserializeOpListTagsOfResource) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListTagsOfResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListImportsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3904,7 +4018,7 @@ func (m *awsAwsjson10_deserializeOpListTagsOfResource) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListTagsOfResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListImports(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)} @@ -3945,14 +4059,8 @@ func awsAwsjson10_deserializeOpErrorListTagsOfResource(response *smithyhttp.Resp } switch { - case strings.EqualFold("InternalServerError", errorCode): - return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) - - case strings.EqualFold("InvalidEndpointException", errorCode): - return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3964,14 +4072,14 @@ func awsAwsjson10_deserializeOpErrorListTagsOfResource(response *smithyhttp.Resp } } -type awsAwsjson10_deserializeOpPutItem struct { +type awsAwsjson10_deserializeOpListTables struct { } -func (*awsAwsjson10_deserializeOpPutItem) ID() string { +func (*awsAwsjson10_deserializeOpListTables) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListTables) 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) @@ -3985,9 +4093,9 @@ func (m *awsAwsjson10_deserializeOpPutItem) HandleDeserialize(ctx context.Contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutItem(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTables(response, &metadata) } - output := &PutItemOutput{} + output := &ListTablesOutput{} out.Result = output var buff [1024]byte @@ -4007,7 +4115,7 @@ func (m *awsAwsjson10_deserializeOpPutItem) HandleDeserialize(ctx context.Contex return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutItemOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTablesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4021,7 +4129,7 @@ func (m *awsAwsjson10_deserializeOpPutItem) HandleDeserialize(ctx context.Contex return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutItem(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListTables(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)} @@ -4062,30 +4170,12 @@ func awsAwsjson10_deserializeOpErrorPutItem(response *smithyhttp.Response, metad } switch { - case strings.EqualFold("ConditionalCheckFailedException", errorCode): - return awsAwsjson10_deserializeErrorConditionalCheckFailedException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidEndpointException", errorCode): return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody) - case strings.EqualFold("ItemCollectionSizeLimitExceededException", errorCode): - return awsAwsjson10_deserializeErrorItemCollectionSizeLimitExceededException(response, errorBody) - - case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): - return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody) - - case strings.EqualFold("RequestLimitExceeded", errorCode): - return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TransactionConflictException", errorCode): - return awsAwsjson10_deserializeErrorTransactionConflictException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4096,14 +4186,14 @@ func awsAwsjson10_deserializeOpErrorPutItem(response *smithyhttp.Response, metad } } -type awsAwsjson10_deserializeOpQuery struct { +type awsAwsjson10_deserializeOpListTagsOfResource struct { } -func (*awsAwsjson10_deserializeOpQuery) ID() string { +func (*awsAwsjson10_deserializeOpListTagsOfResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListTagsOfResource) 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) @@ -4117,9 +4207,9 @@ func (m *awsAwsjson10_deserializeOpQuery) HandleDeserialize(ctx context.Context, } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorQuery(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTagsOfResource(response, &metadata) } - output := &QueryOutput{} + output := &ListTagsOfResourceOutput{} out.Result = output var buff [1024]byte @@ -4139,7 +4229,7 @@ func (m *awsAwsjson10_deserializeOpQuery) HandleDeserialize(ctx context.Context, return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentQueryOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTagsOfResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4153,7 +4243,7 @@ func (m *awsAwsjson10_deserializeOpQuery) HandleDeserialize(ctx context.Context, return out, metadata, err } -func awsAwsjson10_deserializeOpErrorQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListTagsOfResource(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)} @@ -4200,12 +4290,6 @@ func awsAwsjson10_deserializeOpErrorQuery(response *smithyhttp.Response, metadat case strings.EqualFold("InvalidEndpointException", errorCode): return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody) - case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): - return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody) - - case strings.EqualFold("RequestLimitExceeded", errorCode): - return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4219,7 +4303,262 @@ func awsAwsjson10_deserializeOpErrorQuery(response *smithyhttp.Response, metadat } } -type awsAwsjson10_deserializeOpRestoreTableFromBackup struct { +type awsAwsjson10_deserializeOpPutItem struct { +} + +func (*awsAwsjson10_deserializeOpPutItem) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpPutItem) 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_deserializeOpErrorPutItem(response, &metadata) + } + output := &PutItemOutput{} + 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_deserializeOpDocumentPutItemOutput(&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_deserializeOpErrorPutItem(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConditionalCheckFailedException", errorCode): + return awsAwsjson10_deserializeErrorConditionalCheckFailedException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidEndpointException", errorCode): + return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody) + + case strings.EqualFold("ItemCollectionSizeLimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorItemCollectionSizeLimitExceededException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("RequestLimitExceeded", errorCode): + return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TransactionConflictException", errorCode): + return awsAwsjson10_deserializeErrorTransactionConflictException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpQuery struct { +} + +func (*awsAwsjson10_deserializeOpQuery) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpQuery) 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_deserializeOpErrorQuery(response, &metadata) + } + output := &QueryOutput{} + 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_deserializeOpDocumentQueryOutput(&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_deserializeOpErrorQuery(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson10_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("RequestLimitExceeded", errorCode): + return awsAwsjson10_deserializeErrorRequestLimitExceeded(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpRestoreTableFromBackup struct { } func (*awsAwsjson10_deserializeOpRestoreTableFromBackup) ID() string { @@ -6400,6 +6739,76 @@ func awsAwsjson10_deserializeErrorIdempotentParameterMismatchException(response return output } +func awsAwsjson10_deserializeErrorImportConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + output := &types.ImportConflictException{} + err := awsAwsjson10_deserializeDocumentImportConflictException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_deserializeErrorImportNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, 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 err + } + + output := &types.ImportNotFoundException{} + err := awsAwsjson10_deserializeDocumentImportNotFoundException(&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 err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson10_deserializeErrorIndexNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -9085,6 +9494,87 @@ func awsAwsjson10_deserializeDocumentContributorInsightsSummary(v **types.Contri return nil } +func awsAwsjson10_deserializeDocumentCsvHeaderList(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 CsvHeader to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentCsvOptions(v **types.CsvOptions, 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.CsvOptions + if *v == nil { + sv = &types.CsvOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Delimiter": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CsvDelimiter to be of type string, got %T instead", value) + } + sv.Delimiter = ptr.String(jtv) + } + + case "HeaderList": + if err := awsAwsjson10_deserializeDocumentCsvHeaderList(&sv.HeaderList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentDeleteRequest(v **types.DeleteRequest, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9727,6 +10217,61 @@ func awsAwsjson10_deserializeDocumentFailureException(v **types.FailureException return nil } +func awsAwsjson10_deserializeDocumentGlobalSecondaryIndex(v **types.GlobalSecondaryIndex, 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.GlobalSecondaryIndex + if *v == nil { + sv = &types.GlobalSecondaryIndex{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "IndexName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndexName to be of type string, got %T instead", value) + } + sv.IndexName = ptr.String(jtv) + } + + case "KeySchema": + if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil { + return err + } + + case "Projection": + if err := awsAwsjson10_deserializeDocumentProjection(&sv.Projection, value); err != nil { + return err + } + + case "ProvisionedThroughput": + if err := awsAwsjson10_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexDescription(v **types.GlobalSecondaryIndexDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9958,6 +10503,40 @@ func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexInfo(v **types.GlobalSe return nil } +func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexList(v *[]types.GlobalSecondaryIndex, 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.GlobalSecondaryIndex + if *v == nil { + cv = []types.GlobalSecondaryIndex{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GlobalSecondaryIndex + destAddr := &col + if err := awsAwsjson10_deserializeDocumentGlobalSecondaryIndex(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentGlobalTable(v **types.GlobalTable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10090,27 +10669,334 @@ func awsAwsjson10_deserializeDocumentGlobalTableDescription(v **types.GlobalTabl sv.GlobalTableArn = ptr.String(jtv) } - case "GlobalTableName": + case "GlobalTableName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TableName to be of type string, got %T instead", value) + } + sv.GlobalTableName = ptr.String(jtv) + } + + case "GlobalTableStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GlobalTableStatus to be of type string, got %T instead", value) + } + sv.GlobalTableStatus = types.GlobalTableStatus(jtv) + } + + case "ReplicationGroup": + if err := awsAwsjson10_deserializeDocumentReplicaDescriptionList(&sv.ReplicationGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentGlobalTableList(v *[]types.GlobalTable, 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.GlobalTable + if *v == nil { + cv = []types.GlobalTable{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GlobalTable + destAddr := &col + if err := awsAwsjson10_deserializeDocumentGlobalTable(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentGlobalTableNotFoundException(v **types.GlobalTableNotFoundException, 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.GlobalTableNotFoundException + if *v == nil { + sv = &types.GlobalTableNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, 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.IdempotentParameterMismatchException + if *v == nil { + sv = &types.IdempotentParameterMismatchException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentImportConflictException(v **types.ImportConflictException, 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.ImportConflictException + if *v == nil { + sv = &types.ImportConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentImportNotFoundException(v **types.ImportNotFoundException, 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.ImportNotFoundException + if *v == nil { + sv = &types.ImportNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentImportSummary(v **types.ImportSummary, 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.ImportSummary + if *v == nil { + sv = &types.ImportSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CloudWatchLogGroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CloudWatchLogGroupArn to be of type string, got %T instead", value) + } + sv.CloudWatchLogGroupArn = ptr.String(jtv) + } + + case "EndTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ImportEndTime to be a JSON Number, got %T instead", value) + + } + } + + case "ImportArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImportArn to be of type string, got %T instead", value) + } + sv.ImportArn = ptr.String(jtv) + } + + case "ImportStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImportStatus to be of type string, got %T instead", value) + } + sv.ImportStatus = types.ImportStatus(jtv) + } + + case "InputFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputFormat to be of type string, got %T instead", value) + } + sv.InputFormat = types.InputFormat(jtv) + } + + case "S3BucketSource": + if err := awsAwsjson10_deserializeDocumentS3BucketSource(&sv.S3BucketSource, value); err != nil { + return err + } + + case "StartTime": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TableName 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.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ImportStartTime to be a JSON Number, got %T instead", value) + } - sv.GlobalTableName = ptr.String(jtv) } - case "GlobalTableStatus": + case "TableArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GlobalTableStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected TableArn to be of type string, got %T instead", value) } - sv.GlobalTableStatus = types.GlobalTableStatus(jtv) - } - - case "ReplicationGroup": - if err := awsAwsjson10_deserializeDocumentReplicaDescriptionList(&sv.ReplicationGroup, value); err != nil { - return err + sv.TableArn = ptr.String(jtv) } default: @@ -10122,7 +11008,7 @@ func awsAwsjson10_deserializeDocumentGlobalTableDescription(v **types.GlobalTabl return nil } -func awsAwsjson10_deserializeDocumentGlobalTableList(v *[]types.GlobalTable, value interface{}) error { +func awsAwsjson10_deserializeDocumentImportSummaryList(v *[]types.ImportSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10135,17 +11021,17 @@ func awsAwsjson10_deserializeDocumentGlobalTableList(v *[]types.GlobalTable, val return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.GlobalTable + var cv []types.ImportSummary if *v == nil { - cv = []types.GlobalTable{} + cv = []types.ImportSummary{} } else { cv = *v } for _, value := range shape { - var col types.GlobalTable + var col types.ImportSummary destAddr := &col - if err := awsAwsjson10_deserializeDocumentGlobalTable(&destAddr, value); err != nil { + if err := awsAwsjson10_deserializeDocumentImportSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -10156,7 +11042,7 @@ func awsAwsjson10_deserializeDocumentGlobalTableList(v *[]types.GlobalTable, val return nil } -func awsAwsjson10_deserializeDocumentGlobalTableNotFoundException(v **types.GlobalTableNotFoundException, value interface{}) error { +func awsAwsjson10_deserializeDocumentImportTableDescription(v **types.ImportTableDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10169,22 +11055,202 @@ func awsAwsjson10_deserializeDocumentGlobalTableNotFoundException(v **types.Glob return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.GlobalTableNotFoundException + var sv *types.ImportTableDescription if *v == nil { - sv = &types.GlobalTableNotFoundException{} + sv = &types.ImportTableDescription{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "ClientToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.ClientToken = ptr.String(jtv) + } + + case "CloudWatchLogGroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CloudWatchLogGroupArn to be of type string, got %T instead", value) + } + sv.CloudWatchLogGroupArn = ptr.String(jtv) + } + + case "EndTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ImportEndTime to be a JSON Number, got %T instead", value) + + } + } + + case "ErrorCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ErrorCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ErrorCount = i64 + } + + case "FailureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureCode to be of type string, got %T instead", value) + } + sv.FailureCode = ptr.String(jtv) + } + + case "FailureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureMessage to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "ImportArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImportArn to be of type string, got %T instead", value) + } + sv.ImportArn = ptr.String(jtv) + } + + case "ImportedItemCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ImportedItemCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ImportedItemCount = i64 + } + + case "ImportStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImportStatus to be of type string, got %T instead", value) + } + sv.ImportStatus = types.ImportStatus(jtv) + } + + case "InputCompressionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputCompressionType to be of type string, got %T instead", value) + } + sv.InputCompressionType = types.InputCompressionType(jtv) + } + + case "InputFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputFormat to be of type string, got %T instead", value) + } + sv.InputFormat = types.InputFormat(jtv) + } + + case "InputFormatOptions": + if err := awsAwsjson10_deserializeDocumentInputFormatOptions(&sv.InputFormatOptions, value); err != nil { + return err + } + + case "ProcessedItemCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ProcessedItemCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ProcessedItemCount = i64 + } + + case "ProcessedSizeBytes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ProcessedSizeBytes = i64 + } + + case "S3BucketSource": + if err := awsAwsjson10_deserializeDocumentS3BucketSource(&sv.S3BucketSource, value); err != nil { + return err + } + + case "StartTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ImportStartTime to be a JSON Number, got %T instead", value) + + } + } + + case "TableArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TableArn to be of type string, got %T instead", value) + } + sv.TableArn = ptr.String(jtv) + } + + case "TableCreationParameters": + if err := awsAwsjson10_deserializeDocumentTableCreationParameters(&sv.TableCreationParameters, value); err != nil { + return err + } + + case "TableId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TableId to be of type string, got %T instead", value) + } + sv.TableId = ptr.String(jtv) } default: @@ -10196,7 +11262,7 @@ func awsAwsjson10_deserializeDocumentGlobalTableNotFoundException(v **types.Glob return nil } -func awsAwsjson10_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, value interface{}) error { +func awsAwsjson10_deserializeDocumentIndexNotFoundException(v **types.IndexNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10209,16 +11275,16 @@ func awsAwsjson10_deserializeDocumentIdempotentParameterMismatchException(v **ty return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.IdempotentParameterMismatchException + var sv *types.IndexNotFoundException if *v == nil { - sv = &types.IdempotentParameterMismatchException{} + sv = &types.IndexNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "message": if value != nil { jtv, ok := value.(string) if !ok { @@ -10236,7 +11302,7 @@ func awsAwsjson10_deserializeDocumentIdempotentParameterMismatchException(v **ty return nil } -func awsAwsjson10_deserializeDocumentIndexNotFoundException(v **types.IndexNotFoundException, value interface{}) error { +func awsAwsjson10_deserializeDocumentInputFormatOptions(v **types.InputFormatOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10249,22 +11315,18 @@ func awsAwsjson10_deserializeDocumentIndexNotFoundException(v **types.IndexNotFo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.IndexNotFoundException + var sv *types.InputFormatOptions if *v == nil { - sv = &types.IndexNotFoundException{} + sv = &types.InputFormatOptions{} } else { sv = *v } for key, value := range shape { switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "Csv": + if err := awsAwsjson10_deserializeDocumentCsvOptions(&sv.Csv, value); err != nil { + return err } default: @@ -12942,37 +14004,95 @@ func awsAwsjson10_deserializeDocumentRestoreSummary(v **types.RestoreSummary, va } sv.RestoreDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - default: - return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) + default: + return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) + + } + } + + case "RestoreInProgress": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected RestoreInProgress to be of type *bool, got %T instead", value) + } + sv.RestoreInProgress = ptr.Bool(jtv) + } + + case "SourceBackupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BackupArn to be of type string, got %T instead", value) + } + sv.SourceBackupArn = ptr.String(jtv) + } + + case "SourceTableArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TableArn to be of type string, got %T instead", value) + } + sv.SourceTableArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentS3BucketSource(v **types.S3BucketSource, 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.S3BucketSource + if *v == nil { + sv = &types.S3BucketSource{} + } else { + sv = *v + } - case "RestoreInProgress": + for key, value := range shape { + switch key { + case "S3Bucket": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RestoreInProgress to be of type *bool, got %T instead", value) + return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) } - sv.RestoreInProgress = ptr.Bool(jtv) + sv.S3Bucket = ptr.String(jtv) } - case "SourceBackupArn": + case "S3BucketOwner": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BackupArn to be of type string, got %T instead", value) + return fmt.Errorf("expected S3BucketOwner to be of type string, got %T instead", value) } - sv.SourceBackupArn = ptr.String(jtv) + sv.S3BucketOwner = ptr.String(jtv) } - case "SourceTableArn": + case "S3KeyPrefix": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TableArn to be of type string, got %T instead", value) + return fmt.Errorf("expected S3Prefix to be of type string, got %T instead", value) } - sv.SourceTableArn = ptr.String(jtv) + sv.S3KeyPrefix = ptr.String(jtv) } default: @@ -13268,6 +14388,64 @@ func awsAwsjson10_deserializeDocumentSSEDescription(v **types.SSEDescription, va return nil } +func awsAwsjson10_deserializeDocumentSSESpecification(v **types.SSESpecification, 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.SSESpecification + if *v == nil { + sv = &types.SSESpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected SSEEnabled to be of type *bool, got %T instead", value) + } + sv.Enabled = ptr.Bool(jtv) + } + + case "KMSMasterKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KMSMasterKeyId to be of type string, got %T instead", value) + } + sv.KMSMasterKeyId = ptr.String(jtv) + } + + case "SSEType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SSEType to be of type string, got %T instead", value) + } + sv.SSEType = types.SSEType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentStreamSpecification(v **types.StreamSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13503,6 +14681,80 @@ func awsAwsjson10_deserializeDocumentTableClassSummary(v **types.TableClassSumma return nil } +func awsAwsjson10_deserializeDocumentTableCreationParameters(v **types.TableCreationParameters, 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.TableCreationParameters + if *v == nil { + sv = &types.TableCreationParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AttributeDefinitions": + if err := awsAwsjson10_deserializeDocumentAttributeDefinitions(&sv.AttributeDefinitions, value); err != nil { + return err + } + + case "BillingMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BillingMode to be of type string, got %T instead", value) + } + sv.BillingMode = types.BillingMode(jtv) + } + + case "GlobalSecondaryIndexes": + if err := awsAwsjson10_deserializeDocumentGlobalSecondaryIndexList(&sv.GlobalSecondaryIndexes, value); err != nil { + return err + } + + case "KeySchema": + if err := awsAwsjson10_deserializeDocumentKeySchema(&sv.KeySchema, value); err != nil { + return err + } + + case "ProvisionedThroughput": + if err := awsAwsjson10_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { + return err + } + + case "SSESpecification": + if err := awsAwsjson10_deserializeDocumentSSESpecification(&sv.SSESpecification, value); err != nil { + return err + } + + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentTableDescription(v **types.TableDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14864,6 +16116,42 @@ func awsAwsjson10_deserializeOpDocumentDescribeGlobalTableSettingsOutput(v **Des return nil } +func awsAwsjson10_deserializeOpDocumentDescribeImportOutput(v **DescribeImportOutput, 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 *DescribeImportOutput + if *v == nil { + sv = &DescribeImportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ImportTableDescription": + if err := awsAwsjson10_deserializeDocumentImportTableDescription(&sv.ImportTableDescription, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentDescribeKinesisStreamingDestinationOutput(v **DescribeKinesisStreamingDestinationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15389,6 +16677,42 @@ func awsAwsjson10_deserializeOpDocumentGetItemOutput(v **GetItemOutput, value in return nil } +func awsAwsjson10_deserializeOpDocumentImportTableOutput(v **ImportTableOutput, 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 *ImportTableOutput + if *v == nil { + sv = &ImportTableOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ImportTableDescription": + if err := awsAwsjson10_deserializeDocumentImportTableDescription(&sv.ImportTableDescription, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentListBackupsOutput(v **ListBackupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15569,6 +16893,51 @@ func awsAwsjson10_deserializeOpDocumentListGlobalTablesOutput(v **ListGlobalTabl return nil } +func awsAwsjson10_deserializeOpDocumentListImportsOutput(v **ListImportsOutput, 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 *ListImportsOutput + if *v == nil { + sv = &ListImportsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ImportSummaryList": + if err := awsAwsjson10_deserializeDocumentImportSummaryList(&sv.ImportSummaryList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImportNextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentListTablesOutput(v **ListTablesOutput, 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 b13eeff158c..ce933363c5a 100644 --- a/service/dynamodb/generated.json +++ b/service/dynamodb/generated.json @@ -27,6 +27,7 @@ "api_op_DescribeExport.go", "api_op_DescribeGlobalTable.go", "api_op_DescribeGlobalTableSettings.go", + "api_op_DescribeImport.go", "api_op_DescribeKinesisStreamingDestination.go", "api_op_DescribeLimits.go", "api_op_DescribeTable.go", @@ -38,10 +39,12 @@ "api_op_ExecuteTransaction.go", "api_op_ExportTableToPointInTime.go", "api_op_GetItem.go", + "api_op_ImportTable.go", "api_op_ListBackups.go", "api_op_ListContributorInsights.go", "api_op_ListExports.go", "api_op_ListGlobalTables.go", + "api_op_ListImports.go", "api_op_ListTables.go", "api_op_ListTagsOfResource.go", "api_op_PutItem.go", diff --git a/service/dynamodb/serializers.go b/service/dynamodb/serializers.go index b5b9a233b10..759944605e5 100644 --- a/service/dynamodb/serializers.go +++ b/service/dynamodb/serializers.go @@ -897,6 +897,61 @@ func (m *awsAwsjson10_serializeOpDescribeGlobalTableSettings) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDescribeImport struct { +} + +func (*awsAwsjson10_serializeOpDescribeImport) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDescribeImport) 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.(*DescribeImportInput) + _ = 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.DescribeImport") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDescribeImportInput(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_serializeOpDescribeKinesisStreamingDestination struct { } @@ -1502,6 +1557,61 @@ func (m *awsAwsjson10_serializeOpGetItem) HandleSerialize(ctx context.Context, i return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpImportTable struct { +} + +func (*awsAwsjson10_serializeOpImportTable) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpImportTable) 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.(*ImportTableInput) + _ = 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.ImportTable") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentImportTableInput(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_serializeOpListBackups struct { } @@ -1722,6 +1832,61 @@ func (m *awsAwsjson10_serializeOpListGlobalTables) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpListImports struct { +} + +func (*awsAwsjson10_serializeOpListImports) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListImports) 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.(*ListImportsInput) + _ = 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.ListImports") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListImportsInput(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_serializeOpListTables struct { } @@ -3222,6 +3387,36 @@ func awsAwsjson10_serializeDocumentCreateReplicationGroupMemberAction(v *types.C return nil } +func awsAwsjson10_serializeDocumentCsvHeaderList(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 awsAwsjson10_serializeDocumentCsvOptions(v *types.CsvOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Delimiter != nil { + ok := object.Key("Delimiter") + ok.String(*v.Delimiter) + } + + if v.HeaderList != nil { + ok := object.Key("HeaderList") + if err := awsAwsjson10_serializeDocumentCsvHeaderList(v.HeaderList, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeDocumentDelete(v *types.Delete, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3588,6 +3783,20 @@ func awsAwsjson10_serializeDocumentGlobalTableGlobalSecondaryIndexSettingsUpdate return nil } +func awsAwsjson10_serializeDocumentInputFormatOptions(v *types.InputFormatOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Csv != nil { + ok := object.Key("Csv") + if err := awsAwsjson10_serializeDocumentCsvOptions(v.Csv, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeDocumentKey(v map[string]types.AttributeValue, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4278,6 +4487,28 @@ func awsAwsjson10_serializeDocumentReplicaUpdateList(v []types.ReplicaUpdate, va return nil } +func awsAwsjson10_serializeDocumentS3BucketSource(v *types.S3BucketSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3Bucket != nil { + ok := object.Key("S3Bucket") + ok.String(*v.S3Bucket) + } + + if v.S3BucketOwner != nil { + ok := object.Key("S3BucketOwner") + ok.String(*v.S3BucketOwner) + } + + if v.S3KeyPrefix != nil { + ok := object.Key("S3KeyPrefix") + ok.String(*v.S3KeyPrefix) + } + + return nil +} + func awsAwsjson10_serializeDocumentSSESpecification(v *types.SSESpecification, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4328,6 +4559,58 @@ func awsAwsjson10_serializeDocumentStringSetAttributeValue(v []string, value smi return nil } +func awsAwsjson10_serializeDocumentTableCreationParameters(v *types.TableCreationParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AttributeDefinitions != nil { + ok := object.Key("AttributeDefinitions") + if err := awsAwsjson10_serializeDocumentAttributeDefinitions(v.AttributeDefinitions, ok); err != nil { + return err + } + } + + if len(v.BillingMode) > 0 { + ok := object.Key("BillingMode") + ok.String(string(v.BillingMode)) + } + + if v.GlobalSecondaryIndexes != nil { + ok := object.Key("GlobalSecondaryIndexes") + if err := awsAwsjson10_serializeDocumentGlobalSecondaryIndexList(v.GlobalSecondaryIndexes, ok); err != nil { + return err + } + } + + if v.KeySchema != nil { + ok := object.Key("KeySchema") + if err := awsAwsjson10_serializeDocumentKeySchema(v.KeySchema, ok); err != nil { + return err + } + } + + if v.ProvisionedThroughput != nil { + ok := object.Key("ProvisionedThroughput") + if err := awsAwsjson10_serializeDocumentProvisionedThroughput(v.ProvisionedThroughput, ok); err != nil { + return err + } + } + + if v.SSESpecification != nil { + ok := object.Key("SSESpecification") + if err := awsAwsjson10_serializeDocumentSSESpecification(v.SSESpecification, ok); err != nil { + return err + } + } + + if v.TableName != nil { + ok := object.Key("TableName") + ok.String(*v.TableName) + } + + return nil +} + func awsAwsjson10_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4947,6 +5230,18 @@ func awsAwsjson10_serializeOpDocumentDescribeGlobalTableSettingsInput(v *Describ return nil } +func awsAwsjson10_serializeOpDocumentDescribeImportInput(v *DescribeImportInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ImportArn != nil { + ok := object.Key("ImportArn") + ok.String(*v.ImportArn) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDescribeKinesisStreamingDestinationInput(v *DescribeKinesisStreamingDestinationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5199,6 +5494,49 @@ func awsAwsjson10_serializeOpDocumentGetItemInput(v *GetItemInput, value smithyj return nil } +func awsAwsjson10_serializeOpDocumentImportTableInput(v *ImportTableInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if len(v.InputCompressionType) > 0 { + ok := object.Key("InputCompressionType") + ok.String(string(v.InputCompressionType)) + } + + if len(v.InputFormat) > 0 { + ok := object.Key("InputFormat") + ok.String(string(v.InputFormat)) + } + + if v.InputFormatOptions != nil { + ok := object.Key("InputFormatOptions") + if err := awsAwsjson10_serializeDocumentInputFormatOptions(v.InputFormatOptions, ok); err != nil { + return err + } + } + + if v.S3BucketSource != nil { + ok := object.Key("S3BucketSource") + if err := awsAwsjson10_serializeDocumentS3BucketSource(v.S3BucketSource, ok); err != nil { + return err + } + } + + if v.TableCreationParameters != nil { + ok := object.Key("TableCreationParameters") + if err := awsAwsjson10_serializeDocumentTableCreationParameters(v.TableCreationParameters, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListBackupsInput(v *ListBackupsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5302,6 +5640,28 @@ func awsAwsjson10_serializeOpDocumentListGlobalTablesInput(v *ListGlobalTablesIn return nil } +func awsAwsjson10_serializeOpDocumentListImportsInput(v *ListImportsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.PageSize != nil { + ok := object.Key("PageSize") + ok.Integer(*v.PageSize) + } + + if v.TableArn != nil { + ok := object.Key("TableArn") + ok.String(*v.TableArn) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListTablesInput(v *ListTablesInput, 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 e3c80b4abc8..d00c6689de9 100644 --- a/service/dynamodb/types/enums.go +++ b/service/dynamodb/types/enums.go @@ -340,6 +340,30 @@ func (GlobalTableStatus) Values() []GlobalTableStatus { } } +type ImportStatus string + +// Enum values for ImportStatus +const ( + ImportStatusInProgress ImportStatus = "IN_PROGRESS" + ImportStatusCompleted ImportStatus = "COMPLETED" + ImportStatusCancelling ImportStatus = "CANCELLING" + ImportStatusCancelled ImportStatus = "CANCELLED" + ImportStatusFailed ImportStatus = "FAILED" +) + +// Values returns all known values for ImportStatus. 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 (ImportStatus) Values() []ImportStatus { + return []ImportStatus{ + "IN_PROGRESS", + "COMPLETED", + "CANCELLING", + "CANCELLED", + "FAILED", + } +} + type IndexStatus string // Enum values for IndexStatus @@ -362,6 +386,46 @@ func (IndexStatus) Values() []IndexStatus { } } +type InputCompressionType string + +// Enum values for InputCompressionType +const ( + InputCompressionTypeGzip InputCompressionType = "GZIP" + InputCompressionTypeZstd InputCompressionType = "ZSTD" + InputCompressionTypeNone InputCompressionType = "NONE" +) + +// Values returns all known values for InputCompressionType. 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 (InputCompressionType) Values() []InputCompressionType { + return []InputCompressionType{ + "GZIP", + "ZSTD", + "NONE", + } +} + +type InputFormat string + +// Enum values for InputFormat +const ( + InputFormatDynamodbJson InputFormat = "DYNAMODB_JSON" + InputFormatIon InputFormat = "ION" + InputFormatCsv InputFormat = "CSV" +) + +// Values returns all known values for InputFormat. 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 (InputFormat) Values() []InputFormat { + return []InputFormat{ + "DYNAMODB_JSON", + "ION", + "CSV", + } +} + type KeyType string // Enum values for KeyType diff --git a/service/dynamodb/types/errors.go b/service/dynamodb/types/errors.go index 682e1a7cd1a..6bf36637158 100644 --- a/service/dynamodb/types/errors.go +++ b/service/dynamodb/types/errors.go @@ -212,6 +212,46 @@ func (e *IdempotentParameterMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// There was a conflict when importing from the specified S3 source. This can occur +// when the current import conflicts with a previous import request that had the +// same client token. +type ImportConflictException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ImportConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ImportConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ImportConflictException) ErrorCode() string { return "ImportConflictException" } +func (e *ImportConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified import was not found. +type ImportNotFoundException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ImportNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ImportNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ImportNotFoundException) ErrorCode() string { return "ImportNotFoundException" } +func (e *ImportNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The operation tried to access a nonexistent index. type IndexNotFoundException struct { Message *string diff --git a/service/dynamodb/types/types.go b/service/dynamodb/types/types.go index 5a69a8e6692..6c2ab9d5615 100644 --- a/service/dynamodb/types/types.go +++ b/service/dynamodb/types/types.go @@ -522,7 +522,7 @@ type BatchStatementError struct { // The error code associated with the failed PartiQL batch statement. Code BatchStatementErrorCodeEnum - // The error message associated with the PartiQL batch resposne. + // The error message associated with the PartiQL batch response. Message *string noSmithyDocumentSerde @@ -926,6 +926,21 @@ type CreateReplicationGroupMemberAction struct { noSmithyDocumentSerde } +// Processing options for the CSV file being imported. +type CsvOptions struct { + + // The delimiter used for separating items in the CSV file being imported. + Delimiter *string + + // List of the headers used to specify a common header for all source CSV files + // being imported. If this field is specified then the first line of each CSV file + // is treated as data instead of the header. If this field is not specified the the + // first line of each CSV file is treated as the header. + HeaderList []string + + noSmithyDocumentSerde +} + // Represents a request to perform a DeleteItem operation. type Delete struct { @@ -1599,6 +1614,123 @@ type GlobalTableGlobalSecondaryIndexSettingsUpdate struct { noSmithyDocumentSerde } +// Summary information about the source file for the import. +type ImportSummary struct { + + // The Amazon Resource Number (ARN) of the Cloudwatch Log Group associated with + // this import task. + CloudWatchLogGroupArn *string + + // The time at which this import task ended. (Does this include the successful + // complete creation of the table it was imported to?) + EndTime *time.Time + + // The Amazon Resource Number (ARN) corresponding to the import request. + ImportArn *string + + // The status of the import operation. + ImportStatus ImportStatus + + // The format of the source data. Valid values are CSV, DYNAMODB_JSON or ION. + InputFormat InputFormat + + // The path and S3 bucket of the source file that is being imported. This includes + // the S3Bucket (required), S3KeyPrefix (optional) and S3BucketOwner (optional if + // the bucket is owned by the requester). + S3BucketSource *S3BucketSource + + // The time at which this import task began. + StartTime *time.Time + + // The Amazon Resource Number (ARN) of the table being imported into. + TableArn *string + + noSmithyDocumentSerde +} + +// Represents the properties of the table being imported into. +type ImportTableDescription struct { + + // The client token that was provided for the import task. Reusing the client token + // on retry makes a call to ImportTable idempotent. + ClientToken *string + + // The Amazon Resource Number (ARN) of the Cloudwatch Log Group associated with the + // target table. + CloudWatchLogGroupArn *string + + // The time at which the creation of the table associated with this import task + // completed. + EndTime *time.Time + + // The number of errors occurred on importing the source file into the target + // table. + ErrorCount int64 + + // The error code corresponding to the failure that the import job ran into during + // execution. + FailureCode *string + + // The error message corresponding to the failure that the import job ran into + // during execution. + FailureMessage *string + + // The Amazon Resource Number (ARN) corresponding to the import request. + ImportArn *string + + // The status of the import. + ImportStatus ImportStatus + + // The number of items successfully imported into the new table. + ImportedItemCount int64 + + // The compression options for the data that has been imported into the target + // table. The values are NONE, GZIP, or ZSTD. + InputCompressionType InputCompressionType + + // The format of the source data going into the target table. + InputFormat InputFormat + + // The format options for the data that was imported into the target table. There + // is one value, CsvOption. + InputFormatOptions *InputFormatOptions + + // The total number of items processed from the source file. + ProcessedItemCount int64 + + // The total size of data processed from the source file, in Bytes. + ProcessedSizeBytes int64 + + // Values for the S3 bucket the source file is imported from. Includes bucket name + // (required), key prefix (optional) and bucket account owner ID (optional). + S3BucketSource *S3BucketSource + + // The time when this import task started. + StartTime *time.Time + + // The Amazon Resource Number (ARN) of the table being imported into. + TableArn *string + + // The parameters for the new table that is being imported into. + TableCreationParameters *TableCreationParameters + + // The table id corresponding to the table created by import table process. + TableId *string + + noSmithyDocumentSerde +} + +// The format options for the data that was imported into the target table. There +// is one value, CsvOption. +type InputFormatOptions struct { + + // The options for imported source files in CSV format. The values are Delimiter + // and HeaderList. + Csv *CsvOptions + + noSmithyDocumentSerde +} + // Information about item collections, if any, that were affected by the operation. // ItemCollectionMetrics is only returned if the request asked for it. If the table // does not have any local secondary indexes, this information is not returned in @@ -2473,6 +2605,24 @@ type RestoreSummary struct { noSmithyDocumentSerde } +// The S3 bucket that is being imported from. +type S3BucketSource struct { + + // The S3 bucket that is being imported from. + // + // This member is required. + S3Bucket *string + + // The account number of the S3 bucket that is being imported from. If the bucket + // is owned by the requester this is optional. + S3BucketOwner *string + + // The key prefix shared by all S3 Objects that are being imported. + S3KeyPrefix *string + + noSmithyDocumentSerde +} + // Contains the details of the table when the backup was created. type SourceTableDetails struct { @@ -2676,6 +2826,47 @@ type TableClassSummary struct { noSmithyDocumentSerde } +// The parameters for the table created as part of the import operation. +type TableCreationParameters struct { + + // The attributes of the table created as part of the import operation. + // + // This member is required. + AttributeDefinitions []AttributeDefinition + + // The primary key and option sort key of the table created as part of the import + // operation. + // + // This member is required. + KeySchema []KeySchemaElement + + // The name of the table created as part of the import operation. + // + // This member is required. + TableName *string + + // The billing mode for provisioning the table created as part of the import + // operation. + BillingMode BillingMode + + // The Global Secondary Indexes (GSI) of the table to be created as part of the + // import operation. + GlobalSecondaryIndexes []GlobalSecondaryIndex + + // Represents the provisioned throughput settings for a specified table or index. + // The settings can be modified using the UpdateTable operation. For current + // minimum and maximum provisioned throughput values, see Service, Account, and + // Table Quotas + // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) + // in the Amazon DynamoDB Developer Guide. + ProvisionedThroughput *ProvisionedThroughput + + // Represents the settings used to enable server-side encryption. + SSESpecification *SSESpecification + + noSmithyDocumentSerde +} + // Represents the properties of a table. type TableDescription struct { diff --git a/service/dynamodb/validators.go b/service/dynamodb/validators.go index 4f0669fe1a6..1c76f46d976 100644 --- a/service/dynamodb/validators.go +++ b/service/dynamodb/validators.go @@ -310,6 +310,26 @@ func (m *validateOpDescribeGlobalTableSettings) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpDescribeImport struct { +} + +func (*validateOpDescribeImport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeImport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeImportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeImportInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeKinesisStreamingDestination struct { } @@ -510,6 +530,26 @@ func (m *validateOpGetItem) HandleInitialize(ctx context.Context, in middleware. return next.HandleInitialize(ctx, in) } +type validateOpImportTable struct { +} + +func (*validateOpImportTable) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpImportTable) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ImportTableInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpImportTableInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsOfResource struct { } @@ -930,6 +970,10 @@ func addOpDescribeGlobalTableSettingsValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpDescribeGlobalTableSettings{}, middleware.After) } +func addOpDescribeImportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeImport{}, middleware.After) +} + func addOpDescribeKinesisStreamingDestinationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeKinesisStreamingDestination{}, middleware.After) } @@ -970,6 +1014,10 @@ func addOpGetItemValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetItem{}, middleware.After) } +func addOpImportTableValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpImportTable{}, middleware.After) +} + func addOpListTagsOfResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsOfResource{}, middleware.After) } @@ -2050,6 +2098,21 @@ func validateReplicaUpdateList(v []types.ReplicaUpdate) error { } } +func validateS3BucketSource(v *types.S3BucketSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "S3BucketSource"} + if v.S3Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateStreamSpecification(v *types.StreamSpecification) error { if v == nil { return nil @@ -2065,6 +2128,45 @@ func validateStreamSpecification(v *types.StreamSpecification) error { } } +func validateTableCreationParameters(v *types.TableCreationParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TableCreationParameters"} + if v.TableName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TableName")) + } + if v.AttributeDefinitions == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttributeDefinitions")) + } else if v.AttributeDefinitions != nil { + if err := validateAttributeDefinitions(v.AttributeDefinitions); err != nil { + invalidParams.AddNested("AttributeDefinitions", err.(smithy.InvalidParamsError)) + } + } + if v.KeySchema == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeySchema")) + } else if v.KeySchema != nil { + if err := validateKeySchema(v.KeySchema); err != nil { + invalidParams.AddNested("KeySchema", err.(smithy.InvalidParamsError)) + } + } + if v.ProvisionedThroughput != nil { + if err := validateProvisionedThroughput(v.ProvisionedThroughput); err != nil { + invalidParams.AddNested("ProvisionedThroughput", err.(smithy.InvalidParamsError)) + } + } + if v.GlobalSecondaryIndexes != nil { + if err := validateGlobalSecondaryIndexList(v.GlobalSecondaryIndexes); err != nil { + invalidParams.AddNested("GlobalSecondaryIndexes", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -2590,6 +2692,21 @@ func validateOpDescribeGlobalTableSettingsInput(v *DescribeGlobalTableSettingsIn } } +func validateOpDescribeImportInput(v *DescribeImportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeImportInput"} + if v.ImportArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImportArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeKinesisStreamingDestinationInput(v *DescribeKinesisStreamingDestinationInput) error { if v == nil { return nil @@ -2756,6 +2873,35 @@ func validateOpGetItemInput(v *GetItemInput) error { } } +func validateOpImportTableInput(v *ImportTableInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ImportTableInput"} + if v.S3BucketSource == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3BucketSource")) + } else if v.S3BucketSource != nil { + if err := validateS3BucketSource(v.S3BucketSource); err != nil { + invalidParams.AddNested("S3BucketSource", err.(smithy.InvalidParamsError)) + } + } + if len(v.InputFormat) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("InputFormat")) + } + if v.TableCreationParameters == nil { + invalidParams.Add(smithy.NewErrParamRequired("TableCreationParameters")) + } else if v.TableCreationParameters != nil { + if err := validateTableCreationParameters(v.TableCreationParameters); err != nil { + invalidParams.AddNested("TableCreationParameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsOfResourceInput(v *ListTagsOfResourceInput) error { if v == nil { return nil diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 3f93ebeb41c..89beecdf08a 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -55820,6 +55820,84 @@ func awsEc2query_deserializeDocumentClientVpnSecurityGroupIdSetUnwrapped(v *[]st *v = sv return nil } +func awsEc2query_deserializeDocumentCloudWatchLogOptions(v **types.CloudWatchLogOptions, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CloudWatchLogOptions + if *v == nil { + sv = &types.CloudWatchLogOptions{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("logEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.LogEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("logGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LogGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("logOutputFormat", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LogOutputFormat = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeDocumentCoipAddressUsage(v **types.CoipAddressUsage, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -114586,6 +114664,12 @@ func awsEc2query_deserializeDocumentTunnelOption(v **types.TunnelOption, decoder return err } + case strings.EqualFold("logOptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentVpnTunnelLogOptions(&sv.LogOptions, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("outsideIpAddress", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -120698,6 +120782,48 @@ func awsEc2query_deserializeDocumentVpnStaticRouteListUnwrapped(v *[]types.VpnSt *v = sv return nil } +func awsEc2query_deserializeDocumentVpnTunnelLogOptions(v **types.VpnTunnelLogOptions, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.VpnTunnelLogOptions + if *v == nil { + sv = &types.VpnTunnelLogOptions{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("cloudWatchLogOptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentCloudWatchLogOptions(&sv.CloudWatchLogOptions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentAcceptReservedInstancesExchangeQuoteOutput(v **AcceptReservedInstancesExchangeQuoteOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 8f2040387e4..f2c2b4ef607 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -34930,6 +34930,28 @@ func awsEc2query_serializeDocumentClientVpnSecurityGroupIdSet(v []string, value return nil } +func awsEc2query_serializeDocumentCloudWatchLogOptionsSpecification(v *types.CloudWatchLogOptionsSpecification, value query.Value) error { + object := value.Object() + _ = object + + if v.LogEnabled != nil { + objectKey := object.Key("LogEnabled") + objectKey.Boolean(*v.LogEnabled) + } + + if v.LogGroupArn != nil { + objectKey := object.Key("LogGroupArn") + objectKey.String(*v.LogGroupArn) + } + + if v.LogOutputFormat != nil { + objectKey := object.Key("LogOutputFormat") + objectKey.String(*v.LogOutputFormat) + } + + return nil +} + func awsEc2query_serializeDocumentCoipPoolIdSet(v []string, value query.Value) error { if len(v) == 0 { return nil @@ -38733,6 +38755,13 @@ func awsEc2query_serializeDocumentModifyVpnTunnelOptionsSpecification(v *types.M } } + if v.LogOptions != nil { + objectKey := object.Key("LogOptions") + if err := awsEc2query_serializeDocumentVpnTunnelLogOptionsSpecification(v.LogOptions, objectKey); err != nil { + return err + } + } + if v.Phase1DHGroupNumbers != nil { objectKey := object.FlatKey("Phase1DHGroupNumber") if err := awsEc2query_serializeDocumentPhase1DHGroupNumbersRequestList(v.Phase1DHGroupNumbers, objectKey); err != nil { @@ -42777,6 +42806,20 @@ func awsEc2query_serializeDocumentVpnGatewayIdStringList(v []string, value query return nil } +func awsEc2query_serializeDocumentVpnTunnelLogOptionsSpecification(v *types.VpnTunnelLogOptionsSpecification, value query.Value) error { + object := value.Object() + _ = object + + if v.CloudWatchLogOptions != nil { + objectKey := object.Key("CloudWatchLogOptions") + if err := awsEc2query_serializeDocumentCloudWatchLogOptionsSpecification(v.CloudWatchLogOptions, objectKey); err != nil { + return err + } + } + + return nil +} + func awsEc2query_serializeDocumentVpnTunnelOptionsSpecification(v *types.VpnTunnelOptionsSpecification, value query.Value) error { object := value.Object() _ = object @@ -42798,6 +42841,13 @@ func awsEc2query_serializeDocumentVpnTunnelOptionsSpecification(v *types.VpnTunn } } + if v.LogOptions != nil { + objectKey := object.Key("LogOptions") + if err := awsEc2query_serializeDocumentVpnTunnelLogOptionsSpecification(v.LogOptions, objectKey); err != nil { + return err + } + } + if v.Phase1DHGroupNumbers != nil { objectKey := object.FlatKey("Phase1DHGroupNumber") if err := awsEc2query_serializeDocumentPhase1DHGroupNumbersRequestList(v.Phase1DHGroupNumbers, objectKey); err != nil { diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 58b35cd0940..c0720f87890 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -1743,6 +1743,38 @@ type ClientVpnRouteStatus struct { noSmithyDocumentSerde } +// Options for sending VPN tunnel logs to CloudWatch. +type CloudWatchLogOptions struct { + + // Status of VPN tunnel logging feature. Default value is False. Valid values: True + // | False + LogEnabled *bool + + // The Amazon Resource Name (ARN) of the CloudWatch log group to send logs to. + LogGroupArn *string + + // Configured log format. Default format is json. Valid values: json | text + LogOutputFormat *string + + noSmithyDocumentSerde +} + +// Options for sending VPN tunnel logs to CloudWatch. +type CloudWatchLogOptionsSpecification struct { + + // Enable or disable VPN tunnel logging feature. Default value is False. Valid + // values: True | False + LogEnabled *bool + + // The Amazon Resource Name (ARN) of the CloudWatch log group to send logs to. + LogGroupArn *string + + // Set log format. Default format is json. Valid values: json | text + LogOutputFormat *string + + noSmithyDocumentSerde +} + // Describes address usage for a customer-owned address pool. type CoipAddressUsage struct { @@ -8871,6 +8903,9 @@ type ModifyVpnTunnelOptionsSpecification struct { // ikev2 IKEVersions []IKEVersionsRequestListValue + // Options for logging VPN tunnel activity. + LogOptions *VpnTunnelLogOptionsSpecification + // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel // for phase 1 IKE negotiations. Valid values: 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 // | 21 | 22 | 23 | 24 @@ -15166,6 +15201,9 @@ type TunnelOption struct { // The IKE versions that are permitted for the VPN tunnel. IkeVersions []IKEVersionsListValue + // Options for logging VPN tunnel activity. + LogOptions *VpnTunnelLogOptions + // The external IP address of the VPN tunnel. OutsideIpAddress *string @@ -16218,6 +16256,24 @@ type VpnStaticRoute struct { noSmithyDocumentSerde } +// Options for logging VPN tunnel activity. +type VpnTunnelLogOptions struct { + + // Options for sending VPN tunnel logs to CloudWatch. + CloudWatchLogOptions *CloudWatchLogOptions + + noSmithyDocumentSerde +} + +// Options for logging VPN tunnel activity. +type VpnTunnelLogOptionsSpecification struct { + + // Options for sending VPN tunnel logs to CloudWatch. + CloudWatchLogOptions *CloudWatchLogOptionsSpecification + + noSmithyDocumentSerde +} + // The tunnel options for a single VPN tunnel. type VpnTunnelOptionsSpecification struct { @@ -16234,6 +16290,9 @@ type VpnTunnelOptionsSpecification struct { // ikev2 IKEVersions []IKEVersionsRequestListValue + // Options for logging VPN tunnel activity. + LogOptions *VpnTunnelLogOptionsSpecification + // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel // for phase 1 IKE negotiations. Valid values: 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 // | 21 | 22 | 23 | 24 diff --git a/service/networkmanager/deserializers.go b/service/networkmanager/deserializers.go index fbc3bee07f6..6aa5eb703ca 100644 --- a/service/networkmanager/deserializers.go +++ b/service/networkmanager/deserializers.go @@ -19551,6 +19551,15 @@ func awsRestjson1_deserializeDocumentTransitGatewayPeering(v **types.TransitGate sv.TransitGatewayArn = ptr.String(jtv) } + case "TransitGatewayPeeringAttachmentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TransitGatewayPeeringAttachmentId to be of type string, got %T instead", value) + } + sv.TransitGatewayPeeringAttachmentId = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/networkmanager/types/types.go b/service/networkmanager/types/types.go index 942d244e598..d90527e8f57 100644 --- a/service/networkmanager/types/types.go +++ b/service/networkmanager/types/types.go @@ -1258,6 +1258,9 @@ type TransitGatewayPeering struct { // The ARN of the transit gateway. TransitGatewayArn *string + // The ID of the transit gateway peering attachment. + TransitGatewayPeeringAttachmentId *string + noSmithyDocumentSerde }