diff --git a/.changelog/0c2e82a7b0c14ad0816d9f3693fedc2a.json b/.changelog/0c2e82a7b0c14ad0816d9f3693fedc2a.json new file mode 100644 index 00000000000..0911ae2a638 --- /dev/null +++ b/.changelog/0c2e82a7b0c14ad0816d9f3693fedc2a.json @@ -0,0 +1,8 @@ +{ + "id": "0c2e82a7-b0c1-4ad0-816d-9f3693fedc2a", + "type": "feature", + "description": "This release adds following support. 1. New APIs for metadata bulk operations. 2. Modify the component type API to support composite component types - nesting component types within one another. 3. New list APIs for components and properties. 4. Support the larger scope digital twin modeling.", + "modules": [ + "service/iottwinmaker" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..9c4b4574d6f --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,9 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/cloudfrontkeyvaluestore", + "service/inspectorscan" + ] +} \ No newline at end of file diff --git a/.changelog/422953ef3b61448f84e7435d9479e3c7.json b/.changelog/422953ef3b61448f84e7435d9479e3c7.json new file mode 100644 index 00000000000..d18cd0b02c8 --- /dev/null +++ b/.changelog/422953ef3b61448f84e7435d9479e3c7.json @@ -0,0 +1,8 @@ +{ + "id": "422953ef-3b61-448f-84e7-435d9479e3c7", + "type": "feature", + "description": "This release adds support for CloudFront KeyValueStore, a globally managed key value datastore associated with CloudFront Functions.", + "modules": [ + "service/cloudfront" + ] +} \ No newline at end of file diff --git a/.changelog/6d4bac8cacf54935af178ba83665dde2.json b/.changelog/6d4bac8cacf54935af178ba83665dde2.json new file mode 100644 index 00000000000..edacdad8d73 --- /dev/null +++ b/.changelog/6d4bac8cacf54935af178ba83665dde2.json @@ -0,0 +1,8 @@ +{ + "id": "6d4bac8c-acf5-4935-af17-8ba83665dde2", + "type": "feature", + "description": "Add support for automatic date based partitioning in S3 Server Access Logs.", + "modules": [ + "service/s3" + ] +} \ No newline at end of file diff --git a/.changelog/859ef5c0870e473388fb4fb7b7f478f7.json b/.changelog/859ef5c0870e473388fb4fb7b7f478f7.json new file mode 100644 index 00000000000..023069bfa5d --- /dev/null +++ b/.changelog/859ef5c0870e473388fb4fb7b7f478f7.json @@ -0,0 +1,8 @@ +{ + "id": "859ef5c0-870e-4733-88fb-4fb7b7f478f7", + "type": "feature", + "description": "This release adds support for CloudFront KeyValueStore, a globally managed key value datastore associated with CloudFront Functions.", + "modules": [ + "service/cloudfrontkeyvaluestore" + ] +} \ No newline at end of file diff --git a/.changelog/aa383de793f94b4bae5a872e71e65962.json b/.changelog/aa383de793f94b4bae5a872e71e65962.json new file mode 100644 index 00000000000..37d14d5b5c1 --- /dev/null +++ b/.changelog/aa383de793f94b4bae5a872e71e65962.json @@ -0,0 +1,8 @@ +{ + "id": "aa383de7-93f9-4b4b-ae5a-872e71e65962", + "type": "documentation", + "description": "Documentation updates for Amazon EC2.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/ad77865ed4384b33b47333c82171b542.json b/.changelog/ad77865ed4384b33b47333c82171b542.json new file mode 100644 index 00000000000..7475173e59c --- /dev/null +++ b/.changelog/ad77865ed4384b33b47333c82171b542.json @@ -0,0 +1,8 @@ +{ + "id": "ad77865e-d438-4b33-b473-33c82171b542", + "type": "feature", + "description": "Adds 1/ user-defined unique identifier for asset and model metadata, 2/ asset model components, and 3/ query API for asset metadata and telemetry data. Supports 4/ multi variate anomaly detection using Amazon Lookout for Equipment, 5/ warm storage tier, and 6/ buffered ingestion of time series data.", + "modules": [ + "service/iotsitewise" + ] +} \ No newline at end of file diff --git a/.changelog/b15b0424283040269a5889b110c640e6.json b/.changelog/b15b0424283040269a5889b110c640e6.json new file mode 100644 index 00000000000..6beeb879e4e --- /dev/null +++ b/.changelog/b15b0424283040269a5889b110c640e6.json @@ -0,0 +1,8 @@ +{ + "id": "b15b0424-2830-4026-9a58-89b110c640e6", + "type": "feature", + "description": "This release adds support for the new Amazon Inspector Scan API. The new Inspector Scan API can synchronously scan SBOMs adhering to the CycloneDX v1.5 format.", + "modules": [ + "service/inspectorscan" + ] +} \ No newline at end of file diff --git a/service/cloudfront/api_op_CreateKeyValueStore.go b/service/cloudfront/api_op_CreateKeyValueStore.go new file mode 100644 index 00000000000..ad7e51c7347 --- /dev/null +++ b/service/cloudfront/api_op_CreateKeyValueStore.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +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/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Specifies the Key Value Store resource to add to your account. In your account, +// the Key Value Store names must be unique. You can also import Key Value Store +// data in JSON format from an S3 bucket by providing a valid ImportSource that +// you own. +func (c *Client) CreateKeyValueStore(ctx context.Context, params *CreateKeyValueStoreInput, optFns ...func(*Options)) (*CreateKeyValueStoreOutput, error) { + if params == nil { + params = &CreateKeyValueStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateKeyValueStore", params, optFns, c.addOperationCreateKeyValueStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateKeyValueStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateKeyValueStoreInput struct { + + // The name of the Key Value Store. The maximum length of the name is 32 + // characters. + // + // This member is required. + Name *string + + // The comment of the Key Value Store. + Comment *string + + // The S3 bucket that provides the source for the import. The source must be in a + // valid JSON format. + ImportSource *types.ImportSource + + noSmithyDocumentSerde +} + +type CreateKeyValueStoreOutput struct { + + // The ETag in the resulting Key Value Store. + ETag *string + + // The resulting Key Value Store. + KeyValueStore *types.KeyValueStore + + // The location of the resulting Key Value Store. + Location *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateKeyValueStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpCreateKeyValueStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateKeyValueStore{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateKeyValueStore"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateKeyValueStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateKeyValueStore(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateKeyValueStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateKeyValueStore", + } +} diff --git a/service/cloudfront/api_op_DeleteKeyValueStore.go b/service/cloudfront/api_op_DeleteKeyValueStore.go new file mode 100644 index 00000000000..46bbef9ab09 --- /dev/null +++ b/service/cloudfront/api_op_DeleteKeyValueStore.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Specifies the Key Value Store to delete. +func (c *Client) DeleteKeyValueStore(ctx context.Context, params *DeleteKeyValueStoreInput, optFns ...func(*Options)) (*DeleteKeyValueStoreOutput, error) { + if params == nil { + params = &DeleteKeyValueStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteKeyValueStore", params, optFns, c.addOperationDeleteKeyValueStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteKeyValueStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteKeyValueStoreInput struct { + + // The Key Value Store to delete, if a match occurs. + // + // This member is required. + IfMatch *string + + // The name of the Key Value Store. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DeleteKeyValueStoreOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteKeyValueStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteKeyValueStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteKeyValueStore{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteKeyValueStore"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteKeyValueStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteKeyValueStore(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteKeyValueStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteKeyValueStore", + } +} diff --git a/service/cloudfront/api_op_DescribeKeyValueStore.go b/service/cloudfront/api_op_DescribeKeyValueStore.go new file mode 100644 index 00000000000..30c2dee3b61 --- /dev/null +++ b/service/cloudfront/api_op_DescribeKeyValueStore.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +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/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Specifies the Key Value Store and its configuration. +func (c *Client) DescribeKeyValueStore(ctx context.Context, params *DescribeKeyValueStoreInput, optFns ...func(*Options)) (*DescribeKeyValueStoreOutput, error) { + if params == nil { + params = &DescribeKeyValueStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeKeyValueStore", params, optFns, c.addOperationDescribeKeyValueStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeKeyValueStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeKeyValueStoreInput struct { + + // The name of the Key Value Store. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DescribeKeyValueStoreOutput struct { + + // The ETag of the resulting Key Value Store. + ETag *string + + // The resulting Key Value Store. + KeyValueStore *types.KeyValueStore + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeKeyValueStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpDescribeKeyValueStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDescribeKeyValueStore{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeKeyValueStore"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeKeyValueStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeKeyValueStore(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeKeyValueStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeKeyValueStore", + } +} diff --git a/service/cloudfront/api_op_ListKeyValueStores.go b/service/cloudfront/api_op_ListKeyValueStores.go new file mode 100644 index 00000000000..c4f20546457 --- /dev/null +++ b/service/cloudfront/api_op_ListKeyValueStores.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +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/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Specifies the Key Value Stores to list. +func (c *Client) ListKeyValueStores(ctx context.Context, params *ListKeyValueStoresInput, optFns ...func(*Options)) (*ListKeyValueStoresOutput, error) { + if params == nil { + params = &ListKeyValueStoresInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListKeyValueStores", params, optFns, c.addOperationListKeyValueStoresMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListKeyValueStoresOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListKeyValueStoresInput struct { + + // The marker associated with the Key Value Stores list. + Marker *string + + // The maximum number of items in the Key Value Stores list. + MaxItems *int32 + + // The status of the request for the Key Value Stores list. + Status *string + + noSmithyDocumentSerde +} + +type ListKeyValueStoresOutput struct { + + // The resulting Key Value Stores list. + KeyValueStoreList *types.KeyValueStoreList + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListKeyValueStoresMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpListKeyValueStores{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpListKeyValueStores{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListKeyValueStores"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListKeyValueStores(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListKeyValueStoresAPIClient is a client that implements the ListKeyValueStores +// operation. +type ListKeyValueStoresAPIClient interface { + ListKeyValueStores(context.Context, *ListKeyValueStoresInput, ...func(*Options)) (*ListKeyValueStoresOutput, error) +} + +var _ ListKeyValueStoresAPIClient = (*Client)(nil) + +// ListKeyValueStoresPaginatorOptions is the paginator options for +// ListKeyValueStores +type ListKeyValueStoresPaginatorOptions struct { + // The maximum number of items in the Key Value Stores list. + 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 +} + +// ListKeyValueStoresPaginator is a paginator for ListKeyValueStores +type ListKeyValueStoresPaginator struct { + options ListKeyValueStoresPaginatorOptions + client ListKeyValueStoresAPIClient + params *ListKeyValueStoresInput + nextToken *string + firstPage bool +} + +// NewListKeyValueStoresPaginator returns a new ListKeyValueStoresPaginator +func NewListKeyValueStoresPaginator(client ListKeyValueStoresAPIClient, params *ListKeyValueStoresInput, optFns ...func(*ListKeyValueStoresPaginatorOptions)) *ListKeyValueStoresPaginator { + if params == nil { + params = &ListKeyValueStoresInput{} + } + + options := ListKeyValueStoresPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListKeyValueStoresPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKeyValueStoresPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListKeyValueStores page. +func (p *ListKeyValueStoresPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeyValueStoresOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + result, err := p.client.ListKeyValueStores(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + if result.KeyValueStoreList != nil { + p.nextToken = result.KeyValueStoreList.NextMarker + } + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListKeyValueStores(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListKeyValueStores", + } +} diff --git a/service/cloudfront/api_op_UpdateKeyValueStore.go b/service/cloudfront/api_op_UpdateKeyValueStore.go new file mode 100644 index 00000000000..fe2790a608e --- /dev/null +++ b/service/cloudfront/api_op_UpdateKeyValueStore.go @@ -0,0 +1,150 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +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/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Specifies the Key Value Store to update. +func (c *Client) UpdateKeyValueStore(ctx context.Context, params *UpdateKeyValueStoreInput, optFns ...func(*Options)) (*UpdateKeyValueStoreOutput, error) { + if params == nil { + params = &UpdateKeyValueStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateKeyValueStore", params, optFns, c.addOperationUpdateKeyValueStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateKeyValueStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateKeyValueStoreInput struct { + + // The comment of the Key Value Store to update. + // + // This member is required. + Comment *string + + // The Key Value Store to update, if a match occurs. + // + // This member is required. + IfMatch *string + + // The name of the Key Value Store to update. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type UpdateKeyValueStoreOutput struct { + + // The ETag of the resulting Key Value Store. + ETag *string + + // The resulting Key Value Store to update. + KeyValueStore *types.KeyValueStore + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateKeyValueStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpUpdateKeyValueStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpUpdateKeyValueStore{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateKeyValueStore"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateKeyValueStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateKeyValueStore(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateKeyValueStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateKeyValueStore", + } +} diff --git a/service/cloudfront/deserializers.go b/service/cloudfront/deserializers.go index 40937d96eae..cdffe3637e8 100644 --- a/service/cloudfront/deserializers.go +++ b/service/cloudfront/deserializers.go @@ -2557,6 +2557,177 @@ func awsRestxml_deserializeOpDocumentCreateKeyGroupOutput(v **CreateKeyGroupOutp return nil } +type awsRestxml_deserializeOpCreateKeyValueStore struct { +} + +func (*awsRestxml_deserializeOpCreateKeyValueStore) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpCreateKeyValueStore) 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, awsRestxml_deserializeOpErrorCreateKeyValueStore(response, &metadata) + } + output := &CreateKeyValueStoreOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsCreateKeyValueStoreOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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) + err = awsRestxml_deserializeDocumentKeyValueStore(&output.KeyValueStore, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorCreateKeyValueStore(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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("EntityAlreadyExists", errorCode): + return awsRestxml_deserializeErrorEntityAlreadyExists(response, errorBody) + + case strings.EqualFold("EntityLimitExceeded", errorCode): + return awsRestxml_deserializeErrorEntityLimitExceeded(response, errorBody) + + case strings.EqualFold("EntitySizeLimitExceeded", errorCode): + return awsRestxml_deserializeErrorEntitySizeLimitExceeded(response, errorBody) + + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsCreateKeyValueStoreOutput(v *CreateKeyValueStoreOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("Location"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.Location = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentCreateKeyValueStoreOutput(v **CreateKeyValueStoreOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateKeyValueStoreOutput + if *v == nil { + sv = &CreateKeyValueStoreOutput{} + } 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("KeyValueStore", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentKeyValueStore(&sv.KeyValueStore, 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 +} + type awsRestxml_deserializeOpCreateMonitoringSubscription struct { } @@ -4615,6 +4786,91 @@ func awsRestxml_deserializeOpErrorDeleteKeyGroup(response *smithyhttp.Response, } } +type awsRestxml_deserializeOpDeleteKeyValueStore struct { +} + +func (*awsRestxml_deserializeOpDeleteKeyValueStore) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDeleteKeyValueStore) 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, awsRestxml_deserializeOpErrorDeleteKeyValueStore(response, &metadata) + } + output := &DeleteKeyValueStoreOutput{} + 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 awsRestxml_deserializeOpErrorDeleteKeyValueStore(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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("CannotDeleteEntityWhileInUse", errorCode): + return awsRestxml_deserializeErrorCannotDeleteEntityWhileInUse(response, errorBody) + + case strings.EqualFold("EntityNotFound", errorCode): + return awsRestxml_deserializeErrorEntityNotFound(response, errorBody) + + case strings.EqualFold("InvalidIfMatchVersion", errorCode): + return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) + + case strings.EqualFold("PreconditionFailed", errorCode): + return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestxml_deserializeOpDeleteMonitoringSubscription struct { } @@ -5361,14 +5617,14 @@ func awsRestxml_deserializeOpDocumentDescribeFunctionOutput(v **DescribeFunction return nil } -type awsRestxml_deserializeOpGetCachePolicy struct { +type awsRestxml_deserializeOpDescribeKeyValueStore struct { } -func (*awsRestxml_deserializeOpGetCachePolicy) ID() string { +func (*awsRestxml_deserializeOpDescribeKeyValueStore) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetCachePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDescribeKeyValueStore) 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) @@ -5382,12 +5638,12 @@ func (m *awsRestxml_deserializeOpGetCachePolicy) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetCachePolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDescribeKeyValueStore(response, &metadata) } - output := &GetCachePolicyOutput{} + output := &DescribeKeyValueStoreOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetCachePolicyOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsDescribeKeyValueStoreOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -5410,7 +5666,7 @@ func (m *awsRestxml_deserializeOpGetCachePolicy) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentCachePolicy(&output.CachePolicy, decoder) + err = awsRestxml_deserializeDocumentKeyValueStore(&output.KeyValueStore, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5423,7 +5679,7 @@ func (m *awsRestxml_deserializeOpGetCachePolicy) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestxml_deserializeOpErrorGetCachePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDescribeKeyValueStore(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)} @@ -5451,8 +5707,11 @@ func awsRestxml_deserializeOpErrorGetCachePolicy(response *smithyhttp.Response, case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchCachePolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) + case strings.EqualFold("EntityNotFound", errorCode): + return awsRestxml_deserializeErrorEntityNotFound(response, errorBody) + + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5464,7 +5723,7 @@ func awsRestxml_deserializeOpErrorGetCachePolicy(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpHttpBindingsGetCachePolicyOutput(v *GetCachePolicyOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsDescribeKeyValueStoreOutput(v *DescribeKeyValueStoreOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -5476,13 +5735,13 @@ func awsRestxml_deserializeOpHttpBindingsGetCachePolicyOutput(v *GetCachePolicyO return nil } -func awsRestxml_deserializeOpDocumentGetCachePolicyOutput(v **GetCachePolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentDescribeKeyValueStoreOutput(v **DescribeKeyValueStoreOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetCachePolicyOutput + var sv *DescribeKeyValueStoreOutput if *v == nil { - sv = &GetCachePolicyOutput{} + sv = &DescribeKeyValueStoreOutput{} } else { sv = *v } @@ -5498,9 +5757,9 @@ func awsRestxml_deserializeOpDocumentGetCachePolicyOutput(v **GetCachePolicyOutp originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CachePolicy", t.Name.Local): + case strings.EqualFold("KeyValueStore", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCachePolicy(&sv.CachePolicy, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentKeyValueStore(&sv.KeyValueStore, nodeDecoder); err != nil { return err } @@ -5518,14 +5777,14 @@ func awsRestxml_deserializeOpDocumentGetCachePolicyOutput(v **GetCachePolicyOutp return nil } -type awsRestxml_deserializeOpGetCachePolicyConfig struct { +type awsRestxml_deserializeOpGetCachePolicy struct { } -func (*awsRestxml_deserializeOpGetCachePolicyConfig) ID() string { +func (*awsRestxml_deserializeOpGetCachePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetCachePolicyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetCachePolicy) 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) @@ -5539,12 +5798,169 @@ func (m *awsRestxml_deserializeOpGetCachePolicyConfig) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetCachePolicyConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetCachePolicy(response, &metadata) } - output := &GetCachePolicyConfigOutput{} + output := &GetCachePolicyOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetCachePolicyConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetCachePolicyOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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) + err = awsRestxml_deserializeDocumentCachePolicy(&output.CachePolicy, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetCachePolicy(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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("NoSuchCachePolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsGetCachePolicyOutput(v *GetCachePolicyOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetCachePolicyOutput(v **GetCachePolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetCachePolicyOutput + if *v == nil { + sv = &GetCachePolicyOutput{} + } 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("CachePolicy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentCachePolicy(&sv.CachePolicy, 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 +} + +type awsRestxml_deserializeOpGetCachePolicyConfig struct { +} + +func (*awsRestxml_deserializeOpGetCachePolicyConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetCachePolicyConfig) 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, awsRestxml_deserializeOpErrorGetCachePolicyConfig(response, &metadata) + } + output := &GetCachePolicyConfigOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsGetCachePolicyConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -11913,14 +12329,14 @@ func awsRestxml_deserializeOpDocumentListKeyGroupsOutput(v **ListKeyGroupsOutput return nil } -type awsRestxml_deserializeOpListOriginAccessControls struct { +type awsRestxml_deserializeOpListKeyValueStores struct { } -func (*awsRestxml_deserializeOpListOriginAccessControls) ID() string { +func (*awsRestxml_deserializeOpListKeyValueStores) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListOriginAccessControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListKeyValueStores) 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) @@ -11934,9 +12350,9 @@ func (m *awsRestxml_deserializeOpListOriginAccessControls) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListOriginAccessControls(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListKeyValueStores(response, &metadata) } - output := &ListOriginAccessControlsOutput{} + output := &ListKeyValueStoresOutput{} out.Result = output var buff [1024]byte @@ -11957,7 +12373,7 @@ func (m *awsRestxml_deserializeOpListOriginAccessControls) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginAccessControlList(&output.OriginAccessControlList, decoder) + err = awsRestxml_deserializeDocumentKeyValueStoreList(&output.KeyValueStoreList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11970,7 +12386,7 @@ func (m *awsRestxml_deserializeOpListOriginAccessControls) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorListOriginAccessControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListKeyValueStores(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)} @@ -11995,6 +12411,9 @@ func awsRestxml_deserializeOpErrorListOriginAccessControls(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) @@ -12008,13 +12427,13 @@ func awsRestxml_deserializeOpErrorListOriginAccessControls(response *smithyhttp. } } -func awsRestxml_deserializeOpDocumentListOriginAccessControlsOutput(v **ListOriginAccessControlsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListKeyValueStoresOutput(v **ListKeyValueStoresOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListOriginAccessControlsOutput + var sv *ListKeyValueStoresOutput if *v == nil { - sv = &ListOriginAccessControlsOutput{} + sv = &ListKeyValueStoresOutput{} } else { sv = *v } @@ -12030,9 +12449,9 @@ func awsRestxml_deserializeOpDocumentListOriginAccessControlsOutput(v **ListOrig originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginAccessControlList", t.Name.Local): + case strings.EqualFold("KeyValueStoreList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginAccessControlList(&sv.OriginAccessControlList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentKeyValueStoreList(&sv.KeyValueStoreList, nodeDecoder); err != nil { return err } @@ -12050,14 +12469,14 @@ func awsRestxml_deserializeOpDocumentListOriginAccessControlsOutput(v **ListOrig return nil } -type awsRestxml_deserializeOpListOriginRequestPolicies struct { +type awsRestxml_deserializeOpListOriginAccessControls struct { } -func (*awsRestxml_deserializeOpListOriginRequestPolicies) ID() string { +func (*awsRestxml_deserializeOpListOriginAccessControls) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListOriginRequestPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListOriginAccessControls) 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) @@ -12071,9 +12490,9 @@ func (m *awsRestxml_deserializeOpListOriginRequestPolicies) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListOriginRequestPolicies(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListOriginAccessControls(response, &metadata) } - output := &ListOriginRequestPoliciesOutput{} + output := &ListOriginAccessControlsOutput{} out.Result = output var buff [1024]byte @@ -12094,7 +12513,7 @@ func (m *awsRestxml_deserializeOpListOriginRequestPolicies) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginRequestPolicyList(&output.OriginRequestPolicyList, decoder) + err = awsRestxml_deserializeDocumentOriginAccessControlList(&output.OriginAccessControlList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12107,7 +12526,7 @@ func (m *awsRestxml_deserializeOpListOriginRequestPolicies) HandleDeserialize(ct return out, metadata, err } -func awsRestxml_deserializeOpErrorListOriginRequestPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListOriginAccessControls(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)} @@ -12132,15 +12551,9 @@ func awsRestxml_deserializeOpErrorListOriginRequestPolicies(response *smithyhttp } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -12151,13 +12564,13 @@ func awsRestxml_deserializeOpErrorListOriginRequestPolicies(response *smithyhttp } } -func awsRestxml_deserializeOpDocumentListOriginRequestPoliciesOutput(v **ListOriginRequestPoliciesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListOriginAccessControlsOutput(v **ListOriginAccessControlsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListOriginRequestPoliciesOutput + var sv *ListOriginAccessControlsOutput if *v == nil { - sv = &ListOriginRequestPoliciesOutput{} + sv = &ListOriginAccessControlsOutput{} } else { sv = *v } @@ -12173,9 +12586,9 @@ func awsRestxml_deserializeOpDocumentListOriginRequestPoliciesOutput(v **ListOri originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginRequestPolicyList", t.Name.Local): + case strings.EqualFold("OriginAccessControlList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginRequestPolicyList(&sv.OriginRequestPolicyList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentOriginAccessControlList(&sv.OriginAccessControlList, nodeDecoder); err != nil { return err } @@ -12193,14 +12606,14 @@ func awsRestxml_deserializeOpDocumentListOriginRequestPoliciesOutput(v **ListOri return nil } -type awsRestxml_deserializeOpListPublicKeys struct { +type awsRestxml_deserializeOpListOriginRequestPolicies struct { } -func (*awsRestxml_deserializeOpListPublicKeys) ID() string { +func (*awsRestxml_deserializeOpListOriginRequestPolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListPublicKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListOriginRequestPolicies) 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) @@ -12214,9 +12627,9 @@ func (m *awsRestxml_deserializeOpListPublicKeys) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListPublicKeys(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListOriginRequestPolicies(response, &metadata) } - output := &ListPublicKeysOutput{} + output := &ListOriginRequestPoliciesOutput{} out.Result = output var buff [1024]byte @@ -12237,7 +12650,7 @@ func (m *awsRestxml_deserializeOpListPublicKeys) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentPublicKeyList(&output.PublicKeyList, decoder) + err = awsRestxml_deserializeDocumentOriginRequestPolicyList(&output.OriginRequestPolicyList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12250,7 +12663,7 @@ func (m *awsRestxml_deserializeOpListPublicKeys) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestxml_deserializeOpErrorListPublicKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListOriginRequestPolicies(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)} @@ -12275,9 +12688,15 @@ func awsRestxml_deserializeOpErrorListPublicKeys(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -12288,13 +12707,13 @@ func awsRestxml_deserializeOpErrorListPublicKeys(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentListPublicKeysOutput(v **ListPublicKeysOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListOriginRequestPoliciesOutput(v **ListOriginRequestPoliciesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListPublicKeysOutput + var sv *ListOriginRequestPoliciesOutput if *v == nil { - sv = &ListPublicKeysOutput{} + sv = &ListOriginRequestPoliciesOutput{} } else { sv = *v } @@ -12310,9 +12729,9 @@ func awsRestxml_deserializeOpDocumentListPublicKeysOutput(v **ListPublicKeysOutp originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("PublicKeyList", t.Name.Local): + case strings.EqualFold("OriginRequestPolicyList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPublicKeyList(&sv.PublicKeyList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentOriginRequestPolicyList(&sv.OriginRequestPolicyList, nodeDecoder); err != nil { return err } @@ -12330,14 +12749,14 @@ func awsRestxml_deserializeOpDocumentListPublicKeysOutput(v **ListPublicKeysOutp return nil } -type awsRestxml_deserializeOpListRealtimeLogConfigs struct { +type awsRestxml_deserializeOpListPublicKeys struct { } -func (*awsRestxml_deserializeOpListRealtimeLogConfigs) ID() string { +func (*awsRestxml_deserializeOpListPublicKeys) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListPublicKeys) 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) @@ -12351,9 +12770,9 @@ func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListPublicKeys(response, &metadata) } - output := &ListRealtimeLogConfigsOutput{} + output := &ListPublicKeysOutput{} out.Result = output var buff [1024]byte @@ -12374,7 +12793,7 @@ func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentRealtimeLogConfigs(&output.RealtimeLogConfigs, decoder) + err = awsRestxml_deserializeDocumentPublicKeyList(&output.PublicKeyList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12387,7 +12806,7 @@ func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) HandleDeserialize(ctx c return out, metadata, err } -func awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListPublicKeys(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)} @@ -12412,15 +12831,9 @@ func awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchRealtimeLogConfig", errorCode): - return awsRestxml_deserializeErrorNoSuchRealtimeLogConfig(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -12431,11 +12844,154 @@ func awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response *smithyhttp.Re } } -func awsRestxml_deserializeOpDocumentListRealtimeLogConfigsOutput(v **ListRealtimeLogConfigsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListPublicKeysOutput(v **ListPublicKeysOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListRealtimeLogConfigsOutput + var sv *ListPublicKeysOutput + if *v == nil { + sv = &ListPublicKeysOutput{} + } 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("PublicKeyList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentPublicKeyList(&sv.PublicKeyList, 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 +} + +type awsRestxml_deserializeOpListRealtimeLogConfigs struct { +} + +func (*awsRestxml_deserializeOpListRealtimeLogConfigs) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) 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, awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response, &metadata) + } + output := &ListRealtimeLogConfigsOutput{} + 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) + err = awsRestxml_deserializeDocumentRealtimeLogConfigs(&output.RealtimeLogConfigs, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorListRealtimeLogConfigs(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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("NoSuchRealtimeLogConfig", errorCode): + return awsRestxml_deserializeErrorNoSuchRealtimeLogConfig(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentListRealtimeLogConfigsOutput(v **ListRealtimeLogConfigsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListRealtimeLogConfigsOutput if *v == nil { sv = &ListRealtimeLogConfigsOutput{} } else { @@ -15284,14 +15840,14 @@ func awsRestxml_deserializeOpDocumentUpdateKeyGroupOutput(v **UpdateKeyGroupOutp return nil } -type awsRestxml_deserializeOpUpdateOriginAccessControl struct { +type awsRestxml_deserializeOpUpdateKeyValueStore struct { } -func (*awsRestxml_deserializeOpUpdateOriginAccessControl) ID() string { +func (*awsRestxml_deserializeOpUpdateKeyValueStore) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpUpdateOriginAccessControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpUpdateKeyValueStore) 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) @@ -15305,12 +15861,12 @@ func (m *awsRestxml_deserializeOpUpdateOriginAccessControl) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUpdateOriginAccessControl(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorUpdateKeyValueStore(response, &metadata) } - output := &UpdateOriginAccessControlOutput{} + output := &UpdateKeyValueStoreOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsUpdateOriginAccessControlOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsUpdateKeyValueStoreOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -15333,7 +15889,7 @@ func (m *awsRestxml_deserializeOpUpdateOriginAccessControl) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginAccessControl(&output.OriginAccessControl, decoder) + err = awsRestxml_deserializeDocumentKeyValueStore(&output.KeyValueStore, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -15346,7 +15902,7 @@ func (m *awsRestxml_deserializeOpUpdateOriginAccessControl) HandleDeserialize(ct return out, metadata, err } -func awsRestxml_deserializeOpErrorUpdateOriginAccessControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorUpdateKeyValueStore(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)} @@ -15374,8 +15930,8 @@ func awsRestxml_deserializeOpErrorUpdateOriginAccessControl(response *smithyhttp case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("IllegalUpdate", errorCode): - return awsRestxml_deserializeErrorIllegalUpdate(response, errorBody) + case strings.EqualFold("EntityNotFound", errorCode): + return awsRestxml_deserializeErrorEntityNotFound(response, errorBody) case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) @@ -15383,12 +15939,6 @@ func awsRestxml_deserializeOpErrorUpdateOriginAccessControl(response *smithyhttp case strings.EqualFold("InvalidIfMatchVersion", errorCode): return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) - case strings.EqualFold("NoSuchOriginAccessControl", errorCode): - return awsRestxml_deserializeErrorNoSuchOriginAccessControl(response, errorBody) - - case strings.EqualFold("OriginAccessControlAlreadyExists", errorCode): - return awsRestxml_deserializeErrorOriginAccessControlAlreadyExists(response, errorBody) - case strings.EqualFold("PreconditionFailed", errorCode): return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) @@ -15402,7 +15952,7 @@ func awsRestxml_deserializeOpErrorUpdateOriginAccessControl(response *smithyhttp } } -func awsRestxml_deserializeOpHttpBindingsUpdateOriginAccessControlOutput(v *UpdateOriginAccessControlOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsUpdateKeyValueStoreOutput(v *UpdateKeyValueStoreOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -15414,13 +15964,13 @@ func awsRestxml_deserializeOpHttpBindingsUpdateOriginAccessControlOutput(v *Upda return nil } -func awsRestxml_deserializeOpDocumentUpdateOriginAccessControlOutput(v **UpdateOriginAccessControlOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentUpdateKeyValueStoreOutput(v **UpdateKeyValueStoreOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *UpdateOriginAccessControlOutput + var sv *UpdateKeyValueStoreOutput if *v == nil { - sv = &UpdateOriginAccessControlOutput{} + sv = &UpdateKeyValueStoreOutput{} } else { sv = *v } @@ -15436,9 +15986,9 @@ func awsRestxml_deserializeOpDocumentUpdateOriginAccessControlOutput(v **UpdateO originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginAccessControl", t.Name.Local): + case strings.EqualFold("KeyValueStore", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginAccessControl(&sv.OriginAccessControl, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentKeyValueStore(&sv.KeyValueStore, nodeDecoder); err != nil { return err } @@ -15456,14 +16006,14 @@ func awsRestxml_deserializeOpDocumentUpdateOriginAccessControlOutput(v **UpdateO return nil } -type awsRestxml_deserializeOpUpdateOriginRequestPolicy struct { +type awsRestxml_deserializeOpUpdateOriginAccessControl struct { } -func (*awsRestxml_deserializeOpUpdateOriginRequestPolicy) ID() string { +func (*awsRestxml_deserializeOpUpdateOriginAccessControl) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpUpdateOriginRequestPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpUpdateOriginAccessControl) 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) @@ -15477,12 +16027,12 @@ func (m *awsRestxml_deserializeOpUpdateOriginRequestPolicy) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUpdateOriginRequestPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorUpdateOriginAccessControl(response, &metadata) } - output := &UpdateOriginRequestPolicyOutput{} + output := &UpdateOriginAccessControlOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsUpdateOriginRequestPolicyOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsUpdateOriginAccessControlOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -15505,7 +16055,7 @@ func (m *awsRestxml_deserializeOpUpdateOriginRequestPolicy) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginRequestPolicy(&output.OriginRequestPolicy, decoder) + err = awsRestxml_deserializeDocumentOriginAccessControl(&output.OriginAccessControl, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -15518,7 +16068,7 @@ func (m *awsRestxml_deserializeOpUpdateOriginRequestPolicy) HandleDeserialize(ct return out, metadata, err } -func awsRestxml_deserializeOpErrorUpdateOriginRequestPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorUpdateOriginAccessControl(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)} @@ -15549,33 +16099,21 @@ func awsRestxml_deserializeOpErrorUpdateOriginRequestPolicy(response *smithyhttp case strings.EqualFold("IllegalUpdate", errorCode): return awsRestxml_deserializeErrorIllegalUpdate(response, errorBody) - case strings.EqualFold("InconsistentQuantities", errorCode): - return awsRestxml_deserializeErrorInconsistentQuantities(response, errorBody) - case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) case strings.EqualFold("InvalidIfMatchVersion", errorCode): return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) - case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) + case strings.EqualFold("NoSuchOriginAccessControl", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginAccessControl(response, errorBody) - case strings.EqualFold("OriginRequestPolicyAlreadyExists", errorCode): - return awsRestxml_deserializeErrorOriginRequestPolicyAlreadyExists(response, errorBody) + case strings.EqualFold("OriginAccessControlAlreadyExists", errorCode): + return awsRestxml_deserializeErrorOriginAccessControlAlreadyExists(response, errorBody) case strings.EqualFold("PreconditionFailed", errorCode): return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) - case strings.EqualFold("TooManyCookiesInOriginRequestPolicy", errorCode): - return awsRestxml_deserializeErrorTooManyCookiesInOriginRequestPolicy(response, errorBody) - - case strings.EqualFold("TooManyHeadersInOriginRequestPolicy", errorCode): - return awsRestxml_deserializeErrorTooManyHeadersInOriginRequestPolicy(response, errorBody) - - case strings.EqualFold("TooManyQueryStringsInOriginRequestPolicy", errorCode): - return awsRestxml_deserializeErrorTooManyQueryStringsInOriginRequestPolicy(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -15586,7 +16124,7 @@ func awsRestxml_deserializeOpErrorUpdateOriginRequestPolicy(response *smithyhttp } } -func awsRestxml_deserializeOpHttpBindingsUpdateOriginRequestPolicyOutput(v *UpdateOriginRequestPolicyOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsUpdateOriginAccessControlOutput(v *UpdateOriginAccessControlOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -15598,13 +16136,13 @@ func awsRestxml_deserializeOpHttpBindingsUpdateOriginRequestPolicyOutput(v *Upda return nil } -func awsRestxml_deserializeOpDocumentUpdateOriginRequestPolicyOutput(v **UpdateOriginRequestPolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentUpdateOriginAccessControlOutput(v **UpdateOriginAccessControlOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *UpdateOriginRequestPolicyOutput + var sv *UpdateOriginAccessControlOutput if *v == nil { - sv = &UpdateOriginRequestPolicyOutput{} + sv = &UpdateOriginAccessControlOutput{} } else { sv = *v } @@ -15620,9 +16158,9 @@ func awsRestxml_deserializeOpDocumentUpdateOriginRequestPolicyOutput(v **UpdateO originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginRequestPolicy", t.Name.Local): + case strings.EqualFold("OriginAccessControl", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginRequestPolicy(&sv.OriginRequestPolicy, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentOriginAccessControl(&sv.OriginAccessControl, nodeDecoder); err != nil { return err } @@ -15640,14 +16178,14 @@ func awsRestxml_deserializeOpDocumentUpdateOriginRequestPolicyOutput(v **UpdateO return nil } -type awsRestxml_deserializeOpUpdatePublicKey struct { +type awsRestxml_deserializeOpUpdateOriginRequestPolicy struct { } -func (*awsRestxml_deserializeOpUpdatePublicKey) ID() string { +func (*awsRestxml_deserializeOpUpdateOriginRequestPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpUpdatePublicKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpUpdateOriginRequestPolicy) 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) @@ -15661,12 +16199,12 @@ func (m *awsRestxml_deserializeOpUpdatePublicKey) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUpdatePublicKey(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorUpdateOriginRequestPolicy(response, &metadata) } - output := &UpdatePublicKeyOutput{} + output := &UpdateOriginRequestPolicyOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsUpdatePublicKeyOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsUpdateOriginRequestPolicyOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -15689,7 +16227,7 @@ func (m *awsRestxml_deserializeOpUpdatePublicKey) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentPublicKey(&output.PublicKey, decoder) + err = awsRestxml_deserializeDocumentOriginRequestPolicy(&output.OriginRequestPolicy, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -15702,7 +16240,7 @@ func (m *awsRestxml_deserializeOpUpdatePublicKey) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestxml_deserializeOpErrorUpdatePublicKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorUpdateOriginRequestPolicy(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)} @@ -15730,24 +16268,36 @@ func awsRestxml_deserializeOpErrorUpdatePublicKey(response *smithyhttp.Response, case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("CannotChangeImmutablePublicKeyFields", errorCode): - return awsRestxml_deserializeErrorCannotChangeImmutablePublicKeyFields(response, errorBody) - case strings.EqualFold("IllegalUpdate", errorCode): return awsRestxml_deserializeErrorIllegalUpdate(response, errorBody) + case strings.EqualFold("InconsistentQuantities", errorCode): + return awsRestxml_deserializeErrorInconsistentQuantities(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) case strings.EqualFold("InvalidIfMatchVersion", errorCode): return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) - case strings.EqualFold("NoSuchPublicKey", errorCode): - return awsRestxml_deserializeErrorNoSuchPublicKey(response, errorBody) + case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) + + case strings.EqualFold("OriginRequestPolicyAlreadyExists", errorCode): + return awsRestxml_deserializeErrorOriginRequestPolicyAlreadyExists(response, errorBody) case strings.EqualFold("PreconditionFailed", errorCode): return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) + case strings.EqualFold("TooManyCookiesInOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorTooManyCookiesInOriginRequestPolicy(response, errorBody) + + case strings.EqualFold("TooManyHeadersInOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorTooManyHeadersInOriginRequestPolicy(response, errorBody) + + case strings.EqualFold("TooManyQueryStringsInOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorTooManyQueryStringsInOriginRequestPolicy(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -15758,7 +16308,7 @@ func awsRestxml_deserializeOpErrorUpdatePublicKey(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpHttpBindingsUpdatePublicKeyOutput(v *UpdatePublicKeyOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsUpdateOriginRequestPolicyOutput(v *UpdateOriginRequestPolicyOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -15770,7 +16320,179 @@ func awsRestxml_deserializeOpHttpBindingsUpdatePublicKeyOutput(v *UpdatePublicKe return nil } -func awsRestxml_deserializeOpDocumentUpdatePublicKeyOutput(v **UpdatePublicKeyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentUpdateOriginRequestPolicyOutput(v **UpdateOriginRequestPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *UpdateOriginRequestPolicyOutput + if *v == nil { + sv = &UpdateOriginRequestPolicyOutput{} + } 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("OriginRequestPolicy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentOriginRequestPolicy(&sv.OriginRequestPolicy, 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 +} + +type awsRestxml_deserializeOpUpdatePublicKey struct { +} + +func (*awsRestxml_deserializeOpUpdatePublicKey) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpUpdatePublicKey) 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, awsRestxml_deserializeOpErrorUpdatePublicKey(response, &metadata) + } + output := &UpdatePublicKeyOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsUpdatePublicKeyOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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) + err = awsRestxml_deserializeDocumentPublicKey(&output.PublicKey, decoder) + 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(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorUpdatePublicKey(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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("CannotChangeImmutablePublicKeyFields", errorCode): + return awsRestxml_deserializeErrorCannotChangeImmutablePublicKeyFields(response, errorBody) + + case strings.EqualFold("IllegalUpdate", errorCode): + return awsRestxml_deserializeErrorIllegalUpdate(response, errorBody) + + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("InvalidIfMatchVersion", errorCode): + return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) + + case strings.EqualFold("NoSuchPublicKey", errorCode): + return awsRestxml_deserializeErrorNoSuchPublicKey(response, errorBody) + + case strings.EqualFold("PreconditionFailed", errorCode): + return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsUpdatePublicKeyOutput(v *UpdatePublicKeyOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentUpdatePublicKeyOutput(v **UpdatePublicKeyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -16552,6 +17274,50 @@ func awsRestxml_deserializeErrorCannotChangeImmutablePublicKeyFields(response *s return output } +func awsRestxml_deserializeErrorCannotDeleteEntityWhileInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CannotDeleteEntityWhileInUse{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentCannotDeleteEntityWhileInUse(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + func awsRestxml_deserializeErrorCloudFrontOriginAccessIdentityAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.CloudFrontOriginAccessIdentityAlreadyExists{} var buff [1024]byte @@ -16860,8 +17626,8 @@ func awsRestxml_deserializeErrorDistributionNotDisabled(response *smithyhttp.Res return output } -func awsRestxml_deserializeErrorFieldLevelEncryptionConfigAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.FieldLevelEncryptionConfigAlreadyExists{} +func awsRestxml_deserializeErrorEntityAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.EntityAlreadyExists{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -16891,7 +17657,7 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionConfigAlreadyExists(response } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionConfigAlreadyExists(&output, decoder) + err = awsRestxml_deserializeDocumentEntityAlreadyExists(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -16904,8 +17670,8 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionConfigAlreadyExists(response return output } -func awsRestxml_deserializeErrorFieldLevelEncryptionConfigInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.FieldLevelEncryptionConfigInUse{} +func awsRestxml_deserializeErrorEntityLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.EntityLimitExceeded{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -16935,7 +17701,7 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionConfigInUse(response *smithy } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionConfigInUse(&output, decoder) + err = awsRestxml_deserializeDocumentEntityLimitExceeded(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -16948,8 +17714,8 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionConfigInUse(response *smithy return output } -func awsRestxml_deserializeErrorFieldLevelEncryptionProfileAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.FieldLevelEncryptionProfileAlreadyExists{} +func awsRestxml_deserializeErrorEntityNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.EntityNotFound{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -16979,7 +17745,7 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionProfileAlreadyExists(respons } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileAlreadyExists(&output, decoder) + err = awsRestxml_deserializeDocumentEntityNotFound(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -16992,8 +17758,8 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionProfileAlreadyExists(respons return output } -func awsRestxml_deserializeErrorFieldLevelEncryptionProfileInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.FieldLevelEncryptionProfileInUse{} +func awsRestxml_deserializeErrorEntitySizeLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.EntitySizeLimitExceeded{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -17023,7 +17789,7 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionProfileInUse(response *smith } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileInUse(&output, decoder) + err = awsRestxml_deserializeDocumentEntitySizeLimitExceeded(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -17036,8 +17802,8 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionProfileInUse(response *smith return output } -func awsRestxml_deserializeErrorFieldLevelEncryptionProfileSizeExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.FieldLevelEncryptionProfileSizeExceeded{} +func awsRestxml_deserializeErrorFieldLevelEncryptionConfigAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.FieldLevelEncryptionConfigAlreadyExists{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -17067,7 +17833,7 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionProfileSizeExceeded(response } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileSizeExceeded(&output, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionConfigAlreadyExists(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -17080,8 +17846,8 @@ func awsRestxml_deserializeErrorFieldLevelEncryptionProfileSizeExceeded(response return output } -func awsRestxml_deserializeErrorFunctionAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.FunctionAlreadyExists{} +func awsRestxml_deserializeErrorFieldLevelEncryptionConfigInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.FieldLevelEncryptionConfigInUse{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -17111,7 +17877,7 @@ func awsRestxml_deserializeErrorFunctionAlreadyExists(response *smithyhttp.Respo } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentFunctionAlreadyExists(&output, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionConfigInUse(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -17124,8 +17890,8 @@ func awsRestxml_deserializeErrorFunctionAlreadyExists(response *smithyhttp.Respo return output } -func awsRestxml_deserializeErrorFunctionInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.FunctionInUse{} +func awsRestxml_deserializeErrorFieldLevelEncryptionProfileAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.FieldLevelEncryptionProfileAlreadyExists{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -17155,7 +17921,7 @@ func awsRestxml_deserializeErrorFunctionInUse(response *smithyhttp.Response, err } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentFunctionInUse(&output, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileAlreadyExists(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -17168,8 +17934,8 @@ func awsRestxml_deserializeErrorFunctionInUse(response *smithyhttp.Response, err return output } -func awsRestxml_deserializeErrorFunctionSizeLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.FunctionSizeLimitExceeded{} +func awsRestxml_deserializeErrorFieldLevelEncryptionProfileInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.FieldLevelEncryptionProfileInUse{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -17199,7 +17965,7 @@ func awsRestxml_deserializeErrorFunctionSizeLimitExceeded(response *smithyhttp.R } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentFunctionSizeLimitExceeded(&output, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileInUse(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -17212,8 +17978,8 @@ func awsRestxml_deserializeErrorFunctionSizeLimitExceeded(response *smithyhttp.R return output } -func awsRestxml_deserializeErrorIllegalDelete(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.IllegalDelete{} +func awsRestxml_deserializeErrorFieldLevelEncryptionProfileSizeExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.FieldLevelEncryptionProfileSizeExceeded{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -17243,7 +18009,7 @@ func awsRestxml_deserializeErrorIllegalDelete(response *smithyhttp.Response, err } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentIllegalDelete(&output, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileSizeExceeded(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -17256,7 +18022,183 @@ func awsRestxml_deserializeErrorIllegalDelete(response *smithyhttp.Response, err return output } -func awsRestxml_deserializeErrorIllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsRestxml_deserializeErrorFunctionAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.FunctionAlreadyExists{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentFunctionAlreadyExists(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorFunctionInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.FunctionInUse{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentFunctionInUse(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorFunctionSizeLimitExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.FunctionSizeLimitExceeded{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentFunctionSizeLimitExceeded(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorIllegalDelete(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IllegalDelete{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentIllegalDelete(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorIllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -24810,6 +25752,55 @@ func awsRestxml_deserializeDocumentCannotChangeImmutablePublicKeyFields(v **type return nil } +func awsRestxml_deserializeDocumentCannotDeleteEntityWhileInUse(v **types.CannotDeleteEntityWhileInUse, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CannotDeleteEntityWhileInUse + if *v == nil { + sv = &types.CannotDeleteEntityWhileInUse{} + } 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("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = 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 awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentity(v **types.CloudFrontOriginAccessIdentity, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -28673,13 +29664,13 @@ func awsRestxml_deserializeDocumentEndPointListUnwrapped(v *[]types.EndPoint, de *v = sv return nil } -func awsRestxml_deserializeDocumentFieldLevelEncryption(v **types.FieldLevelEncryption, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentEntityAlreadyExists(v **types.EntityAlreadyExists, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.FieldLevelEncryption + var sv *types.EntityAlreadyExists if *v == nil { - sv = &types.FieldLevelEncryption{} + sv = &types.EntityAlreadyExists{} } else { sv = *v } @@ -28695,26 +29686,7 @@ func awsRestxml_deserializeDocumentFieldLevelEncryption(v **types.FieldLevelEncr originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FieldLevelEncryptionConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentFieldLevelEncryptionConfig(&sv.FieldLevelEncryptionConfig, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) - } - - case strings.EqualFold("LastModifiedTime", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -28724,11 +29696,7 @@ func awsRestxml_deserializeDocumentFieldLevelEncryption(v **types.FieldLevelEncr } { xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.LastModifiedTime = ptr.Time(t) + sv.Message = ptr.String(xtv) } default: @@ -28745,13 +29713,232 @@ func awsRestxml_deserializeDocumentFieldLevelEncryption(v **types.FieldLevelEncr return nil } -func awsRestxml_deserializeDocumentFieldLevelEncryptionConfig(v **types.FieldLevelEncryptionConfig, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentEntityLimitExceeded(v **types.EntityLimitExceeded, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.FieldLevelEncryptionConfig + var sv *types.EntityLimitExceeded if *v == nil { - sv = &types.FieldLevelEncryptionConfig{} + sv = &types.EntityLimitExceeded{} + } 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("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = 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 awsRestxml_deserializeDocumentEntityNotFound(v **types.EntityNotFound, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EntityNotFound + if *v == nil { + sv = &types.EntityNotFound{} + } 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("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = 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 awsRestxml_deserializeDocumentEntitySizeLimitExceeded(v **types.EntitySizeLimitExceeded, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EntitySizeLimitExceeded + if *v == nil { + sv = &types.EntitySizeLimitExceeded{} + } 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("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = 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 awsRestxml_deserializeDocumentFieldLevelEncryption(v **types.FieldLevelEncryption, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.FieldLevelEncryption + if *v == nil { + sv = &types.FieldLevelEncryption{} + } 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("FieldLevelEncryptionConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentFieldLevelEncryptionConfig(&sv.FieldLevelEncryptionConfig, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Id", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Id = ptr.String(xtv) + } + + case strings.EqualFold("LastModifiedTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(t) + } + + 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 awsRestxml_deserializeDocumentFieldLevelEncryptionConfig(v **types.FieldLevelEncryptionConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.FieldLevelEncryptionConfig + if *v == nil { + sv = &types.FieldLevelEncryptionConfig{} } else { sv = *v } @@ -30282,6 +31469,12 @@ func awsRestxml_deserializeDocumentFunctionConfig(v **types.FunctionConfig, deco sv.Comment = ptr.String(xtv) } + case strings.EqualFold("KeyValueStoreAssociations", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentKeyValueStoreAssociations(&sv.KeyValueStoreAssociations, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("Runtime", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -33476,6 +34669,457 @@ func awsRestxml_deserializeDocumentKeyPairIds(v **types.KeyPairIds, decoder smit return nil } +func awsRestxml_deserializeDocumentKeyValueStore(v **types.KeyValueStore, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.KeyValueStore + if *v == nil { + sv = &types.KeyValueStore{} + } 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("ARN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ARN = ptr.String(xtv) + } + + case strings.EqualFold("Comment", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Comment = ptr.String(xtv) + } + + case strings.EqualFold("Id", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Id = ptr.String(xtv) + } + + case strings.EqualFold("LastModifiedTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(t) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = 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 awsRestxml_deserializeDocumentKeyValueStoreAssociation(v **types.KeyValueStoreAssociation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.KeyValueStoreAssociation + if *v == nil { + sv = &types.KeyValueStoreAssociation{} + } 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("KeyValueStoreARN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KeyValueStoreARN = 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 awsRestxml_deserializeDocumentKeyValueStoreAssociationList(v *[]types.KeyValueStoreAssociation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.KeyValueStoreAssociation + if *v == nil { + sv = make([]types.KeyValueStoreAssociation, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("KeyValueStoreAssociation", t.Name.Local): + var col types.KeyValueStoreAssociation + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentKeyValueStoreAssociation(&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 awsRestxml_deserializeDocumentKeyValueStoreAssociationListUnwrapped(v *[]types.KeyValueStoreAssociation, decoder smithyxml.NodeDecoder) error { + var sv []types.KeyValueStoreAssociation + if *v == nil { + sv = make([]types.KeyValueStoreAssociation, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.KeyValueStoreAssociation + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentKeyValueStoreAssociation(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentKeyValueStoreAssociations(v **types.KeyValueStoreAssociations, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.KeyValueStoreAssociations + if *v == nil { + sv = &types.KeyValueStoreAssociations{} + } 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("Items", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentKeyValueStoreAssociationList(&sv.Items, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Quantity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Quantity = ptr.Int32(int32(i64)) + } + + 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 awsRestxml_deserializeDocumentKeyValueStoreList(v **types.KeyValueStoreList, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.KeyValueStoreList + if *v == nil { + sv = &types.KeyValueStoreList{} + } 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("Items", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentKeyValueStoreSummaryList(&sv.Items, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("MaxItems", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + + case strings.EqualFold("Quantity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Quantity = ptr.Int32(int32(i64)) + } + + 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 awsRestxml_deserializeDocumentKeyValueStoreSummaryList(v *[]types.KeyValueStore, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.KeyValueStore + if *v == nil { + sv = make([]types.KeyValueStore, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("KeyValueStore", t.Name.Local): + var col types.KeyValueStore + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentKeyValueStore(&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 awsRestxml_deserializeDocumentKeyValueStoreSummaryListUnwrapped(v *[]types.KeyValueStore, decoder smithyxml.NodeDecoder) error { + var sv []types.KeyValueStore + if *v == nil { + sv = make([]types.KeyValueStore, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.KeyValueStore + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentKeyValueStore(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsRestxml_deserializeDocumentKGKeyPairIds(v **types.KGKeyPairIds, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/cloudfront/endpoints.go b/service/cloudfront/endpoints.go index 181906afc85..05e2b2e7578 100644 --- a/service/cloudfront/endpoints.go +++ b/service/cloudfront/endpoints.go @@ -469,7 +469,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://cloudfront-fips.") diff --git a/service/cloudfront/generated.json b/service/cloudfront/generated.json index ef95a54b89a..61717d182f7 100644 --- a/service/cloudfront/generated.json +++ b/service/cloudfront/generated.json @@ -22,6 +22,7 @@ "api_op_CreateFunction.go", "api_op_CreateInvalidation.go", "api_op_CreateKeyGroup.go", + "api_op_CreateKeyValueStore.go", "api_op_CreateMonitoringSubscription.go", "api_op_CreateOriginAccessControl.go", "api_op_CreateOriginRequestPolicy.go", @@ -38,6 +39,7 @@ "api_op_DeleteFieldLevelEncryptionProfile.go", "api_op_DeleteFunction.go", "api_op_DeleteKeyGroup.go", + "api_op_DeleteKeyValueStore.go", "api_op_DeleteMonitoringSubscription.go", "api_op_DeleteOriginAccessControl.go", "api_op_DeleteOriginRequestPolicy.go", @@ -46,6 +48,7 @@ "api_op_DeleteResponseHeadersPolicy.go", "api_op_DeleteStreamingDistribution.go", "api_op_DescribeFunction.go", + "api_op_DescribeKeyValueStore.go", "api_op_GetCachePolicy.go", "api_op_GetCachePolicyConfig.go", "api_op_GetCloudFrontOriginAccessIdentity.go", @@ -90,6 +93,7 @@ "api_op_ListFunctions.go", "api_op_ListInvalidations.go", "api_op_ListKeyGroups.go", + "api_op_ListKeyValueStores.go", "api_op_ListOriginAccessControls.go", "api_op_ListOriginRequestPolicies.go", "api_op_ListPublicKeys.go", @@ -110,6 +114,7 @@ "api_op_UpdateFieldLevelEncryptionProfile.go", "api_op_UpdateFunction.go", "api_op_UpdateKeyGroup.go", + "api_op_UpdateKeyValueStore.go", "api_op_UpdateOriginAccessControl.go", "api_op_UpdateOriginRequestPolicy.go", "api_op_UpdatePublicKey.go", diff --git a/service/cloudfront/serializers.go b/service/cloudfront/serializers.go index 0528650ce5a..7fdcf233cd9 100644 --- a/service/cloudfront/serializers.go +++ b/service/cloudfront/serializers.go @@ -1011,6 +1011,116 @@ func awsRestxml_serializeOpHttpBindingsCreateKeyGroupInput(v *CreateKeyGroupInpu return nil } +type awsRestxml_serializeOpCreateKeyValueStore struct { +} + +func (*awsRestxml_serializeOpCreateKeyValueStore) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCreateKeyValueStore) 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.(*CreateKeyValueStoreInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/key-value-store") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CreateKeyValueStoreRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://cloudfront.amazonaws.com/doc/2020-05-31/")) + if err := awsRestxml_serializeOpDocumentCreateKeyValueStoreInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateKeyValueStoreInput(v *CreateKeyValueStoreInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestxml_serializeOpDocumentCreateKeyValueStoreInput(v *CreateKeyValueStoreInput, value smithyxml.Value) error { + defer value.Close() + if v.Comment != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Comment", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Comment) + } + if v.ImportSource != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "ImportSource", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentImportSource(v.ImportSource, el); err != nil { + return err + } + } + if v.Name != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Name", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Name) + } + return nil +} + type awsRestxml_serializeOpCreateMonitoringSubscription struct { } @@ -2239,6 +2349,76 @@ func awsRestxml_serializeOpHttpBindingsDeleteKeyGroupInput(v *DeleteKeyGroupInpu return nil } +type awsRestxml_serializeOpDeleteKeyValueStore struct { +} + +func (*awsRestxml_serializeOpDeleteKeyValueStore) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteKeyValueStore) 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.(*DeleteKeyValueStoreInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/key-value-store/{Name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsDeleteKeyValueStoreInput(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 awsRestxml_serializeOpHttpBindingsDeleteKeyValueStoreInput(v *DeleteKeyValueStoreInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.IfMatch != nil && len(*v.IfMatch) > 0 { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + type awsRestxml_serializeOpDeleteMonitoringSubscription struct { } @@ -2820,6 +3000,71 @@ func awsRestxml_serializeOpHttpBindingsDescribeFunctionInput(v *DescribeFunction return nil } +type awsRestxml_serializeOpDescribeKeyValueStore struct { +} + +func (*awsRestxml_serializeOpDescribeKeyValueStore) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDescribeKeyValueStore) 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.(*DescribeKeyValueStoreInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/key-value-store/{Name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsDescribeKeyValueStoreInput(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 awsRestxml_serializeOpHttpBindingsDescribeKeyValueStoreInput(v *DescribeKeyValueStoreInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + type awsRestxml_serializeOpGetCachePolicy struct { } @@ -5834,6 +6079,74 @@ func awsRestxml_serializeOpHttpBindingsListKeyGroupsInput(v *ListKeyGroupsInput, return nil } +type awsRestxml_serializeOpListKeyValueStores struct { +} + +func (*awsRestxml_serializeOpListKeyValueStores) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpListKeyValueStores) 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.(*ListKeyValueStoresInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/key-value-store") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsListKeyValueStoresInput(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 awsRestxml_serializeOpHttpBindingsListKeyValueStoresInput(v *ListKeyValueStoresInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Marker != nil { + encoder.SetQuery("Marker").String(*v.Marker) + } + + if v.MaxItems != nil { + encoder.SetQuery("MaxItems").Integer(*v.MaxItems) + } + + if v.Status != nil { + encoder.SetQuery("Status").String(*v.Status) + } + + return nil +} + type awsRestxml_serializeOpListOriginAccessControls struct { } @@ -7488,6 +7801,110 @@ func awsRestxml_serializeOpHttpBindingsUpdateKeyGroupInput(v *UpdateKeyGroupInpu return nil } +type awsRestxml_serializeOpUpdateKeyValueStore struct { +} + +func (*awsRestxml_serializeOpUpdateKeyValueStore) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpUpdateKeyValueStore) 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.(*UpdateKeyValueStoreInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/key-value-store/{Name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsUpdateKeyValueStoreInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "UpdateKeyValueStoreRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://cloudfront.amazonaws.com/doc/2020-05-31/")) + if err := awsRestxml_serializeOpDocumentUpdateKeyValueStoreInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsUpdateKeyValueStoreInput(v *UpdateKeyValueStoreInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.IfMatch != nil && len(*v.IfMatch) > 0 { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestxml_serializeOpDocumentUpdateKeyValueStoreInput(v *UpdateKeyValueStoreInput, value smithyxml.Value) error { + defer value.Close() + if v.Comment != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Comment", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Comment) + } + return nil +} + type awsRestxml_serializeOpUpdateOriginAccessControl struct { } @@ -10217,6 +10634,19 @@ func awsRestxml_serializeDocumentFunctionConfig(v *types.FunctionConfig, value s el := value.MemberElement(root) el.String(*v.Comment) } + if v.KeyValueStoreAssociations != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "KeyValueStoreAssociations", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentKeyValueStoreAssociations(v.KeyValueStoreAssociations, el); err != nil { + return err + } + } if len(v.Runtime) > 0 { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ @@ -10320,6 +10750,33 @@ func awsRestxml_serializeDocumentHeaders(v *types.Headers, value smithyxml.Value return nil } +func awsRestxml_serializeDocumentImportSource(v *types.ImportSource, value smithyxml.Value) error { + defer value.Close() + if v.SourceARN != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "SourceARN", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.SourceARN) + } + if len(v.SourceType) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "SourceType", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.SourceType)) + } + return nil +} + func awsRestxml_serializeDocumentInvalidationBatch(v *types.InvalidationBatch, value smithyxml.Value) error { defer value.Close() if v.CallerReference != nil { @@ -10389,6 +10846,73 @@ func awsRestxml_serializeDocumentKeyGroupConfig(v *types.KeyGroupConfig, value s return nil } +func awsRestxml_serializeDocumentKeyValueStoreAssociation(v *types.KeyValueStoreAssociation, value smithyxml.Value) error { + defer value.Close() + if v.KeyValueStoreARN != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "KeyValueStoreARN", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.KeyValueStoreARN) + } + return nil +} + +func awsRestxml_serializeDocumentKeyValueStoreAssociationList(v []types.KeyValueStoreAssociation, value smithyxml.Value) error { + var array *smithyxml.Array + if !value.IsFlattened() { + defer value.Close() + } + customMemberNameAttr := []smithyxml.Attr{} + customMemberName := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "KeyValueStoreAssociation", + }, + Attr: customMemberNameAttr, + } + array = value.ArrayWithCustomName(customMemberName) + for i := range v { + am := array.Member() + if err := awsRestxml_serializeDocumentKeyValueStoreAssociation(&v[i], am); err != nil { + return err + } + } + return nil +} + +func awsRestxml_serializeDocumentKeyValueStoreAssociations(v *types.KeyValueStoreAssociations, value smithyxml.Value) error { + defer value.Close() + if v.Items != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Items", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentKeyValueStoreAssociationList(v.Items, el); err != nil { + return err + } + } + if v.Quantity != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Quantity", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Integer(*v.Quantity) + } + return nil +} + func awsRestxml_serializeDocumentKinesisStreamConfig(v *types.KinesisStreamConfig, value smithyxml.Value) error { defer value.Close() if v.RoleARN != nil { diff --git a/service/cloudfront/types/enums.go b/service/cloudfront/types/enums.go index 25e3bbb686d..de3d0295087 100644 --- a/service/cloudfront/types/enums.go +++ b/service/cloudfront/types/enums.go @@ -276,6 +276,22 @@ func (ICPRecordalStatus) Values() []ICPRecordalStatus { } } +type ImportSourceType string + +// Enum values for ImportSourceType +const ( + ImportSourceTypeS3 ImportSourceType = "S3" +) + +// Values returns all known values for ImportSourceType. 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 (ImportSourceType) Values() []ImportSourceType { + return []ImportSourceType{ + "S3", + } +} + type ItemSelection string // Enum values for ItemSelection diff --git a/service/cloudfront/types/errors.go b/service/cloudfront/types/errors.go index 8a67d69a3d0..3b52e25a8e5 100644 --- a/service/cloudfront/types/errors.go +++ b/service/cloudfront/types/errors.go @@ -141,6 +141,32 @@ func (e *CannotChangeImmutablePublicKeyFields) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The Key Value Store entity cannot be deleted while it is in use. +type CannotDeleteEntityWhileInUse struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CannotDeleteEntityWhileInUse) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CannotDeleteEntityWhileInUse) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CannotDeleteEntityWhileInUse) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CannotDeleteEntityWhileInUse" + } + return *e.ErrorCodeOverride +} +func (e *CannotDeleteEntityWhileInUse) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // If the CallerReference is a value you already sent in a previous request to // create an identity but the content of the CloudFrontOriginAccessIdentityConfig // is different from the original request, CloudFront returns a @@ -335,6 +361,111 @@ func (e *DistributionNotDisabled) ErrorCode() string { } func (e *DistributionNotDisabled) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The Key Value Store entity already exists. You must provide a unique Key Value +// Store entity. +type EntityAlreadyExists struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EntityAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EntityAlreadyExists) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EntityAlreadyExists) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EntityAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *EntityAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The Key Value Store entity limit has been exceeded. +type EntityLimitExceeded struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EntityLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EntityLimitExceeded) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EntityLimitExceeded) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EntityLimitExceeded" + } + return *e.ErrorCodeOverride +} +func (e *EntityLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The Key Value Store entity was not found. +type EntityNotFound struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EntityNotFound) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EntityNotFound) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EntityNotFound) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EntityNotFound" + } + return *e.ErrorCodeOverride +} +func (e *EntityNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The Key Value Store entity size limit was exceeded. +type EntitySizeLimitExceeded struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EntitySizeLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EntitySizeLimitExceeded) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EntitySizeLimitExceeded) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EntitySizeLimitExceeded" + } + return *e.ErrorCodeOverride +} +func (e *EntitySizeLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified configuration for field-level encryption already exists. type FieldLevelEncryptionConfigAlreadyExists struct { Message *string diff --git a/service/cloudfront/types/types.go b/service/cloudfront/types/types.go index 39d155f97c0..cc68fde878b 100644 --- a/service/cloudfront/types/types.go +++ b/service/cloudfront/types/types.go @@ -1916,7 +1916,7 @@ type FieldLevelEncryptionConfig struct { noSmithyDocumentSerde } -// List of field-level encrpytion configurations. +// List of field-level encryption configurations. type FieldLevelEncryptionList struct { // The maximum number of elements you want in the response body. @@ -2031,7 +2031,7 @@ type FieldLevelEncryptionProfileSummary struct { // This member is required. Id *string - // The time when the the field-level encryption profile summary was last updated. + // The time when the field-level encryption profile summary was last updated. // // This member is required. LastModifiedTime *time.Time @@ -2217,11 +2217,14 @@ type FunctionConfig struct { // This member is required. Comment *string - // The function's runtime environment verion. + // The function's runtime environment version. // // This member is required. Runtime FunctionRuntime + // The configuration for the Key Value Store associations. + KeyValueStoreAssociations *KeyValueStoreAssociations + noSmithyDocumentSerde } @@ -2352,6 +2355,22 @@ type Headers struct { noSmithyDocumentSerde } +// The import source for the Key Value Store. +type ImportSource struct { + + // The Amazon Resource Name (ARN) of the import source for the Key Value Store. + // + // This member is required. + SourceARN *string + + // The source type of the import source for the Key Value Store. + // + // This member is required. + SourceType ImportSourceType + + noSmithyDocumentSerde +} + // An invalidation. type Invalidation struct { @@ -2566,6 +2585,89 @@ type KeyPairIds struct { noSmithyDocumentSerde } +// The Key Value Store. Use this to separate data from function code, allowing you +// to update data without having to publish a new version of a function. The Key +// Value Store holds keys and their corresponding values. +type KeyValueStore struct { + + // The Amazon Resource Name (ARN) of the Key Value Store. + // + // This member is required. + ARN *string + + // A comment for the Key Value Store. + // + // This member is required. + Comment *string + + // The unique Id for the Key Value Store. + // + // This member is required. + Id *string + + // The last-modified time of the Key Value Store. + // + // This member is required. + LastModifiedTime *time.Time + + // The name of the Key Value Store. + // + // This member is required. + Name *string + + // The status of the Key Value Store. + Status *string + + noSmithyDocumentSerde +} + +// The Key Value Store association. +type KeyValueStoreAssociation struct { + + // The Amazon Resource Name (ARN) of the Key Value Store association. + // + // This member is required. + KeyValueStoreARN *string + + noSmithyDocumentSerde +} + +// The Key Value Store associations. +type KeyValueStoreAssociations struct { + + // The quantity of Key Value Store associations. + // + // This member is required. + Quantity *int32 + + // The items of the Key Value Store association. + Items []KeyValueStoreAssociation + + noSmithyDocumentSerde +} + +// The Key Value Store list. +type KeyValueStoreList struct { + + // The maximum number of items in the Key Value Store list. + // + // This member is required. + MaxItems *int32 + + // The quantity of the Key Value Store list. + // + // This member is required. + Quantity *int32 + + // The items of the Key Value Store list. + Items []KeyValueStore + + // The next marker associated with the Key Value Store list. + NextMarker *string + + noSmithyDocumentSerde +} + // A list of identifiers for the public keys that CloudFront can use to verify the // signatures of signed URLs and signed cookies. type KGKeyPairIds struct { @@ -2717,8 +2819,8 @@ type MonitoringSubscription struct { // - Use CustomOriginConfig to specify all other kinds of origins, including: // - An Amazon S3 bucket that is configured with static website hosting // - An Elastic Load Balancing load balancer -// - An AWS Elemental MediaPackage endpoint -// - An AWS Elemental MediaStore container +// - An Elemental MediaPackage endpoint +// - An Elemental MediaStore container // - Any other HTTP server, running on an Amazon EC2 instance or any other kind // of host // @@ -2959,7 +3061,7 @@ type OriginCustomHeader struct { // An origin group includes two origins (a primary origin and a second origin to // failover to) and a failover criteria that you specify. You create an origin // group to support origin failover in CloudFront. When you create or update a -// distribution, you can specifiy the origin group instead of a single origin, and +// distribution, you can specify the origin group instead of a single origin, and // CloudFront will failover from the primary origin to the second origin under the // failover conditions that you've chosen. type OriginGroup struct { diff --git a/service/cloudfront/validators.go b/service/cloudfront/validators.go index 093b841fdf7..6f73473dd2b 100644 --- a/service/cloudfront/validators.go +++ b/service/cloudfront/validators.go @@ -250,6 +250,26 @@ func (m *validateOpCreateKeyGroup) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpCreateKeyValueStore struct { +} + +func (*validateOpCreateKeyValueStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateKeyValueStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateKeyValueStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateKeyValueStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateMonitoringSubscription struct { } @@ -570,6 +590,26 @@ func (m *validateOpDeleteKeyGroup) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpDeleteKeyValueStore struct { +} + +func (*validateOpDeleteKeyValueStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteKeyValueStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteKeyValueStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteKeyValueStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteMonitoringSubscription struct { } @@ -710,6 +750,26 @@ func (m *validateOpDescribeFunction) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpDescribeKeyValueStore struct { +} + +func (*validateOpDescribeKeyValueStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeKeyValueStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeKeyValueStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeKeyValueStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetCachePolicyConfig struct { } @@ -1670,6 +1730,26 @@ func (m *validateOpUpdateKeyGroup) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpUpdateKeyValueStore struct { +} + +func (*validateOpUpdateKeyValueStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateKeyValueStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateKeyValueStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateKeyValueStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateOriginAccessControl struct { } @@ -1838,6 +1918,10 @@ func addOpCreateKeyGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateKeyGroup{}, middleware.After) } +func addOpCreateKeyValueStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateKeyValueStore{}, middleware.After) +} + func addOpCreateMonitoringSubscriptionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateMonitoringSubscription{}, middleware.After) } @@ -1902,6 +1986,10 @@ func addOpDeleteKeyGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteKeyGroup{}, middleware.After) } +func addOpDeleteKeyValueStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteKeyValueStore{}, middleware.After) +} + func addOpDeleteMonitoringSubscriptionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMonitoringSubscription{}, middleware.After) } @@ -1930,6 +2018,10 @@ func addOpDescribeFunctionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeFunction{}, middleware.After) } +func addOpDescribeKeyValueStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeKeyValueStore{}, middleware.After) +} + func addOpGetCachePolicyConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetCachePolicyConfig{}, middleware.After) } @@ -2122,6 +2214,10 @@ func addOpUpdateKeyGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateKeyGroup{}, middleware.After) } +func addOpUpdateKeyValueStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateKeyValueStore{}, middleware.After) +} + func addOpUpdateOriginAccessControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateOriginAccessControl{}, middleware.After) } @@ -3065,6 +3161,11 @@ func validateFunctionConfig(v *types.FunctionConfig) error { if len(v.Runtime) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Runtime")) } + if v.KeyValueStoreAssociations != nil { + if err := validateKeyValueStoreAssociations(v.KeyValueStoreAssociations); err != nil { + invalidParams.AddNested("KeyValueStoreAssociations", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3105,6 +3206,24 @@ func validateHeaders(v *types.Headers) error { } } +func validateImportSource(v *types.ImportSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ImportSource"} + if len(v.SourceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SourceType")) + } + if v.SourceARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateInvalidationBatch(v *types.InvalidationBatch) error { if v == nil { return nil @@ -3145,6 +3264,58 @@ func validateKeyGroupConfig(v *types.KeyGroupConfig) error { } } +func validateKeyValueStoreAssociation(v *types.KeyValueStoreAssociation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KeyValueStoreAssociation"} + if v.KeyValueStoreARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyValueStoreARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKeyValueStoreAssociationList(v []types.KeyValueStoreAssociation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KeyValueStoreAssociationList"} + for i := range v { + if err := validateKeyValueStoreAssociation(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKeyValueStoreAssociations(v *types.KeyValueStoreAssociations) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KeyValueStoreAssociations"} + if v.Quantity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Quantity")) + } + if v.Items != nil { + if err := validateKeyValueStoreAssociationList(v.Items); err != nil { + invalidParams.AddNested("Items", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateKinesisStreamConfig(v *types.KinesisStreamConfig) error { if v == nil { return nil @@ -4820,6 +4991,26 @@ func validateOpCreateKeyGroupInput(v *CreateKeyGroupInput) error { } } +func validateOpCreateKeyValueStoreInput(v *CreateKeyValueStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateKeyValueStoreInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ImportSource != nil { + if err := validateImportSource(v.ImportSource); err != nil { + invalidParams.AddNested("ImportSource", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateMonitoringSubscriptionInput(v *CreateMonitoringSubscriptionInput) error { if v == nil { return nil @@ -5107,6 +5298,24 @@ func validateOpDeleteKeyGroupInput(v *DeleteKeyGroupInput) error { } } +func validateOpDeleteKeyValueStoreInput(v *DeleteKeyValueStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteKeyValueStoreInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.IfMatch == nil { + invalidParams.Add(smithy.NewErrParamRequired("IfMatch")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteMonitoringSubscriptionInput(v *DeleteMonitoringSubscriptionInput) error { if v == nil { return nil @@ -5212,6 +5421,21 @@ func validateOpDescribeFunctionInput(v *DescribeFunctionInput) error { } } +func validateOpDescribeKeyValueStoreInput(v *DescribeKeyValueStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeKeyValueStoreInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetCachePolicyConfigInput(v *GetCachePolicyConfigInput) error { if v == nil { return nil @@ -6019,6 +6243,27 @@ func validateOpUpdateKeyGroupInput(v *UpdateKeyGroupInput) error { } } +func validateOpUpdateKeyValueStoreInput(v *UpdateKeyValueStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateKeyValueStoreInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Comment == nil { + invalidParams.Add(smithy.NewErrParamRequired("Comment")) + } + if v.IfMatch == nil { + invalidParams.Add(smithy.NewErrParamRequired("IfMatch")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateOriginAccessControlInput(v *UpdateOriginAccessControlInput) error { if v == nil { return nil diff --git a/service/cloudfrontkeyvaluestore/LICENSE.txt b/service/cloudfrontkeyvaluestore/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/cloudfrontkeyvaluestore/api_client.go b/service/cloudfrontkeyvaluestore/api_client.go new file mode 100644 index 00000000000..cb2b3a83d34 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/api_client.go @@ -0,0 +1,455 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "CloudFront KeyValueStore" +const ServiceAPIVersion = "2022-07-26" + +// Client provides the API client to make operations call for Amazon CloudFront +// KeyValueStore. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + ignoreAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + return client +} + +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttemptOptions(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %v", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %v", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "cloudfrontkeyvaluestore", goModuleVersion)(stack); err != nil { + return err + } + + if len(options.AppID) > 0 { + return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) + } + + return nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/service/cloudfrontkeyvaluestore/api_client_test.go b/service/cloudfrontkeyvaluestore/api_client_test.go new file mode 100644 index 00000000000..f77be76a511 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/cloudfrontkeyvaluestore/api_op_DeleteKey.go b/service/cloudfrontkeyvaluestore/api_op_DeleteKey.go new file mode 100644 index 00000000000..b0400901edb --- /dev/null +++ b/service/cloudfrontkeyvaluestore/api_op_DeleteKey.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the key value pair specified by the key. +func (c *Client) DeleteKey(ctx context.Context, params *DeleteKeyInput, optFns ...func(*Options)) (*DeleteKeyOutput, error) { + if params == nil { + params = &DeleteKeyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteKey", params, optFns, c.addOperationDeleteKeyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteKeyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteKeyInput struct { + + // The current version (ETag) of the Key Value Store that you are deleting keys + // from, which you can get using DescribeKeyValueStore. + // + // This member is required. + IfMatch *string + + // The key to delete. + // + // This member is required. + Key *string + + // The Amazon Resource Name (ARN) of the Key Value Store. + // + // This member is required. + KvsARN *string + + noSmithyDocumentSerde +} + +func (in *DeleteKeyInput) bindEndpointParams(p *EndpointParameters) { + p.KvsARN = in.KvsARN + +} + +// Metadata information about a Key Value Store. +type DeleteKeyOutput struct { + + // The current version identifier of the Key Value Store after the successful + // delete. + // + // This member is required. + ETag *string + + // Number of key value pairs in the Key Value Store after the successful delete. + // + // This member is required. + ItemCount *int32 + + // Total size of the Key Value Store after the successful delete, in bytes. + // + // This member is required. + TotalSizeInBytes *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteKey{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteKey{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteKey"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteKeyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteKey(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteKey(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteKey", + } +} diff --git a/service/cloudfrontkeyvaluestore/api_op_DescribeKeyValueStore.go b/service/cloudfrontkeyvaluestore/api_op_DescribeKeyValueStore.go new file mode 100644 index 00000000000..4a3263591c2 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/api_op_DescribeKeyValueStore.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns metadata information about Key Value Store. +func (c *Client) DescribeKeyValueStore(ctx context.Context, params *DescribeKeyValueStoreInput, optFns ...func(*Options)) (*DescribeKeyValueStoreOutput, error) { + if params == nil { + params = &DescribeKeyValueStoreInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeKeyValueStore", params, optFns, c.addOperationDescribeKeyValueStoreMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeKeyValueStoreOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeKeyValueStoreInput struct { + + // The Amazon Resource Name (ARN) of the Key Value Store. + // + // This member is required. + KvsARN *string + + noSmithyDocumentSerde +} + +func (in *DescribeKeyValueStoreInput) bindEndpointParams(p *EndpointParameters) { + p.KvsARN = in.KvsARN + +} + +// Metadata information about a Key Value Store. +type DescribeKeyValueStoreOutput struct { + + // Date and time when the Key Value Store was created. + // + // This member is required. + Created *time.Time + + // The version identifier for the current version of the Key Value Store. + // + // This member is required. + ETag *string + + // Number of key value pairs in the Key Value Store. + // + // This member is required. + ItemCount *int32 + + // The Amazon Resource Name (ARN) of the Key Value Store. + // + // This member is required. + KvsARN *string + + // Total size of the Key Value Store in bytes. + // + // This member is required. + TotalSizeInBytes *int64 + + // Date and time when the key value pairs in the Key Value Store was last modified. + LastModified *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeKeyValueStoreMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeKeyValueStore{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeKeyValueStore{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeKeyValueStore"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeKeyValueStoreValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeKeyValueStore(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeKeyValueStore(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeKeyValueStore", + } +} diff --git a/service/cloudfrontkeyvaluestore/api_op_GetKey.go b/service/cloudfrontkeyvaluestore/api_op_GetKey.go new file mode 100644 index 00000000000..67f2ebf6564 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/api_op_GetKey.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a key value pair. +func (c *Client) GetKey(ctx context.Context, params *GetKeyInput, optFns ...func(*Options)) (*GetKeyOutput, error) { + if params == nil { + params = &GetKeyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetKey", params, optFns, c.addOperationGetKeyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetKeyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetKeyInput struct { + + // The key to get. + // + // This member is required. + Key *string + + // The Amazon Resource Name (ARN) of the Key Value Store. + // + // This member is required. + KvsARN *string + + noSmithyDocumentSerde +} + +func (in *GetKeyInput) bindEndpointParams(p *EndpointParameters) { + p.KvsARN = in.KvsARN + +} + +// A key value pair. +type GetKeyOutput struct { + + // Number of key value pairs in the Key Value Store. + // + // This member is required. + ItemCount *int32 + + // The key of the key value pair. + // + // This member is required. + Key *string + + // Total size of the Key Value Store in bytes. + // + // This member is required. + TotalSizeInBytes *int64 + + // The value of the key value pair. + // + // This member is required. + Value *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetKey{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetKey{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetKey"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetKeyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetKey(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetKey(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetKey", + } +} diff --git a/service/cloudfrontkeyvaluestore/api_op_ListKeys.go b/service/cloudfrontkeyvaluestore/api_op_ListKeys.go new file mode 100644 index 00000000000..1084020e95a --- /dev/null +++ b/service/cloudfrontkeyvaluestore/api_op_ListKeys.go @@ -0,0 +1,244 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +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/cloudfrontkeyvaluestore/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of key value pairs. +func (c *Client) ListKeys(ctx context.Context, params *ListKeysInput, optFns ...func(*Options)) (*ListKeysOutput, error) { + if params == nil { + params = &ListKeysInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListKeys", params, optFns, c.addOperationListKeysMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListKeysOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListKeysInput struct { + + // The Amazon Resource Name (ARN) of the Key Value Store. + // + // This member is required. + KvsARN *string + + // Maximum number of results that are returned per call. The default is 10 and + // maximum allowed page is 50. + MaxResults *int32 + + // If nextToken is returned in the response, there are more results available. + // Make the next call using the returned token to retrieve the next page. + NextToken *string + + noSmithyDocumentSerde +} + +func (in *ListKeysInput) bindEndpointParams(p *EndpointParameters) { + p.KvsARN = in.KvsARN + +} + +type ListKeysOutput struct { + + // Key value pairs + Items []types.ListKeysResponseListItem + + // If nextToken is returned in the response, there are more results available. + // Make the next call using the returned token to retrieve the next page. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListKeysMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListKeys{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListKeys{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListKeys"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListKeysValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListKeys(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListKeysAPIClient is a client that implements the ListKeys operation. +type ListKeysAPIClient interface { + ListKeys(context.Context, *ListKeysInput, ...func(*Options)) (*ListKeysOutput, error) +} + +var _ ListKeysAPIClient = (*Client)(nil) + +// ListKeysPaginatorOptions is the paginator options for ListKeys +type ListKeysPaginatorOptions struct { + // Maximum number of results that are returned per call. The default is 10 and + // maximum allowed page is 50. + 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 +} + +// ListKeysPaginator is a paginator for ListKeys +type ListKeysPaginator struct { + options ListKeysPaginatorOptions + client ListKeysAPIClient + params *ListKeysInput + nextToken *string + firstPage bool +} + +// NewListKeysPaginator returns a new ListKeysPaginator +func NewListKeysPaginator(client ListKeysAPIClient, params *ListKeysInput, optFns ...func(*ListKeysPaginatorOptions)) *ListKeysPaginator { + if params == nil { + params = &ListKeysInput{} + } + + options := ListKeysPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKeysPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListKeys page. +func (p *ListKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeysOutput, 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.ListKeys(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_opListKeys(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListKeys", + } +} diff --git a/service/cloudfrontkeyvaluestore/api_op_PutKey.go b/service/cloudfrontkeyvaluestore/api_op_PutKey.go new file mode 100644 index 00000000000..bc50ae7587e --- /dev/null +++ b/service/cloudfrontkeyvaluestore/api_op_PutKey.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new key value pair or replaces the value of an existing key. +func (c *Client) PutKey(ctx context.Context, params *PutKeyInput, optFns ...func(*Options)) (*PutKeyOutput, error) { + if params == nil { + params = &PutKeyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutKey", params, optFns, c.addOperationPutKeyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutKeyOutput) + out.ResultMetadata = metadata + return out, nil +} + +// A key value pair. +type PutKeyInput struct { + + // The current version (ETag) of the Key Value Store that you are putting keys + // into, which you can get using DescribeKeyValueStore. + // + // This member is required. + IfMatch *string + + // The key to put. + // + // This member is required. + Key *string + + // The Amazon Resource Name (ARN) of the Key Value Store. + // + // This member is required. + KvsARN *string + + // The value to put. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +func (in *PutKeyInput) bindEndpointParams(p *EndpointParameters) { + p.KvsARN = in.KvsARN + +} + +// Metadata information about a Key Value Store. +type PutKeyOutput struct { + + // The current version identifier of the Key Value Store after the successful put. + // + // This member is required. + ETag *string + + // Number of key value pairs in the Key Value Store after the successful put. + // + // This member is required. + ItemCount *int32 + + // Total size of the Key Value Store after the successful put, in bytes. + // + // This member is required. + TotalSizeInBytes *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutKey{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutKey{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutKey"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpPutKeyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutKey(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutKey(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutKey", + } +} diff --git a/service/cloudfrontkeyvaluestore/api_op_UpdateKeys.go b/service/cloudfrontkeyvaluestore/api_op_UpdateKeys.go new file mode 100644 index 00000000000..b3950276881 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/api_op_UpdateKeys.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +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/cloudfrontkeyvaluestore/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Puts or Deletes multiple key value pairs in a single, all-or-nothing operation. +func (c *Client) UpdateKeys(ctx context.Context, params *UpdateKeysInput, optFns ...func(*Options)) (*UpdateKeysOutput, error) { + if params == nil { + params = &UpdateKeysInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateKeys", params, optFns, c.addOperationUpdateKeysMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateKeysOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateKeysInput struct { + + // The current version (ETag) of the Key Value Store that you are updating keys + // of, which you can get using DescribeKeyValueStore. + // + // This member is required. + IfMatch *string + + // The Amazon Resource Name (ARN) of the Key Value Store. + // + // This member is required. + KvsARN *string + + // List of keys to delete. + Deletes []types.DeleteKeyRequestListItem + + // List of key value pairs to put. + Puts []types.PutKeyRequestListItem + + noSmithyDocumentSerde +} + +func (in *UpdateKeysInput) bindEndpointParams(p *EndpointParameters) { + p.KvsARN = in.KvsARN + +} + +// Metadata information about a Key Value Store. +type UpdateKeysOutput struct { + + // The current version identifier of the Key Value Store after the successful + // update. + // + // This member is required. + ETag *string + + // Number of key value pairs in the Key Value Store after the successful update. + // + // This member is required. + ItemCount *int32 + + // Total size of the Key Value Store after the successful update, in bytes. + // + // This member is required. + TotalSizeInBytes *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateKeysMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateKeys{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateKeys{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateKeys"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateKeysValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateKeys(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateKeys(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateKeys", + } +} diff --git a/service/cloudfrontkeyvaluestore/auth.go b/service/cloudfrontkeyvaluestore/auth.go new file mode 100644 index 00000000000..76fe98deb51 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/auth.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "cloudfront-keyvaluestore") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %v", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %v", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %v", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/cloudfrontkeyvaluestore/deserializers.go b/service/cloudfrontkeyvaluestore/deserializers.go new file mode 100644 index 00000000000..c3afe85ba5e --- /dev/null +++ b/service/cloudfrontkeyvaluestore/deserializers.go @@ -0,0 +1,1757 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" +) + +type awsRestjson1_deserializeOpDeleteKey struct { +} + +func (*awsRestjson1_deserializeOpDeleteKey) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteKey) 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_deserializeOpErrorDeleteKey(response, &metadata) + } + output := &DeleteKeyOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsDeleteKeyOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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_deserializeOpDocumentDeleteKeyOutput(&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_deserializeOpErrorDeleteKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsDeleteKeyOutput(v *DeleteKeyOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentDeleteKeyOutput(v **DeleteKeyOutput, 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 *DeleteKeyOutput + if *v == nil { + sv = &DeleteKeyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ItemCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ItemCount = ptr.Int32(int32(i64)) + } + + case "TotalSizeInBytes": + 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.TotalSizeInBytes = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribeKeyValueStore struct { +} + +func (*awsRestjson1_deserializeOpDescribeKeyValueStore) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeKeyValueStore) 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_deserializeOpErrorDescribeKeyValueStore(response, &metadata) + } + output := &DescribeKeyValueStoreOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsDescribeKeyValueStoreOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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_deserializeOpDocumentDescribeKeyValueStoreOutput(&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_deserializeOpErrorDescribeKeyValueStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsDescribeKeyValueStoreOutput(v *DescribeKeyValueStoreOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentDescribeKeyValueStoreOutput(v **DescribeKeyValueStoreOutput, 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 *DescribeKeyValueStoreOutput + if *v == nil { + sv = &DescribeKeyValueStoreOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Created": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Created = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "ItemCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ItemCount = ptr.Int32(int32(i64)) + } + + case "KvsARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KvsARN to be of type string, got %T instead", value) + } + sv.KvsARN = ptr.String(jtv) + } + + case "LastModified": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "TotalSizeInBytes": + 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.TotalSizeInBytes = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetKey struct { +} + +func (*awsRestjson1_deserializeOpGetKey) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetKey) 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_deserializeOpErrorGetKey(response, &metadata) + } + output := &GetKeyOutput{} + 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_deserializeOpDocumentGetKeyOutput(&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_deserializeOpErrorGetKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetKeyOutput(v **GetKeyOutput, 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 *GetKeyOutput + if *v == nil { + sv = &GetKeyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ItemCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ItemCount = ptr.Int32(int32(i64)) + } + + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Key to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "TotalSizeInBytes": + 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.TotalSizeInBytes = ptr.Int64(i64) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Value to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListKeys struct { +} + +func (*awsRestjson1_deserializeOpListKeys) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListKeys) 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_deserializeOpErrorListKeys(response, &metadata) + } + output := &ListKeysOutput{} + 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_deserializeOpDocumentListKeysOutput(&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_deserializeOpErrorListKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListKeysOutput(v **ListKeysOutput, 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 *ListKeysOutput + if *v == nil { + sv = &ListKeysOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsRestjson1_deserializeDocumentListKeysResponseList(&sv.Items, 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_deserializeOpPutKey struct { +} + +func (*awsRestjson1_deserializeOpPutKey) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutKey) 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_deserializeOpErrorPutKey(response, &metadata) + } + output := &PutKeyOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsPutKeyOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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_deserializeOpDocumentPutKeyOutput(&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_deserializeOpErrorPutKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsPutKeyOutput(v *PutKeyOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentPutKeyOutput(v **PutKeyOutput, 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 *PutKeyOutput + if *v == nil { + sv = &PutKeyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ItemCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ItemCount = ptr.Int32(int32(i64)) + } + + case "TotalSizeInBytes": + 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.TotalSizeInBytes = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateKeys struct { +} + +func (*awsRestjson1_deserializeOpUpdateKeys) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateKeys) 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_deserializeOpErrorUpdateKeys(response, &metadata) + } + output := &UpdateKeysOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsUpdateKeysOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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_deserializeOpDocumentUpdateKeysOutput(&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_deserializeOpErrorUpdateKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsUpdateKeysOutput(v *UpdateKeysOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentUpdateKeysOutput(v **UpdateKeysOutput, 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 *UpdateKeysOutput + if *v == nil { + sv = &UpdateKeysOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ItemCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ItemCount = ptr.Int32(int32(i64)) + } + + case "TotalSizeInBytes": + 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.TotalSizeInBytes = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + 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_deserializeDocumentAccessDeniedException(&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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + 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_deserializeDocumentConflictException(&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_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + 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_deserializeDocumentInternalServerException(&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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + 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_deserializeDocumentResourceNotFoundException(&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_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + 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_deserializeDocumentServiceQuotaExceededException(&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_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + 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_deserializeDocumentValidationException(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, 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.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, 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.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListKeysResponseList(v *[]types.ListKeysResponseListItem, 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.ListKeysResponseListItem + if *v == nil { + cv = []types.ListKeysResponseListItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListKeysResponseListItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentListKeysResponseListItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListKeysResponseListItem(v **types.ListKeysResponseListItem, 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.ListKeysResponseListItem + if *v == nil { + sv = &types.ListKeysResponseListItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Key to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Value to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, 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.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, 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.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, 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.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/cloudfrontkeyvaluestore/doc.go b/service/cloudfrontkeyvaluestore/doc.go new file mode 100644 index 00000000000..f6dc4e8bf2b --- /dev/null +++ b/service/cloudfrontkeyvaluestore/doc.go @@ -0,0 +1,8 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package cloudfrontkeyvaluestore provides the API client, operations, and +// parameter types for Amazon CloudFront KeyValueStore. +// +// Amazon CloudFront KeyValueStore Service to View and Update Data in a KVS +// Resource +package cloudfrontkeyvaluestore diff --git a/service/cloudfrontkeyvaluestore/endpoints.go b/service/cloudfrontkeyvaluestore/endpoints.go new file mode 100644 index 00000000000..e670bf5c278 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/endpoints.go @@ -0,0 +1,612 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore/internal/endpoints" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/endpoints/private/rulesfn" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "key-value-store" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_CLOUDFRONT_KEYVALUESTORE") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "CloudFront KeyValueStore", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The ARN of the Key Value Store + // + // Parameter is required. + KvsARN *string + + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseFIPS := *params.UseFIPS + + if _UseFIPS == false { + if exprVal := params.KvsARN; exprVal != nil { + _KvsARN := *exprVal + _ = _KvsARN + if exprVal := awsrulesfn.ParseARN(_KvsARN); exprVal != nil { + _parsedArn := *exprVal + _ = _parsedArn + if _parsedArn.Service == "cloudfront" { + if _parsedArn.Region == "" { + if exprVal := _parsedArn.ResourceId.Get(0); exprVal != nil { + _arnType := *exprVal + _ = _arnType + if !(_arnType == "") { + if _arnType == "key-value-store" { + if _parsedArn.Partition == "aws" { + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _partitionResult := *exprVal + _ = _partitionResult + if _partitionResult.Name == _parsedArn.Partition { + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if exprVal := rulesfn.ParseURL(_Endpoint); exprVal != nil { + _url := *exprVal + _ = _url + uriString := func() string { + var out strings.Builder + out.WriteString(_url.Scheme) + out.WriteString("://") + out.WriteString(_parsedArn.AccountId) + out.WriteString(".") + out.WriteString(_url.Authority) + out.WriteString(_url.Path) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "cloudfront-keyvaluestore") + smithyhttp.SetSigV4ASigningName(&sp, "cloudfront-keyvaluestore") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Provided endpoint is not a valid URL") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_parsedArn.AccountId) + out.WriteString(".cloudfront-kvs.global.api.aws") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "cloudfront-keyvaluestore") + smithyhttp.SetSigV4ASigningName(&sp, "cloudfront-keyvaluestore") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", func() string { + var out strings.Builder + out.WriteString("Client was configured for partition `") + out.WriteString(_partitionResult.Name) + out.WriteString("` but Kvs ARN has `") + out.WriteString(_parsedArn.Partition) + out.WriteString("`") + return out.String() + }()) + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if exprVal := rulesfn.ParseURL(_Endpoint); exprVal != nil { + _url := *exprVal + _ = _url + uriString := func() string { + var out strings.Builder + out.WriteString(_url.Scheme) + out.WriteString("://") + out.WriteString(_parsedArn.AccountId) + out.WriteString(".") + out.WriteString(_url.Authority) + out.WriteString(_url.Path) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "cloudfront-keyvaluestore") + smithyhttp.SetSigV4ASigningName(&sp, "cloudfront-keyvaluestore") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Provided endpoint is not a valid URL") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_parsedArn.AccountId) + out.WriteString(".cloudfront-kvs.global.api.aws") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "cloudfront-keyvaluestore") + smithyhttp.SetSigV4ASigningName(&sp, "cloudfront-keyvaluestore") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", func() string { + var out strings.Builder + out.WriteString("CloudFront-KeyValueStore is not supported in partition `") + out.WriteString(_parsedArn.Partition) + out.WriteString("`") + return out.String() + }()) + } + return endpoint, fmt.Errorf("endpoint rule error, %s", func() string { + var out strings.Builder + out.WriteString("ARN resource type is invalid. Expected `key-value-store`, found: `") + out.WriteString(_arnType) + out.WriteString("`") + return out.String() + }()) + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "No resource type found in the KVS ARN. Resource type must be `key-value-store`.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "No resource type found in the KVS ARN. Resource type must be `key-value-store`.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", func() string { + var out strings.Builder + out.WriteString("Provided ARN must be a global resource ARN. Found: `") + out.WriteString(_parsedArn.Region) + out.WriteString("`") + return out.String() + }()) + } + return endpoint, fmt.Errorf("endpoint rule error, %s", func() string { + var out strings.Builder + out.WriteString("Provided ARN is not a valid CloudFront Service ARN. Found: `") + out.WriteString(_parsedArn.Service) + out.WriteString("`") + return out.String() + }()) + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "KVS ARN must be a valid ARN") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "KVS ARN must be provided to use this service") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS is not supported with CloudFront-KeyValueStore.") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/cloudfrontkeyvaluestore/endpoints_config_test.go b/service/cloudfrontkeyvaluestore/endpoints_config_test.go new file mode 100644 index 00000000000..f6de294e8ca --- /dev/null +++ b/service/cloudfrontkeyvaluestore/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-cloudfront-keyvaluestore.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-cloudfront-keyvaluestore.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-cloudfront-keyvaluestore.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-cloudfront-keyvaluestore.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-cloudfront-keyvaluestore.dev", + expectURL: aws.String("https://env-cloudfront-keyvaluestore.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-cloudfront-keyvaluestore.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-cloudfront-keyvaluestore.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-cloudfront-keyvaluestore.dev", + expectURL: aws.String("http://config-cloudfront-keyvaluestore.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-cloudfront-keyvaluestore.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-cloudfront-keyvaluestore.dev", + clientEndpoint: aws.String("https://client-cloudfront-keyvaluestore.dev"), + expectURL: aws.String("https://client-cloudfront-keyvaluestore.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_CLOUDFRONT_KEYVALUESTORE", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/cloudfrontkeyvaluestore/endpoints_test.go b/service/cloudfrontkeyvaluestore/endpoints_test.go new file mode 100644 index 00000000000..268976f3f11 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/endpoints_test.go @@ -0,0 +1,435 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/google/go-cmp/cmp" + "net/http" + "net/url" + "strings" + "testing" +) + +// FIPS should error +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS is not supported with CloudFront-KeyValueStore.", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// KVS ARN must be provided to use this service +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "KVS ARN must be provided to use this service", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// KVS ARN must be a valid ARN +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("not-a-valid-arn"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "KVS ARN must be a valid ARN", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Provided ARN was not a valid CloudFront Service ARN. Found: `notcloudfront` +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:notcloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Provided ARN is not a valid CloudFront Service ARN. Found: `notcloudfront`", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Provided ARN must be a global resource ARN. Found: `us-west-2` +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:cloudfront:us-west-2:123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Provided ARN must be a global resource ARN. Found: `us-west-2`", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// ARN resource type is invalid. Expected `key-value-store`, found: +// `some-other-resource-type` +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:cloudfront::123456789012:some-other-resource-type/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "ARN resource type is invalid. Expected `key-value-store`, found: `some-other-resource-type`", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// CloudFront-KeyValueStore is not supported in partition `aws-cn` +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws-cn:cloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "CloudFront-KeyValueStore is not supported in partition `aws-cn`", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// CloudFront-KeyValueStore is not supported in partition `aws-us-gov` +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws-us-gov:cloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "CloudFront-KeyValueStore is not supported in partition `aws-us-gov`", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Valid account based endpoint +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:cloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://123456789012.cloudfront-kvs.global.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "cloudfront-keyvaluestore") + smithyhttp.SetSigV4ASigningName(&sp, "cloudfront-keyvaluestore") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// Valid account based endpoint, with SDK region +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:cloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + Region: ptr.String("us-west-2"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://123456789012.cloudfront-kvs.global.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "cloudfront-keyvaluestore") + smithyhttp.SetSigV4ASigningName(&sp, "cloudfront-keyvaluestore") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// Valid ARN, different partition, should error +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:cloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + Region: ptr.String("cn-north-1"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Client was configured for partition `aws-cn` but Kvs ARN has `aws`", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Valid account based endpoint with FIPS, should error +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:cloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS is not supported with CloudFront-KeyValueStore.", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Custom sdk endpoint override +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:cloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + Region: ptr.String("us-east-1"), + Endpoint: ptr.String("https://my-override.example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://123456789012.my-override.example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "cloudfront-keyvaluestore") + smithyhttp.SetSigV4ASigningName(&sp, "cloudfront-keyvaluestore") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// Custom sdk endpoint override with path and http +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:cloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + Endpoint: ptr.String("http://my-override.example.com/custom-path"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("http://123456789012.my-override.example.com/custom-path") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "cloudfront-keyvaluestore") + smithyhttp.SetSigV4ASigningName(&sp, "cloudfront-keyvaluestore") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// Custom override with different partition should error +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + KvsARN: ptr.String("arn:aws:cloudfront::123456789012:key-value-store/my-first-kvs-e10b1dce4f394248811e77167e0451ba"), + Region: ptr.String("us-gov-east-1"), + Endpoint: ptr.String("https://my-override.example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Client was configured for partition `aws-us-gov` but Kvs ARN has `aws`", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/cloudfrontkeyvaluestore/generated.json b/service/cloudfrontkeyvaluestore/generated.json new file mode 100644 index 00000000000..5c130dfa281 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/generated.json @@ -0,0 +1,37 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/google/go-cmp": "v0.5.4" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_DeleteKey.go", + "api_op_DescribeKeyValueStore.go", + "api_op_GetKey.go", + "api_op_ListKeys.go", + "api_op_PutKey.go", + "api_op_UpdateKeys.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore", + "unstable": false +} diff --git a/service/cloudfrontkeyvaluestore/go.mod b/service/cloudfrontkeyvaluestore/go.mod new file mode 100644 index 00000000000..23a19fe5026 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/go.mod @@ -0,0 +1,17 @@ +module github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore + +go 1.19 + +require ( + github.com/aws/aws-sdk-go-v2 v1.23.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 + github.com/aws/smithy-go v1.17.0 + github.com/google/go-cmp v0.5.8 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/cloudfrontkeyvaluestore/go.sum b/service/cloudfrontkeyvaluestore/go.sum new file mode 100644 index 00000000000..42e4fc806b4 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/go.sum @@ -0,0 +1,4 @@ +github.com/aws/smithy-go v1.17.0 h1:wWJD7LX6PBV6etBUwO0zElG0nWN9rUhp0WdYeHSHAaI= +github.com/aws/smithy-go v1.17.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= diff --git a/service/cloudfrontkeyvaluestore/go_module_metadata.go b/service/cloudfrontkeyvaluestore/go_module_metadata.go new file mode 100644 index 00000000000..547e3f3212b --- /dev/null +++ b/service/cloudfrontkeyvaluestore/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package cloudfrontkeyvaluestore + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/cloudfrontkeyvaluestore/internal/endpoints/endpoints.go b/service/cloudfrontkeyvaluestore/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..3593171ea47 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/internal/endpoints/endpoints.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver CloudFront KeyValueStore endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cloudfront-keyvaluestore-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cloudfront-keyvaluestore.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/cloudfrontkeyvaluestore/internal/endpoints/endpoints_test.go b/service/cloudfrontkeyvaluestore/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/cloudfrontkeyvaluestore/options.go b/service/cloudfrontkeyvaluestore/options.go new file mode 100644 index 00000000000..72f1c83cd65 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/options.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { + options.Credentials = nil + } +} diff --git a/service/cloudfrontkeyvaluestore/protocol_test.go b/service/cloudfrontkeyvaluestore/protocol_test.go new file mode 100644 index 00000000000..0f891175410 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore diff --git a/service/cloudfrontkeyvaluestore/serializers.go b/service/cloudfrontkeyvaluestore/serializers.go new file mode 100644 index 00000000000..a7e62f56b7d --- /dev/null +++ b/service/cloudfrontkeyvaluestore/serializers.go @@ -0,0 +1,565 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpDeleteKey struct { +} + +func (*awsRestjson1_serializeOpDeleteKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteKey) 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.(*DeleteKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/key-value-stores/{KvsARN}/keys/{Key}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteKeyInput(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_serializeOpHttpBindingsDeleteKeyInput(v *DeleteKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.IfMatch != nil && len(*v.IfMatch) > 0 { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.Key == nil || len(*v.Key) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} + } + if v.Key != nil { + if err := encoder.SetURI("Key").String(*v.Key); err != nil { + return err + } + } + + if v.KvsARN == nil || len(*v.KvsARN) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member KvsARN must not be empty")} + } + if v.KvsARN != nil { + if err := encoder.SetURI("KvsARN").String(*v.KvsARN); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDescribeKeyValueStore struct { +} + +func (*awsRestjson1_serializeOpDescribeKeyValueStore) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeKeyValueStore) 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.(*DescribeKeyValueStoreInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/key-value-stores/{KvsARN}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribeKeyValueStoreInput(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_serializeOpHttpBindingsDescribeKeyValueStoreInput(v *DescribeKeyValueStoreInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KvsARN == nil || len(*v.KvsARN) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member KvsARN must not be empty")} + } + if v.KvsARN != nil { + if err := encoder.SetURI("KvsARN").String(*v.KvsARN); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetKey struct { +} + +func (*awsRestjson1_serializeOpGetKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetKey) 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.(*GetKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/key-value-stores/{KvsARN}/keys/{Key}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetKeyInput(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_serializeOpHttpBindingsGetKeyInput(v *GetKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key == nil || len(*v.Key) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} + } + if v.Key != nil { + if err := encoder.SetURI("Key").String(*v.Key); err != nil { + return err + } + } + + if v.KvsARN == nil || len(*v.KvsARN) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member KvsARN must not be empty")} + } + if v.KvsARN != nil { + if err := encoder.SetURI("KvsARN").String(*v.KvsARN); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListKeys struct { +} + +func (*awsRestjson1_serializeOpListKeys) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListKeys) 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.(*ListKeysInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/key-value-stores/{KvsARN}/keys") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListKeysInput(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_serializeOpHttpBindingsListKeysInput(v *ListKeysInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.KvsARN == nil || len(*v.KvsARN) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member KvsARN must not be empty")} + } + if v.KvsARN != nil { + if err := encoder.SetURI("KvsARN").String(*v.KvsARN); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("MaxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpPutKey struct { +} + +func (*awsRestjson1_serializeOpPutKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutKey) 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.(*PutKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/key-value-stores/{KvsARN}/keys/{Key}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutKeyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutKeyInput(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_serializeOpHttpBindingsPutKeyInput(v *PutKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.IfMatch != nil && len(*v.IfMatch) > 0 { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.Key == nil || len(*v.Key) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} + } + if v.Key != nil { + if err := encoder.SetURI("Key").String(*v.Key); err != nil { + return err + } + } + + if v.KvsARN == nil || len(*v.KvsARN) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member KvsARN must not be empty")} + } + if v.KvsARN != nil { + if err := encoder.SetURI("KvsARN").String(*v.KvsARN); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutKeyInput(v *PutKeyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateKeys struct { +} + +func (*awsRestjson1_serializeOpUpdateKeys) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateKeys) 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.(*UpdateKeysInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/key-value-stores/{KvsARN}/keys") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateKeysInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateKeysInput(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_serializeOpHttpBindingsUpdateKeysInput(v *UpdateKeysInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.IfMatch != nil && len(*v.IfMatch) > 0 { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.KvsARN == nil || len(*v.KvsARN) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member KvsARN must not be empty")} + } + if v.KvsARN != nil { + if err := encoder.SetURI("KvsARN").String(*v.KvsARN); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateKeysInput(v *UpdateKeysInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Deletes != nil { + ok := object.Key("Deletes") + if err := awsRestjson1_serializeDocumentDeleteKeyRequestsList(v.Deletes, ok); err != nil { + return err + } + } + + if v.Puts != nil { + ok := object.Key("Puts") + if err := awsRestjson1_serializeDocumentPutKeyRequestsList(v.Puts, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentDeleteKeyRequestListItem(v *types.DeleteKeyRequestListItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeDocumentDeleteKeyRequestsList(v []types.DeleteKeyRequestListItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentDeleteKeyRequestListItem(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPutKeyRequestListItem(v *types.PutKeyRequestListItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentPutKeyRequestsList(v []types.PutKeyRequestListItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPutKeyRequestListItem(&v[i], av); err != nil { + return err + } + } + return nil +} diff --git a/service/cloudfrontkeyvaluestore/types/errors.go b/service/cloudfrontkeyvaluestore/types/errors.go new file mode 100644 index 00000000000..2d24b4bdc5d --- /dev/null +++ b/service/cloudfrontkeyvaluestore/types/errors.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// Access denied. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Resource is not in expected state. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Internal server error. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Resource was not found. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Limit exceeded. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Validation failed. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/cloudfrontkeyvaluestore/types/types.go b/service/cloudfrontkeyvaluestore/types/types.go new file mode 100644 index 00000000000..d072bc5f8f2 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/types/types.go @@ -0,0 +1,52 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// List item for keys to delete. +type DeleteKeyRequestListItem struct { + + // The key of the key value pair to be deleted. + // + // This member is required. + Key *string + + noSmithyDocumentSerde +} + +// A key value pair. +type ListKeysResponseListItem struct { + + // The key of the key value pair. + // + // This member is required. + Key *string + + // The value of the key value pair. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// List item for key value pair to put. +type PutKeyRequestListItem struct { + + // The key of the key value pair list item to put. + // + // This member is required. + Key *string + + // The value for the key value pair to put. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/cloudfrontkeyvaluestore/validators.go b/service/cloudfrontkeyvaluestore/validators.go new file mode 100644 index 00000000000..48d65a227ff --- /dev/null +++ b/service/cloudfrontkeyvaluestore/validators.go @@ -0,0 +1,343 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpDeleteKey struct { +} + +func (*validateOpDeleteKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeKeyValueStore struct { +} + +func (*validateOpDescribeKeyValueStore) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeKeyValueStore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeKeyValueStoreInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeKeyValueStoreInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetKey struct { +} + +func (*validateOpGetKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListKeys struct { +} + +func (*validateOpListKeys) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListKeys) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListKeysInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListKeysInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutKey struct { +} + +func (*validateOpPutKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateKeys struct { +} + +func (*validateOpUpdateKeys) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateKeys) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateKeysInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateKeysInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpDeleteKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteKey{}, middleware.After) +} + +func addOpDescribeKeyValueStoreValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeKeyValueStore{}, middleware.After) +} + +func addOpGetKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetKey{}, middleware.After) +} + +func addOpListKeysValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListKeys{}, middleware.After) +} + +func addOpPutKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutKey{}, middleware.After) +} + +func addOpUpdateKeysValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateKeys{}, middleware.After) +} + +func validateDeleteKeyRequestListItem(v *types.DeleteKeyRequestListItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteKeyRequestListItem"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDeleteKeyRequestsList(v []types.DeleteKeyRequestListItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteKeyRequestsList"} + for i := range v { + if err := validateDeleteKeyRequestListItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePutKeyRequestListItem(v *types.PutKeyRequestListItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutKeyRequestListItem"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePutKeyRequestsList(v []types.PutKeyRequestListItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutKeyRequestsList"} + for i := range v { + if err := validatePutKeyRequestListItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteKeyInput(v *DeleteKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteKeyInput"} + if v.KvsARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("KvsARN")) + } + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.IfMatch == nil { + invalidParams.Add(smithy.NewErrParamRequired("IfMatch")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeKeyValueStoreInput(v *DescribeKeyValueStoreInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeKeyValueStoreInput"} + if v.KvsARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("KvsARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetKeyInput(v *GetKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetKeyInput"} + if v.KvsARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("KvsARN")) + } + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListKeysInput(v *ListKeysInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListKeysInput"} + if v.KvsARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("KvsARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutKeyInput(v *PutKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutKeyInput"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if v.KvsARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("KvsARN")) + } + if v.IfMatch == nil { + invalidParams.Add(smithy.NewErrParamRequired("IfMatch")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateKeysInput(v *UpdateKeysInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateKeysInput"} + if v.KvsARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("KvsARN")) + } + if v.IfMatch == nil { + invalidParams.Add(smithy.NewErrParamRequired("IfMatch")) + } + if v.Puts != nil { + if err := validatePutKeyRequestsList(v.Puts); err != nil { + invalidParams.AddNested("Puts", err.(smithy.InvalidParamsError)) + } + } + if v.Deletes != nil { + if err := validateDeleteKeyRequestsList(v.Deletes); err != nil { + invalidParams.AddNested("Deletes", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/ec2/api_op_CreateVolume.go b/service/ec2/api_op_CreateVolume.go index 5879e984211..defdaadfdcf 100644 --- a/service/ec2/api_op_CreateVolume.go +++ b/service/ec2/api_op_CreateVolume.go @@ -74,14 +74,15 @@ type CreateVolumeInput struct { // For gp2 volumes, this represents the baseline performance of the volume and the // rate at which the volume accumulates I/O credits for bursting. The following are // the supported values for each volume type: - // - gp3 : 3,000-16,000 IOPS - // - io1 : 100-64,000 IOPS - // - io2 : 100-64,000 IOPS - // io1 and io2 volumes support up to 64,000 IOPS only on Instances built on the + // - gp3 : 3,000 - 16,000 IOPS + // - io1 : 100 - 64,000 IOPS + // - io2 : 100 - 256,000 IOPS + // For io2 volumes, you can achieve up to 256,000 IOPS on instances built on the // Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) - // . Other instance families support performance up to 32,000 IOPS. This parameter - // is required for io1 and io2 volumes. The default for gp3 volumes is 3,000 IOPS. - // This parameter is not supported for gp2 , st1 , sc1 , or standard volumes. + // . On other instances, you can achieve performance up to 32,000 IOPS. This + // parameter is required for io1 and io2 volumes. The default for gp3 volumes is + // 3,000 IOPS. This parameter is not supported for gp2 , st1 , sc1 , or standard + // volumes. Iops *int32 // The identifier of the Key Management Service (KMS) KMS key to use for Amazon @@ -114,10 +115,11 @@ type CreateVolumeInput struct { // volume size. If you specify a snapshot, the default is the snapshot size. You // can specify a volume size that is equal to or larger than the snapshot size. The // following are the supported volumes sizes for each volume type: - // - gp2 and gp3 : 1-16,384 - // - io1 and io2 : 4-16,384 - // - st1 and sc1 : 125-16,384 - // - standard : 1-1,024 + // - gp2 and gp3 : 1 - 16,384 GiB + // - io1 : 4 - 16,384 GiB + // - io2 : 4 - 65,536 GiB + // - st1 and sc1 : 125 - 16,384 GiB + // - standard : 1 - 1024 GiB Size *int32 // The snapshot from which to create the volume. You must specify either a diff --git a/service/ec2/api_op_DescribeSpotInstanceRequests.go b/service/ec2/api_op_DescribeSpotInstanceRequests.go index 184169f9fc0..f66677675a5 100644 --- a/service/ec2/api_op_DescribeSpotInstanceRequests.go +++ b/service/ec2/api_op_DescribeSpotInstanceRequests.go @@ -70,9 +70,9 @@ type DescribeSpotInstanceRequestsInput struct { // volume. // - launch.block-device-mapping.volume-size - The size of the EBS volume, in // GiB. - // - launch.block-device-mapping.volume-type - The type of EBS volume: gp2 for - // General Purpose SSD, io1 or io2 for Provisioned IOPS SSD, st1 for Throughput - // Optimized HDD, sc1 for Cold HDD, or standard for Magnetic. + // - launch.block-device-mapping.volume-type - The type of EBS volume: gp2 or gp3 + // for General Purpose SSD, io1 or io2 for Provisioned IOPS SSD, st1 for + // Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic. // - launch.group-id - The ID of the security group for the instance. // - launch.group-name - The name of the security group for the instance. // - launch.image-id - The ID of the AMI. diff --git a/service/ec2/api_op_ModifyVolume.go b/service/ec2/api_op_ModifyVolume.go index 13b1b4b8a8b..e8da31a5e89 100644 --- a/service/ec2/api_op_ModifyVolume.go +++ b/service/ec2/api_op_ModifyVolume.go @@ -63,11 +63,14 @@ type ModifyVolumeInput struct { // The target IOPS rate of the volume. This parameter is valid only for gp3 , io1 , // and io2 volumes. The following are the supported values for each volume type: - // - gp3 : 3,000-16,000 IOPS - // - io1 : 100-64,000 IOPS - // - io2 : 100-64,000 IOPS - // Default: The existing value is retained if you keep the same volume type. If - // you change the volume type to io1 , io2 , or gp3 , the default is 3,000. + // - gp3 : 3,000 - 16,000 IOPS + // - io1 : 100 - 64,000 IOPS + // - io2 : 100 - 256,000 IOPS + // For io2 volumes, you can achieve up to 256,000 IOPS on instances built on the + // Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) + // . On other instances, you can achieve performance up to 32,000 IOPS. Default: + // The existing value is retained if you keep the same volume type. If you change + // the volume type to io1 , io2 , or gp3 , the default is 3,000. Iops *int32 // Specifies whether to enable Amazon EBS Multi-Attach. If you enable @@ -80,10 +83,11 @@ type ModifyVolumeInput struct { // The target size of the volume, in GiB. The target volume size must be greater // than or equal to the existing size of the volume. The following are the // supported volumes sizes for each volume type: - // - gp2 and gp3 : 1-16,384 - // - io1 and io2 : 4-16,384 - // - st1 and sc1 : 125-16,384 - // - standard : 1-1,024 + // - gp2 and gp3 : 1 - 16,384 GiB + // - io1 : 4 - 16,384 GiB + // - io2 : 4 - 65,536 GiB + // - st1 and sc1 : 125 - 16,384 GiB + // - standard : 1 - 1024 GiB // Default: The existing size is retained. Size *int32 diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 58895a30393..f94a1a58d6a 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -3165,15 +3165,14 @@ type EbsBlockDevice struct { // For gp2 volumes, this represents the baseline performance of the volume and the // rate at which the volume accumulates I/O credits for bursting. The following are // the supported values for each volume type: - // - gp3 : 3,000-16,000 IOPS - // - io1 : 100-64,000 IOPS - // - io2 : 100-64,000 IOPS - // For io1 and io2 volumes, we guarantee 64,000 IOPS only for Instances built on - // the Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) - // . Other instance families guarantee performance up to 32,000 IOPS. This + // - gp3 : 3,000 - 16,000 IOPS + // - io1 : 100 - 64,000 IOPS + // - io2 : 100 - 256,000 IOPS + // For io2 volumes, you can achieve up to 256,000 IOPS on instances built on the + // Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) + // . On other instances, you can achieve performance up to 32,000 IOPS. This // parameter is required for io1 and io2 volumes. The default for gp3 volumes is - // 3,000 IOPS. This parameter is not supported for gp2 , st1 , sc1 , or standard - // volumes. + // 3,000 IOPS. Iops *int32 // Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK @@ -3199,16 +3198,16 @@ type EbsBlockDevice struct { // The size of the volume, in GiBs. You must specify either a snapshot ID or a // volume size. If you specify a snapshot, the default is the snapshot size. You // can specify a volume size that is equal to or larger than the snapshot size. The - // following are the supported volumes sizes for each volume type: - // - gp2 and gp3 :1-16,384 - // - io1 and io2 : 4-16,384 - // - st1 and sc1 : 125-16,384 - // - standard : 1-1,024 + // following are the supported sizes for each volume type: + // - gp2 and gp3 : 1 - 16,384 GiB + // - io1 : 4 - 16,384 GiB + // - io2 : 4 - 65,536 GiB + // - st1 and sc1 : 125 - 16,384 GiB + // - standard : 1 - 1024 GiB VolumeSize *int32 // The volume type. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon EC2 User Guide. If the volume type is io1 or io2 , you must - // specify the IOPS that the volume supports. + // in the Amazon EC2 User Guide. VolumeType VolumeType noSmithyDocumentSerde @@ -8746,14 +8745,13 @@ type LaunchTemplateEbsBlockDeviceRequest struct { // For gp2 volumes, this represents the baseline performance of the volume and the // rate at which the volume accumulates I/O credits for bursting. The following are // the supported values for each volume type: - // - gp3 : 3,000-16,000 IOPS - // - io1 : 100-64,000 IOPS - // - io2 : 100-64,000 IOPS - // For io1 and io2 volumes, we guarantee 64,000 IOPS only for Instances built on - // the Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) - // . Other instance families guarantee performance up to 32,000 IOPS. This - // parameter is supported for io1 , io2 , and gp3 volumes only. This parameter is - // not supported for gp2 , st1 , sc1 , or standard volumes. + // - gp3 : 3,000 - 16,000 IOPS + // - io1 : 100 - 64,000 IOPS + // - io2 : 100 - 256,000 IOPS + // For io2 volumes, you can achieve up to 256,000 IOPS on instances built on the + // Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) + // . On other instances, you can achieve performance up to 32,000 IOPS. This + // parameter is supported for io1 , io2 , and gp3 volumes only. Iops *int32 // The ARN of the symmetric Key Management Service (KMS) CMK used for encryption. @@ -8769,10 +8767,11 @@ type LaunchTemplateEbsBlockDeviceRequest struct { // The size of the volume, in GiBs. You must specify either a snapshot ID or a // volume size. The following are the supported volumes sizes for each volume type: // - // - gp2 and gp3 : 1-16,384 - // - io1 and io2 : 4-16,384 - // - st1 and sc1 : 125-16,384 - // - standard : 1-1,024 + // - gp2 and gp3 : 1 - 16,384 GiB + // - io1 : 4 - 16,384 GiB + // - io2 : 4 - 65,536 GiB + // - st1 and sc1 : 125 - 16,384 GiB + // - standard : 1 - 1024 GiB VolumeSize *int32 // The volume type. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) @@ -13459,14 +13458,8 @@ type ScheduledInstancesEbs struct { // only to instances that support them. Encrypted *bool - // The number of I/O operations per second (IOPS) to provision for an io1 or io2 - // volume, with a maximum ratio of 50 IOPS/GiB for io1 , and 500 IOPS/GiB for io2 . - // Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum IOPS of 64,000 - // is guaranteed only on instances built on the Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) - // . Other instance families guarantee performance up to 32,000 IOPS. For more - // information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon EC2 User Guide. This parameter is valid only for Provisioned IOPS - // SSD ( io1 and io2 ) volumes. + // The number of I/O operations per second (IOPS) to provision for a gp3 , io1 , or + // io2 volume. Iops *int32 // The ID of the snapshot. @@ -13476,9 +13469,7 @@ type ScheduledInstancesEbs struct { // snapshot and don't specify a volume size, the default is the snapshot size. VolumeSize *int32 - // The volume type. gp2 for General Purpose SSD, io1 or io2 for Provisioned IOPS - // SSD, Throughput Optimized HDD for st1 , Cold HDD for sc1 , or standard for - // Magnetic. Default: gp2 + // The volume type. Default: gp2 VolumeType *string noSmithyDocumentSerde diff --git a/service/inspectorscan/LICENSE.txt b/service/inspectorscan/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/inspectorscan/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/inspectorscan/api_client.go b/service/inspectorscan/api_client.go new file mode 100644 index 00000000000..b4fd2b9bc05 --- /dev/null +++ b/service/inspectorscan/api_client.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "Inspector Scan" +const ServiceAPIVersion = "2023-08-08" + +// Client provides the API client to make operations call for Inspector Scan. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + ignoreAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + return client +} + +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttemptOptions(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %v", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %v", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "inspectorscan", goModuleVersion)(stack); err != nil { + return err + } + + if len(options.AppID) > 0 { + return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) + } + + return nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/service/inspectorscan/api_client_test.go b/service/inspectorscan/api_client_test.go new file mode 100644 index 00000000000..9da644c59b6 --- /dev/null +++ b/service/inspectorscan/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/inspectorscan/api_op_ScanSbom.go b/service/inspectorscan/api_op_ScanSbom.go new file mode 100644 index 00000000000..56e776776f7 --- /dev/null +++ b/service/inspectorscan/api_op_ScanSbom.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +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/inspectorscan/document" + "github.com/aws/aws-sdk-go-v2/service/inspectorscan/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Scans a provided CycloneDX 1.5 SBOM and reports on any vulnerabilities +// discovered in that SBOM. You can generate compatible SBOMs for your resources +// using the Amazon Inspector SBOM generator . +func (c *Client) ScanSbom(ctx context.Context, params *ScanSbomInput, optFns ...func(*Options)) (*ScanSbomOutput, error) { + if params == nil { + params = &ScanSbomInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ScanSbom", params, optFns, c.addOperationScanSbomMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ScanSbomOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ScanSbomInput struct { + + // The JSON file for the SBOM you want to scan. The SBOM must be in CycloneDX 1.5 + // format. + // + // This member is required. + Sbom document.Interface + + // The output format for the vulnerability report. + OutputFormat types.OutputFormat + + noSmithyDocumentSerde +} + +type ScanSbomOutput struct { + + // The vulnerability report for the scanned SBOM. + Sbom document.Interface + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationScanSbomMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpScanSbom{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpScanSbom{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ScanSbom"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpScanSbomValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opScanSbom(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opScanSbom(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ScanSbom", + } +} diff --git a/service/inspectorscan/auth.go b/service/inspectorscan/auth.go new file mode 100644 index 00000000000..64671eb1beb --- /dev/null +++ b/service/inspectorscan/auth.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "inspector-scan") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %v", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %v", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %v", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/inspectorscan/deserializers.go b/service/inspectorscan/deserializers.go new file mode 100644 index 00000000000..35e7ce55acd --- /dev/null +++ b/service/inspectorscan/deserializers.go @@ -0,0 +1,662 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/inspectorscan/document" + internaldocument "github.com/aws/aws-sdk-go-v2/service/inspectorscan/internal/document" + "github.com/aws/aws-sdk-go-v2/service/inspectorscan/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strconv" + "strings" +) + +type awsRestjson1_deserializeOpScanSbom struct { +} + +func (*awsRestjson1_deserializeOpScanSbom) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpScanSbom) 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_deserializeOpErrorScanSbom(response, &metadata) + } + output := &ScanSbomOutput{} + 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_deserializeOpDocumentScanSbomOutput(&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_deserializeOpErrorScanSbom(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentScanSbomOutput(v **ScanSbomOutput, 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 *ScanSbomOutput + if *v == nil { + sv = &ScanSbomOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sbom": + if err := awsRestjson1_deserializeDocumentSbom(&sv.Sbom, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + 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_deserializeDocumentAccessDeniedException(&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_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + 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_deserializeDocumentInternalServerException(&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 err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + 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_deserializeDocumentThrottlingException(&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 err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + 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_deserializeDocumentValidationException(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, 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.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InternalServerExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.InternalServerExceptionReason(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSbom(v *document.Interface, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + *v = internaldocument.NewDocumentUnmarshaler(value) + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, 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.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, 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.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fields": + if err := awsRestjson1_deserializeDocumentValidationExceptionFields(&sv.Fields, value); err != nil { + return err + } + + 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 "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, 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.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFields(v *[]types.ValidationExceptionField, 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.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/inspectorscan/doc.go b/service/inspectorscan/doc.go new file mode 100644 index 00000000000..4c1c9976766 --- /dev/null +++ b/service/inspectorscan/doc.go @@ -0,0 +1,8 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package inspectorscan provides the API client, operations, and parameter types +// for Inspector Scan. +// +// Amazon Inspector Scan is a vulnerability discovery service that scans a +// provided Software Bill of Materials (SBOM) for security vulnerabilities. +package inspectorscan diff --git a/service/inspectorscan/document/doc.go b/service/inspectorscan/document/doc.go new file mode 100644 index 00000000000..2b06b14f3cd --- /dev/null +++ b/service/inspectorscan/document/doc.go @@ -0,0 +1,66 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package document implements encoding and decoding of open-content that has a JSON-like data model. +// This data-model allows for UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a +// map of UTF-8 strings to these values. +// +// Interface defines the semantics for how a document type is marshalled and unmarshalled for requests and responses +// for the service. To send a document as input to the service you use NewLazyDocument and pass it the Go type to be +// sent to the service. NewLazyDocument returns a document Interface type that encodes the provided Go type during +// the request serialization step after you have invoked an API client operation that uses the document type. +// +// The following examples show how you can create document types using basic Go types. +// +// NewLazyDocument(map[string]interface{}{ +// "favoriteNumber": 42, +// "fruits": []string{"apple", "orange"}, +// "capitals": map[string]interface{}{ +// "Washington": "Olympia", +// "Oregon": "Salem", +// }, +// "skyIsBlue": true, +// }) +// +// NewLazyDocument(3.14159) +// +// NewLazyDocument([]interface{"One", 2, 3, 3.5, "four"}) +// +// NewLazyDocument(true) +// +// Services can send document types as part of their API responses. To retrieve the content of a response document +// you use the UnmarshalSmithyDocument method on the response document. When calling UnmarshalSmithyDocument you pass +// a reference to the Go type that you want to unmarshal and map the response to. +// +// For example, if you expect to receive key/value map from the service response: +// +// var kv map[string]interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&kv); err != nil { +// // handle error +// } +// +// If a service can return one or more data-types in the response, you can use an empty interface and type switch to +// dynamically handle the response type. +// +// var v interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&v); err != nil { +// // handle error +// } +// +// switch vv := v.(type) { +// case map[string]interface{}: +// // handle key/value map +// case []interface{}: +// // handle array of values +// case bool: +// // handle boolean +// case document.Number: +// // handle an arbitrary precision number +// case string: +// // handle string +// default: +// // handle unknown case +// } +// +// The mapping of Go types to document types is covered in more depth in https://pkg.go.dev/github.com/aws/smithy-go/document +// including more in depth examples that cover user-defined structure types. +package document diff --git a/service/inspectorscan/document/document.go b/service/inspectorscan/document/document.go new file mode 100644 index 00000000000..b04ed30c760 --- /dev/null +++ b/service/inspectorscan/document/document.go @@ -0,0 +1,34 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + internaldocument "github.com/aws/aws-sdk-go-v2/service/inspectorscan/internal/document" +) + +// Interface defines a document which is a protocol-agnostic type which supports a +// JSON-like data-model. You can use this type to send UTF-8 strings, arbitrary +// precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 +// strings to these values. +// +// You create a document type using the NewLazyDocument function and passing it +// the Go type to marshal. When receiving a document in an API response, you use +// the document's UnmarshalSmithyDocument function to decode the response to your +// desired Go type. Unless documented specifically generated structure types in +// client packages or client types packages are not supported at this time. Such +// types embed a noSmithyDocumentSerde and will cause an error to be returned when +// attempting to send an API request. +// +// For more information see the accompanying package documentation and linked +// references. +type Interface = internaldocument.Interface + +// You create document type using the NewLazyDocument function and passing it the +// Go type to be marshaled and sent to the service. The document marshaler supports +// semantics similar to the encoding/json Go standard library. +// +// For more information see the accompanying package documentation and linked +// references. +func NewLazyDocument(v interface{}) Interface { + return internaldocument.NewDocumentMarshaler(v) +} diff --git a/service/inspectorscan/endpoints.go b/service/inspectorscan/endpoints.go new file mode 100644 index 00000000000..c58eb1dca39 --- /dev/null +++ b/service/inspectorscan/endpoints.go @@ -0,0 +1,509 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/inspectorscan/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "inspector-scan" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_INSPECTOR_SCAN") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Inspector Scan", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://inspector-scan-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://inspector-scan-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://inspector-scan.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://inspector-scan.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/inspectorscan/endpoints_config_test.go b/service/inspectorscan/endpoints_config_test.go new file mode 100644 index 00000000000..0fb1e60b3c3 --- /dev/null +++ b/service/inspectorscan/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-inspector-scan.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-inspector-scan.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-inspector-scan.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-inspector-scan.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-inspector-scan.dev", + expectURL: aws.String("https://env-inspector-scan.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-inspector-scan.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-inspector-scan.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-inspector-scan.dev", + expectURL: aws.String("http://config-inspector-scan.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-inspector-scan.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-inspector-scan.dev", + clientEndpoint: aws.String("https://client-inspector-scan.dev"), + expectURL: aws.String("https://client-inspector-scan.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_INSPECTOR_SCAN", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/inspectorscan/endpoints_test.go b/service/inspectorscan/endpoints_test.go new file mode 100644 index 00000000000..617818c550e --- /dev/null +++ b/service/inspectorscan/endpoints_test.go @@ -0,0 +1,856 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + "github.com/google/go-cmp/cmp" + "net/http" + "net/url" + "strings" + "testing" +) + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan-fips.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan-fips.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack enabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan-fips.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack disabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan-fips.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack enabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack disabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan-fips.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan-fips.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase18(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://inspector-scan.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For custom endpoint with region set and fips disabled and dualstack disabled +func TestEndpointCase20(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For custom endpoint with region not set and fips disabled and dualstack disabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For custom endpoint with fips enabled and dualstack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For custom endpoint with fips disabled and dualstack enabled +func TestEndpointCase23(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Missing region +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/inspectorscan/generated.json b/service/inspectorscan/generated.json new file mode 100644 index 00000000000..8db46c018e4 --- /dev/null +++ b/service/inspectorscan/generated.json @@ -0,0 +1,37 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/google/go-cmp": "v0.5.4" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_ScanSbom.go", + "auth.go", + "deserializers.go", + "doc.go", + "document/doc.go", + "document/document.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/document/document.go", + "internal/document/document_test.go", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/inspectorscan", + "unstable": false +} diff --git a/service/inspectorscan/go.mod b/service/inspectorscan/go.mod new file mode 100644 index 00000000000..0db8e4ca4b5 --- /dev/null +++ b/service/inspectorscan/go.mod @@ -0,0 +1,17 @@ +module github.com/aws/aws-sdk-go-v2/service/inspectorscan + +go 1.19 + +require ( + github.com/aws/aws-sdk-go-v2 v1.23.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 + github.com/aws/smithy-go v1.17.0 + github.com/google/go-cmp v0.5.8 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/inspectorscan/go.sum b/service/inspectorscan/go.sum new file mode 100644 index 00000000000..42e4fc806b4 --- /dev/null +++ b/service/inspectorscan/go.sum @@ -0,0 +1,4 @@ +github.com/aws/smithy-go v1.17.0 h1:wWJD7LX6PBV6etBUwO0zElG0nWN9rUhp0WdYeHSHAaI= +github.com/aws/smithy-go v1.17.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= diff --git a/service/inspectorscan/go_module_metadata.go b/service/inspectorscan/go_module_metadata.go new file mode 100644 index 00000000000..2cf4a1d701b --- /dev/null +++ b/service/inspectorscan/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package inspectorscan + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/inspectorscan/internal/document/document.go b/service/inspectorscan/internal/document/document.go new file mode 100644 index 00000000000..4b1f38c619f --- /dev/null +++ b/service/inspectorscan/internal/document/document.go @@ -0,0 +1,99 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + "bytes" + "encoding/json" + smithydocument "github.com/aws/smithy-go/document" + smithydocumentjson "github.com/aws/smithy-go/document/json" +) + +// github.com/aws/aws-sdk-go-v2/service/inspectorscan/internal/document.smithyDocument +// is an interface which is used to bind a document type to its service client. +type smithyDocument interface { + isSmithyDocument() +} + +// github.com/aws/aws-sdk-go-v2/service/inspectorscan/internal/document.Interface +// is a JSON-like data model type that is protocol agnostic and is usedto send +// open-content to a service. +type Interface interface { + smithyDocument + smithydocument.Marshaler + smithydocument.Unmarshaler +} + +type documentMarshaler struct { + value interface{} +} + +func (m *documentMarshaler) UnmarshalSmithyDocument(v interface{}) error { + mBytes, err := m.MarshalSmithyDocument() + if err != nil { + return err + } + + jDecoder := json.NewDecoder(bytes.NewReader(mBytes)) + jDecoder.UseNumber() + + var jv interface{} + if err := jDecoder.Decode(&v); err != nil { + return err + } + + return NewDocumentUnmarshaler(v).UnmarshalSmithyDocument(&jv) +} + +func (m *documentMarshaler) MarshalSmithyDocument() ([]byte, error) { + return smithydocumentjson.NewEncoder().Encode(m.value) +} + +func (m *documentMarshaler) isSmithyDocument() {} + +var _ Interface = (*documentMarshaler)(nil) + +type documentUnmarshaler struct { + value interface{} +} + +func (m *documentUnmarshaler) UnmarshalSmithyDocument(v interface{}) error { + decoder := smithydocumentjson.NewDecoder() + return decoder.DecodeJSONInterface(m.value, v) +} + +func (m *documentUnmarshaler) MarshalSmithyDocument() ([]byte, error) { + return json.Marshal(m.value) +} + +func (m *documentUnmarshaler) isSmithyDocument() {} + +var _ Interface = (*documentUnmarshaler)(nil) + +// NewDocumentMarshaler creates a new document marshaler for the given input type +func NewDocumentMarshaler(v interface{}) Interface { + return &documentMarshaler{ + value: v, + } +} + +// NewDocumentUnmarshaler creates a new document unmarshaler for the given service +// response +func NewDocumentUnmarshaler(v interface{}) Interface { + return &documentUnmarshaler{ + value: v, + } +} + +// github.com/aws/aws-sdk-go-v2/service/inspectorscan/internal/document.IsInterface +// returns whether the given Interface implementation is a valid client +// implementation +func IsInterface(v Interface) (ok bool) { + defer func() { + if err := recover(); err != nil { + ok = false + } + }() + v.isSmithyDocument() + return true +} diff --git a/service/inspectorscan/internal/document/document_test.go b/service/inspectorscan/internal/document/document_test.go new file mode 100644 index 00000000000..775645dcd6e --- /dev/null +++ b/service/inspectorscan/internal/document/document_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +var _ smithyDocument = (Interface)(nil) +var _ smithydocument.Marshaler = (Interface)(nil) +var _ smithydocument.Unmarshaler = (Interface)(nil) diff --git a/service/inspectorscan/internal/endpoints/endpoints.go b/service/inspectorscan/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..06215531527 --- /dev/null +++ b/service/inspectorscan/internal/endpoints/endpoints.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver Inspector Scan endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "inspector-scan.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "inspector-scan-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "inspector-scan-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "inspector-scan.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "inspector-scan.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "inspector-scan-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "inspector-scan-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "inspector-scan.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "inspector-scan-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "inspector-scan.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "inspector-scan-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "inspector-scan.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "inspector-scan-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "inspector-scan.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "inspector-scan-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "inspector-scan.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "inspector-scan.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "inspector-scan-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "inspector-scan-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "inspector-scan.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/inspectorscan/internal/endpoints/endpoints_test.go b/service/inspectorscan/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/inspectorscan/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/inspectorscan/options.go b/service/inspectorscan/options.go new file mode 100644 index 00000000000..37d349c1715 --- /dev/null +++ b/service/inspectorscan/options.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { + options.Credentials = nil + } +} diff --git a/service/inspectorscan/protocol_test.go b/service/inspectorscan/protocol_test.go new file mode 100644 index 00000000000..32cc21f5635 --- /dev/null +++ b/service/inspectorscan/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan diff --git a/service/inspectorscan/serializers.go b/service/inspectorscan/serializers.go new file mode 100644 index 00000000000..1d96e805a56 --- /dev/null +++ b/service/inspectorscan/serializers.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/inspectorscan/document" + internaldocument "github.com/aws/aws-sdk-go-v2/service/inspectorscan/internal/document" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpScanSbom struct { +} + +func (*awsRestjson1_serializeOpScanSbom) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpScanSbom) 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.(*ScanSbomInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/scan/sbom") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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_serializeOpDocumentScanSbomInput(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_serializeOpHttpBindingsScanSbomInput(v *ScanSbomInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentScanSbomInput(v *ScanSbomInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.OutputFormat) > 0 { + ok := object.Key("outputFormat") + ok.String(string(v.OutputFormat)) + } + + if v.Sbom != nil { + ok := object.Key("sbom") + if err := awsRestjson1_serializeDocumentSbom(v.Sbom, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSbom(v document.Interface, value smithyjson.Value) error { + if v == nil { + return nil + } + if !internaldocument.IsInterface(v) { + return fmt.Errorf("%T is not a compatible document type", v) + } + db, err := v.MarshalSmithyDocument() + if err != nil { + return err + } + value.Write(db) + return nil +} diff --git a/service/inspectorscan/types/enums.go b/service/inspectorscan/types/enums.go new file mode 100644 index 00000000000..59aa1ba8464 --- /dev/null +++ b/service/inspectorscan/types/enums.go @@ -0,0 +1,64 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type InternalServerExceptionReason string + +// Enum values for InternalServerExceptionReason +const ( + InternalServerExceptionReasonFailedToGenerateSbom InternalServerExceptionReason = "FAILED_TO_GENERATE_SBOM" + InternalServerExceptionReasonOther InternalServerExceptionReason = "OTHER" +) + +// Values returns all known values for InternalServerExceptionReason. 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 (InternalServerExceptionReason) Values() []InternalServerExceptionReason { + return []InternalServerExceptionReason{ + "FAILED_TO_GENERATE_SBOM", + "OTHER", + } +} + +type OutputFormat string + +// Enum values for OutputFormat +const ( + OutputFormatCycloneDx15 OutputFormat = "CYCLONE_DX_1_5" + OutputFormatInspector OutputFormat = "INSPECTOR" +) + +// Values returns all known values for OutputFormat. 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 (OutputFormat) Values() []OutputFormat { + return []OutputFormat{ + "CYCLONE_DX_1_5", + "INSPECTOR", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "UNKNOWN_OPERATION" + ValidationExceptionReasonCannotParse ValidationExceptionReason = "CANNOT_PARSE" + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "FIELD_VALIDATION_FAILED" + ValidationExceptionReasonUnsupportedSbomType ValidationExceptionReason = "UNSUPPORTED_SBOM_TYPE" + ValidationExceptionReasonOther ValidationExceptionReason = "OTHER" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "UNKNOWN_OPERATION", + "CANNOT_PARSE", + "FIELD_VALIDATION_FAILED", + "UNSUPPORTED_SBOM_TYPE", + "OTHER", + } +} diff --git a/service/inspectorscan/types/errors.go b/service/inspectorscan/types/errors.go new file mode 100644 index 00000000000..6699e9dc308 --- /dev/null +++ b/service/inspectorscan/types/errors.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request processing has failed because of an unknown error, exception or +// failure. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + Reason InternalServerExceptionReason + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request has failed validation due to missing required fields or having +// invalid inputs. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + Fields []ValidationExceptionField + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/inspectorscan/types/types.go b/service/inspectorscan/types/types.go new file mode 100644 index 00000000000..a8cd8ec5f03 --- /dev/null +++ b/service/inspectorscan/types/types.go @@ -0,0 +1,26 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// The request has failed validation due to missing required fields or having +// invalid inputs. +type ValidationExceptionField struct { + + // The validation exception message. + // + // This member is required. + Message *string + + // The name of the validation exception. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/inspectorscan/validators.go b/service/inspectorscan/validators.go new file mode 100644 index 00000000000..728bbaaf5c0 --- /dev/null +++ b/service/inspectorscan/validators.go @@ -0,0 +1,49 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpScanSbom struct { +} + +func (*validateOpScanSbom) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpScanSbom) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ScanSbomInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpScanSbomInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpScanSbomValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpScanSbom{}, middleware.After) +} + +func validateOpScanSbomInput(v *ScanSbomInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ScanSbomInput"} + if v.Sbom == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sbom")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/iotsitewise/api_op_AssociateAssets.go b/service/iotsitewise/api_op_AssociateAssets.go index 6ddbae46e71..81cd592a170 100644 --- a/service/iotsitewise/api_op_AssociateAssets.go +++ b/service/iotsitewise/api_op_AssociateAssets.go @@ -32,19 +32,28 @@ func (c *Client) AssociateAssets(ctx context.Context, params *AssociateAssetsInp type AssociateAssetsInput struct { - // The ID of the parent asset. + // The ID of the parent asset. This can be either the actual ID in UUID format, or + // else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string - // The ID of the child asset to be associated. + // The ID of the child asset to be associated. This can be either the actual ID in + // UUID format, or else externalId: followed by the external ID, if it has one. + // For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. ChildAssetId *string - // The ID of a hierarchy in the parent asset's model. Hierarchies allow different - // groupings of assets to be formed that all come from the same asset model. For - // more information, see Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html) + // The ID of a hierarchy in the parent asset's model. (This can be either the + // actual ID in UUID format, or else externalId: followed by the external ID, if + // it has one. For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide.) Hierarchies allow different groupings of assets + // to be formed that all come from the same asset model. For more information, see + // Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html) // in the IoT SiteWise User Guide. // // This member is required. diff --git a/service/iotsitewise/api_op_AssociateTimeSeriesToAssetProperty.go b/service/iotsitewise/api_op_AssociateTimeSeriesToAssetProperty.go index 619a9aee9ca..a42762fdf73 100644 --- a/service/iotsitewise/api_op_AssociateTimeSeriesToAssetProperty.go +++ b/service/iotsitewise/api_op_AssociateTimeSeriesToAssetProperty.go @@ -34,12 +34,18 @@ type AssociateTimeSeriesToAssetPropertyInput struct { // This member is required. Alias *string - // The ID of the asset in which the asset property was created. + // The ID of the asset in which the asset property was created. This can be either + // the actual ID in UUID format, or else externalId: followed by the external ID, + // if it has one. For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string - // The ID of the asset property. + // The ID of the asset property. This can be either the actual ID in UUID format, + // or else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. PropertyId *string diff --git a/service/iotsitewise/api_op_CreateAsset.go b/service/iotsitewise/api_op_CreateAsset.go index 736dd6bbe54..b687ecdf8a5 100644 --- a/service/iotsitewise/api_op_CreateAsset.go +++ b/service/iotsitewise/api_op_CreateAsset.go @@ -32,7 +32,10 @@ func (c *Client) CreateAsset(ctx context.Context, params *CreateAssetInput, optF type CreateAssetInput struct { - // The ID of the asset model from which to create the asset. + // The ID of the asset model from which to create the asset. This can be either + // the actual ID in UUID format, or else externalId: followed by the external ID, + // if it has one. For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetModelId *string @@ -45,6 +48,17 @@ type CreateAssetInput struct { // A description for the asset. AssetDescription *string + // An external ID to assign to the asset. The external ID must be unique within + // your Amazon Web Services account. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + AssetExternalId *string + + // The ID to assign to the asset, if desired. IoT SiteWise automatically generates + // a unique ID for you, so this parameter is never required. However, if you prefer + // to supply your own ID instead, you can specify it here in UUID format. If you + // specify your own ID, it must be globally unique. + AssetId *string + // A unique case-sensitive identifier that you can provide to ensure the // idempotency of the request. Don't reuse this client token if a new idempotent // request is required. @@ -67,8 +81,8 @@ type CreateAssetOutput struct { // This member is required. AssetArn *string - // The ID of the asset. This ID uniquely identifies the asset within IoT SiteWise - // and can be used with other IoT SiteWise APIs. + // The ID of the asset, in UUID format. This ID uniquely identifies the asset + // within IoT SiteWise and can be used with other IoT SiteWise API operations. // // This member is required. AssetId *string diff --git a/service/iotsitewise/api_op_CreateAssetModel.go b/service/iotsitewise/api_op_CreateAssetModel.go index e79f71515a9..3fa2ad61edd 100644 --- a/service/iotsitewise/api_op_CreateAssetModel.go +++ b/service/iotsitewise/api_op_CreateAssetModel.go @@ -17,7 +17,13 @@ import ( // of the same type that have standardized definitions. Each asset created from a // model inherits the asset model's property and hierarchy definitions. For more // information, see Defining asset models (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/define-models.html) -// in the IoT SiteWise User Guide. +// in the IoT SiteWise User Guide. You can create two types of asset models, +// ASSET_MODEL or COMPONENT_MODEL . +// - ASSET_MODEL – (default) An asset model that you can use to create assets. +// Can't be included as a component in another asset model. +// - COMPONENT_MODEL – A reusable component that you can include in the +// composite models of other asset models. You can't create assets directly from +// this type of asset model. func (c *Client) CreateAssetModel(ctx context.Context, params *CreateAssetModelInput, optFns ...func(*Options)) (*CreateAssetModelOutput, error) { if params == nil { params = &CreateAssetModelInput{} @@ -40,15 +46,24 @@ type CreateAssetModelInput struct { // This member is required. AssetModelName *string - // The composite asset models that are part of this asset model. Composite asset - // models are asset models that contain specific properties. Each composite model - // has a type that defines the properties that the composite model supports. Use - // composite asset models to define alarms on this asset model. + // The composite models that are part of this asset model. It groups properties + // (such as attributes, measurements, transforms, and metrics) and child composite + // models that model parts of your industrial equipment. Each composite model has a + // type that defines the properties that the composite model supports. Use + // composite models to define alarms on this asset model. When creating custom + // composite models, you need to use CreateAssetModelCompositeModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModelCompositeModel.html) + // . For more information, see . AssetModelCompositeModels []types.AssetModelCompositeModelDefinition // A description for the asset model. AssetModelDescription *string + // An external ID to assign to the asset model. The external ID must be unique + // within your Amazon Web Services account. For more information, see Using + // external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + AssetModelExternalId *string + // The hierarchy definitions of the asset model. Each hierarchy specifies an asset // model whose assets can be children of any other assets created from this asset // model. For more information, see Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html) @@ -57,6 +72,12 @@ type CreateAssetModelInput struct { // in the IoT SiteWise User Guide. AssetModelHierarchies []types.AssetModelHierarchyDefinition + // The ID to assign to the asset model, if desired. IoT SiteWise automatically + // generates a unique ID for you, so this parameter is never required. However, if + // you prefer to supply your own ID instead, you can specify it here in UUID + // format. If you specify your own ID, it must be globally unique. + AssetModelId *string + // The property definitions of the asset model. For more information, see Asset // properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-properties.html) // in the IoT SiteWise User Guide. You can specify up to 200 properties per asset @@ -64,6 +85,14 @@ type CreateAssetModelInput struct { // in the IoT SiteWise User Guide. AssetModelProperties []types.AssetModelPropertyDefinition + // The type of asset model. + // - ASSET_MODEL – (default) An asset model that you can use to create assets. + // Can't be included as a component in another asset model. + // - COMPONENT_MODEL – A reusable component that you can include in the + // composite models of other asset models. You can't create assets directly from + // this type of asset model. + AssetModelType types.AssetModelType + // A unique case-sensitive identifier that you can provide to ensure the // idempotency of the request. Don't reuse this client token if a new idempotent // request is required. @@ -86,8 +115,8 @@ type CreateAssetModelOutput struct { // This member is required. AssetModelArn *string - // The ID of the asset model. You can use this ID when you call other IoT SiteWise - // APIs. + // The ID of the asset model, in UUID format. You can use this ID when you call + // other IoT SiteWise API operations. // // This member is required. AssetModelId *string diff --git a/service/iotsitewise/api_op_CreateAssetModelCompositeModel.go b/service/iotsitewise/api_op_CreateAssetModelCompositeModel.go new file mode 100644 index 00000000000..d9fcc1ce92e --- /dev/null +++ b/service/iotsitewise/api_op_CreateAssetModelCompositeModel.go @@ -0,0 +1,276 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a custom composite model from specified property and hierarchy +// definitions. There are two types of custom composite models, inline and +// component-model-based . Use component-model-based custom composite models to +// define standard, reusable components. A component-model-based custom composite +// model consists of a name, a description, and the ID of the component model it +// references. A component-model-based custom composite model has no properties of +// its own; its referenced component model provides its associated properties to +// any created assets. For more information, see Custom composite models +// (Components) (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/custom-composite-models.html) +// in the IoT SiteWise User Guide. Use inline custom composite models to organize +// the properties of an asset model. The properties of inline custom composite +// models are local to the asset model where they are included and can't be used to +// create multiple assets. To create a component-model-based model, specify the +// composedAssetModelId of an existing asset model with assetModelType of +// COMPONENT_MODEL . To create an inline model, specify the +// assetModelCompositeModelProperties and don't include an composedAssetModelId . +func (c *Client) CreateAssetModelCompositeModel(ctx context.Context, params *CreateAssetModelCompositeModelInput, optFns ...func(*Options)) (*CreateAssetModelCompositeModelOutput, error) { + if params == nil { + params = &CreateAssetModelCompositeModelInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAssetModelCompositeModel", params, optFns, c.addOperationCreateAssetModelCompositeModelMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAssetModelCompositeModelOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAssetModelCompositeModelInput struct { + + // A unique, friendly name for the composite model. + // + // This member is required. + AssetModelCompositeModelName *string + + // The composite model type. Valid values are AWS/ALARM , CUSTOM , or + // AWS/L4E_ANOMALY . + // + // This member is required. + AssetModelCompositeModelType *string + + // The ID of the asset model this composite model is a part of. + // + // This member is required. + AssetModelId *string + + // A description for the composite model. + AssetModelCompositeModelDescription *string + + // An external ID to assign to the composite model. If the composite model is a + // derived composite model, or one nested inside a component model, you can only + // set the external ID using UpdateAssetModelCompositeModel and specifying the + // derived ID of the model or property from the created model it's a part of. + AssetModelCompositeModelExternalId *string + + // The ID of the composite model. IoT SiteWise automatically generates a unique ID + // for you, so this parameter is never required. However, if you prefer to supply + // your own ID instead, you can specify it here in UUID format. If you specify your + // own ID, it must be globally unique. + AssetModelCompositeModelId *string + + // The property definitions of the composite model. For more information, see . + // You can specify up to 200 properties per composite model. For more information, + // see Quotas (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html) + // in the IoT SiteWise User Guide. + AssetModelCompositeModelProperties []types.AssetModelPropertyDefinition + + // A unique case-sensitive identifier that you can provide to ensure the + // idempotency of the request. Don't reuse this client token if a new idempotent + // request is required. + ClientToken *string + + // The ID of a composite model on this asset. + ComposedAssetModelId *string + + // The ID of the parent composite model in this asset model relationship. + ParentAssetModelCompositeModelId *string + + noSmithyDocumentSerde +} + +type CreateAssetModelCompositeModelOutput struct { + + // The ID of the composed asset model. You can use this ID when you call other IoT + // SiteWise APIs. + // + // This member is required. + AssetModelCompositeModelId *string + + // The path to the composite model listing the parent composite models. + // + // This member is required. + AssetModelCompositeModelPath []types.AssetModelCompositeModelPathSegment + + // Contains current status information for an asset model. For more information, + // see Asset and model states (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html) + // in the IoT SiteWise User Guide. + // + // This member is required. + AssetModelStatus *types.AssetModelStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAssetModelCompositeModelMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAssetModelCompositeModel{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAssetModelCompositeModel{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAssetModelCompositeModel"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opCreateAssetModelCompositeModelMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateAssetModelCompositeModelMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAssetModelCompositeModelValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssetModelCompositeModel(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opCreateAssetModelCompositeModelMiddleware struct { +} + +func (*endpointPrefix_opCreateAssetModelCompositeModelMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateAssetModelCompositeModelMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opCreateAssetModelCompositeModelMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opCreateAssetModelCompositeModelMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +type idempotencyToken_initializeOpCreateAssetModelCompositeModel struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAssetModelCompositeModel) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAssetModelCompositeModel) 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.(*CreateAssetModelCompositeModelInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAssetModelCompositeModelInput ") + } + + 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_opCreateAssetModelCompositeModelMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAssetModelCompositeModel{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAssetModelCompositeModel(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAssetModelCompositeModel", + } +} diff --git a/service/iotsitewise/api_op_CreateBulkImportJob.go b/service/iotsitewise/api_op_CreateBulkImportJob.go index be264b5d011..111ac766fc8 100644 --- a/service/iotsitewise/api_op_CreateBulkImportJob.go +++ b/service/iotsitewise/api_op_CreateBulkImportJob.go @@ -14,10 +14,11 @@ import ( // Defines a job to ingest data to IoT SiteWise from Amazon S3. For more // information, see Create a bulk import job (CLI) (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/CreateBulkImportJob.html) -// in the Amazon Simple Storage Service User Guide. You must enable IoT SiteWise to -// export data to Amazon S3 before you create a bulk import job. For more +// in the Amazon Simple Storage Service User Guide. Before you create a bulk import +// job, you must enable IoT SiteWise warm tier or IoT SiteWise cold tier. For more // information about how to configure storage settings, see PutStorageConfiguration (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_PutStorageConfiguration.html) -// . +// . Bulk import is designed to store historical data to IoT SiteWise. It does not +// trigger computations or notifications on IoT SiteWise warm or cold tier storage. func (c *Client) CreateBulkImportJob(ctx context.Context, params *CreateBulkImportJobInput, optFns ...func(*Options)) (*CreateBulkImportJobOutput, error) { if params == nil { params = &CreateBulkImportJobInput{} @@ -63,6 +64,15 @@ type CreateBulkImportJobInput struct { // This member is required. JobRoleArn *string + // If set to true, ingest new data into IoT SiteWise storage. Measurements with + // notifications, metrics and transforms are computed. If set to false, historical + // data is ingested into IoT SiteWise as is. + AdaptiveIngestion *bool + + // If set to true, your data files is deleted from S3, after ingestion into IoT + // SiteWise storage. + DeleteFilesAfterImport *bool + noSmithyDocumentSerde } @@ -78,7 +88,7 @@ type CreateBulkImportJobOutput struct { // This member is required. JobName *string - // The status of the bulk import job can be one of following values. + // The status of the bulk import job can be one of following values: // - PENDING – IoT SiteWise is waiting for the current bulk import job to finish. // - CANCELLED – The bulk import job has been canceled. // - RUNNING – IoT SiteWise is processing your request to import your data from diff --git a/service/iotsitewise/api_op_CreateGateway.go b/service/iotsitewise/api_op_CreateGateway.go index 944c059f074..91b64fe1a7d 100644 --- a/service/iotsitewise/api_op_CreateGateway.go +++ b/service/iotsitewise/api_op_CreateGateway.go @@ -61,7 +61,7 @@ type CreateGatewayOutput struct { GatewayArn *string // The ID of the gateway device. You can use this ID when you call other IoT - // SiteWise APIs. + // SiteWise API operations. // // This member is required. GatewayId *string diff --git a/service/iotsitewise/api_op_CreatePortal.go b/service/iotsitewise/api_op_CreatePortal.go index 6da7ed8c85d..3aecc7d3d78 100644 --- a/service/iotsitewise/api_op_CreatePortal.go +++ b/service/iotsitewise/api_op_CreatePortal.go @@ -74,10 +74,10 @@ type CreatePortalInput struct { // The service to use to authenticate users to the portal. Choose from the // following options: - // - SSO – The portal uses IAM Identity Center (successor to Single Sign-On) to - // authenticate users and manage user permissions. Before you can create a portal - // that uses IAM Identity Center, you must enable IAM Identity Center. For more - // information, see Enabling IAM Identity Center (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-get-started.html#mon-gs-sso) + // - SSO – The portal uses IAM Identity Center to authenticate users and manage + // user permissions. Before you can create a portal that uses IAM Identity Center, + // you must enable IAM Identity Center. For more information, see Enabling IAM + // Identity Center (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-get-started.html#mon-gs-sso) // in the IoT SiteWise User Guide. This option is only available in Amazon Web // Services Regions other than the China Regions. // - IAM – The portal uses Identity and Access Management to authenticate users diff --git a/service/iotsitewise/api_op_DeleteAsset.go b/service/iotsitewise/api_op_DeleteAsset.go index 9d40f0c8761..4bc07d66574 100644 --- a/service/iotsitewise/api_op_DeleteAsset.go +++ b/service/iotsitewise/api_op_DeleteAsset.go @@ -34,7 +34,10 @@ func (c *Client) DeleteAsset(ctx context.Context, params *DeleteAssetInput, optF type DeleteAssetInput struct { - // The ID of the asset to delete. + // The ID of the asset to delete. This can be either the actual ID in UUID format, + // or else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string diff --git a/service/iotsitewise/api_op_DeleteAssetModel.go b/service/iotsitewise/api_op_DeleteAssetModel.go index 9298ceecfd7..daad0b2d951 100644 --- a/service/iotsitewise/api_op_DeleteAssetModel.go +++ b/service/iotsitewise/api_op_DeleteAssetModel.go @@ -35,7 +35,10 @@ func (c *Client) DeleteAssetModel(ctx context.Context, params *DeleteAssetModelI type DeleteAssetModelInput struct { - // The ID of the asset model to delete. + // The ID of the asset model to delete. This can be either the actual ID in UUID + // format, or else externalId: followed by the external ID, if it has one. For + // more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetModelId *string diff --git a/service/iotsitewise/api_op_DeleteAssetModelCompositeModel.go b/service/iotsitewise/api_op_DeleteAssetModelCompositeModel.go new file mode 100644 index 00000000000..324676777d9 --- /dev/null +++ b/service/iotsitewise/api_op_DeleteAssetModelCompositeModel.go @@ -0,0 +1,222 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a composite model. This action can't be undone. You must delete all +// assets created from a composite model before you can delete the model. Also, you +// can't delete a composite model if a parent asset model exists that contains a +// property formula expression that depends on the asset model that you want to +// delete. For more information, see Deleting assets and models (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/delete-assets-and-models.html) +// in the IoT SiteWise User Guide. +func (c *Client) DeleteAssetModelCompositeModel(ctx context.Context, params *DeleteAssetModelCompositeModelInput, optFns ...func(*Options)) (*DeleteAssetModelCompositeModelOutput, error) { + if params == nil { + params = &DeleteAssetModelCompositeModelInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAssetModelCompositeModel", params, optFns, c.addOperationDeleteAssetModelCompositeModelMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAssetModelCompositeModelOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAssetModelCompositeModelInput struct { + + // The ID of a composite model on this asset model. + // + // This member is required. + AssetModelCompositeModelId *string + + // The ID of the asset model, in UUID format. + // + // This member is required. + AssetModelId *string + + // A unique case-sensitive identifier that you can provide to ensure the + // idempotency of the request. Don't reuse this client token if a new idempotent + // request is required. + ClientToken *string + + noSmithyDocumentSerde +} + +type DeleteAssetModelCompositeModelOutput struct { + + // Contains current status information for an asset model. For more information, + // see Asset and model states (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html) + // in the IoT SiteWise User Guide. + // + // This member is required. + AssetModelStatus *types.AssetModelStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAssetModelCompositeModelMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAssetModelCompositeModel{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAssetModelCompositeModel{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAssetModelCompositeModel"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDeleteAssetModelCompositeModelMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteAssetModelCompositeModelMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteAssetModelCompositeModelValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAssetModelCompositeModel(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDeleteAssetModelCompositeModelMiddleware struct { +} + +func (*endpointPrefix_opDeleteAssetModelCompositeModelMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDeleteAssetModelCompositeModelMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDeleteAssetModelCompositeModelMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDeleteAssetModelCompositeModelMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +type idempotencyToken_initializeOpDeleteAssetModelCompositeModel struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteAssetModelCompositeModel) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteAssetModelCompositeModel) 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.(*DeleteAssetModelCompositeModelInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteAssetModelCompositeModelInput ") + } + + 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_opDeleteAssetModelCompositeModelMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteAssetModelCompositeModel{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteAssetModelCompositeModel(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAssetModelCompositeModel", + } +} diff --git a/service/iotsitewise/api_op_DeleteTimeSeries.go b/service/iotsitewise/api_op_DeleteTimeSeries.go index 6048875a496..2050e448daf 100644 --- a/service/iotsitewise/api_op_DeleteTimeSeries.go +++ b/service/iotsitewise/api_op_DeleteTimeSeries.go @@ -41,7 +41,10 @@ type DeleteTimeSeriesInput struct { // The alias that identifies the time series. Alias *string - // The ID of the asset in which the asset property was created. + // The ID of the asset in which the asset property was created. This can be either + // the actual ID in UUID format, or else externalId: followed by the external ID, + // if it has one. For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. AssetId *string // A unique case-sensitive identifier that you can provide to ensure the @@ -49,7 +52,10 @@ type DeleteTimeSeriesInput struct { // request is required. ClientToken *string - // The ID of the asset property. + // The ID of the asset property. This can be either the actual ID in UUID format, + // or else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. PropertyId *string noSmithyDocumentSerde diff --git a/service/iotsitewise/api_op_DescribeAction.go b/service/iotsitewise/api_op_DescribeAction.go new file mode 100644 index 00000000000..0e8ebf6bda1 --- /dev/null +++ b/service/iotsitewise/api_op_DescribeAction.go @@ -0,0 +1,190 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about an action. +func (c *Client) DescribeAction(ctx context.Context, params *DescribeActionInput, optFns ...func(*Options)) (*DescribeActionOutput, error) { + if params == nil { + params = &DescribeActionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeAction", params, optFns, c.addOperationDescribeActionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeActionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeActionInput struct { + + // The ID of the action. + // + // This member is required. + ActionId *string + + noSmithyDocumentSerde +} + +type DescribeActionOutput struct { + + // The ID of the action definition. + // + // This member is required. + ActionDefinitionId *string + + // The ID of the action. + // + // This member is required. + ActionId *string + + // The JSON payload of the action. + // + // This member is required. + ActionPayload *types.ActionPayload + + // The time the action was executed. + // + // This member is required. + ExecutionTime *time.Time + + // The resource the action will be taken on. + // + // This member is required. + TargetResource *types.TargetResource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeActionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAction{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAction{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAction"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDescribeActionMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeActionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAction(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDescribeActionMiddleware struct { +} + +func (*endpointPrefix_opDescribeActionMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDescribeActionMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDescribeActionMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDescribeActionMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opDescribeAction(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeAction", + } +} diff --git a/service/iotsitewise/api_op_DescribeAsset.go b/service/iotsitewise/api_op_DescribeAsset.go index 6867a5c12e5..7ff778a91a0 100644 --- a/service/iotsitewise/api_op_DescribeAsset.go +++ b/service/iotsitewise/api_op_DescribeAsset.go @@ -35,7 +35,10 @@ func (c *Client) DescribeAsset(ctx context.Context, params *DescribeAssetInput, type DescribeAssetInput struct { - // The ID of the asset. + // The ID of the asset. This can be either the actual ID in UUID format, or else + // externalId: followed by the external ID, if it has one. For more information, + // see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string @@ -66,7 +69,7 @@ type DescribeAssetOutput struct { // This member is required. AssetHierarchies []types.AssetHierarchy - // The ID of the asset. + // The ID of the asset, in UUID format. // // This member is required. AssetId *string @@ -98,12 +101,18 @@ type DescribeAssetOutput struct { // This member is required. AssetStatus *types.AssetStatus + // The list of the immediate child custom composite model summaries for the asset. + AssetCompositeModelSummaries []types.AssetCompositeModelSummary + // The composite models for the asset. AssetCompositeModels []types.AssetCompositeModel // A description for the asset. AssetDescription *string + // The external ID of the asset, if any. + AssetExternalId *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/iotsitewise/api_op_DescribeAssetCompositeModel.go b/service/iotsitewise/api_op_DescribeAssetCompositeModel.go new file mode 100644 index 00000000000..1f7c4cf7cf9 --- /dev/null +++ b/service/iotsitewise/api_op_DescribeAssetCompositeModel.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information about an asset composite model (also known as an asset +// component). An AssetCompositeModel is an instance of an AssetModelCompositeModel +// . If you want to see information about the model this is based on, call +// DescribeAssetModelCompositeModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetModelCompositeModel.html) +// . +func (c *Client) DescribeAssetCompositeModel(ctx context.Context, params *DescribeAssetCompositeModelInput, optFns ...func(*Options)) (*DescribeAssetCompositeModelOutput, error) { + if params == nil { + params = &DescribeAssetCompositeModelInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeAssetCompositeModel", params, optFns, c.addOperationDescribeAssetCompositeModelMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeAssetCompositeModelOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeAssetCompositeModelInput struct { + + // The ID of a composite model on this asset. This can be either the actual ID in + // UUID format, or else externalId: followed by the external ID, if it has one. + // For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. + // + // This member is required. + AssetCompositeModelId *string + + // The ID of the asset. This can be either the actual ID in UUID format, or else + // externalId: followed by the external ID, if it has one. For more information, + // see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. + // + // This member is required. + AssetId *string + + noSmithyDocumentSerde +} + +type DescribeAssetCompositeModelOutput struct { + + // A description for the composite model. + // + // This member is required. + AssetCompositeModelDescription *string + + // The ID of a composite model on this asset. + // + // This member is required. + AssetCompositeModelId *string + + // The unique, friendly name for the composite model. + // + // This member is required. + AssetCompositeModelName *string + + // The path to the composite model listing the parent composite models. + // + // This member is required. + AssetCompositeModelPath []types.AssetCompositeModelPathSegment + + // The property definitions of the composite model that was used to create the + // asset. + // + // This member is required. + AssetCompositeModelProperties []types.AssetProperty + + // The list of composite model summaries. + // + // This member is required. + AssetCompositeModelSummaries []types.AssetCompositeModelSummary + + // The composite model type. Valid values are AWS/ALARM , CUSTOM , or + // AWS/L4E_ANOMALY . + // + // This member is required. + AssetCompositeModelType *string + + // The ID of the asset, in UUID format. This ID uniquely identifies the asset + // within IoT SiteWise and can be used with other IoT SiteWise APIs. + // + // This member is required. + AssetId *string + + // The available actions for a composite model on this asset. + ActionDefinitions []types.ActionDefinition + + // An external ID to assign to the asset model. If the composite model is a + // component-based composite model, or one nested inside a component model, you can + // only set the external ID using UpdateAssetModelCompositeModel and specifying + // the derived ID of the model or property from the created model it's a part of. + AssetCompositeModelExternalId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeAssetCompositeModelMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAssetCompositeModel{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAssetCompositeModel{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAssetCompositeModel"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDescribeAssetCompositeModelMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeAssetCompositeModelValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssetCompositeModel(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDescribeAssetCompositeModelMiddleware struct { +} + +func (*endpointPrefix_opDescribeAssetCompositeModelMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDescribeAssetCompositeModelMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDescribeAssetCompositeModelMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDescribeAssetCompositeModelMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opDescribeAssetCompositeModel(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeAssetCompositeModel", + } +} diff --git a/service/iotsitewise/api_op_DescribeAssetModel.go b/service/iotsitewise/api_op_DescribeAssetModel.go index 2a4dc6cb560..1ca365180a5 100644 --- a/service/iotsitewise/api_op_DescribeAssetModel.go +++ b/service/iotsitewise/api_op_DescribeAssetModel.go @@ -35,7 +35,10 @@ func (c *Client) DescribeAssetModel(ctx context.Context, params *DescribeAssetMo type DescribeAssetModelInput struct { - // The ID of the asset model. + // The ID of the asset model. This can be either the actual ID in UUID format, or + // else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetModelId *string @@ -72,7 +75,7 @@ type DescribeAssetModelOutput struct { // This member is required. AssetModelHierarchies []types.AssetModelHierarchy - // The ID of the asset model. + // The ID of the asset model, in UUID format. // // This member is required. AssetModelId *string @@ -100,9 +103,25 @@ type DescribeAssetModelOutput struct { // This member is required. AssetModelStatus *types.AssetModelStatus - // The list of composite asset models for the asset model. + // The list of the immediate child custom composite model summaries for the asset + // model. + AssetModelCompositeModelSummaries []types.AssetModelCompositeModelSummary + + // The list of built-in composite models for the asset model, such as those with + // those of type AWS/ALARMS . AssetModelCompositeModels []types.AssetModelCompositeModel + // The external ID of the asset model, if any. + AssetModelExternalId *string + + // The type of asset model. + // - ASSET_MODEL – (default) An asset model that you can use to create assets. + // Can't be included as a component in another asset model. + // - COMPONENT_MODEL – A reusable component that you can include in the + // composite models of other asset models. You can't create assets directly from + // this type of asset model. + AssetModelType types.AssetModelType + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/iotsitewise/api_op_DescribeAssetModelCompositeModel.go b/service/iotsitewise/api_op_DescribeAssetModelCompositeModel.go new file mode 100644 index 00000000000..fc49247cc75 --- /dev/null +++ b/service/iotsitewise/api_op_DescribeAssetModelCompositeModel.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information about an asset model composite model (also known as an +// asset model component). For more information, see Custom composite models +// (Components) (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/custom-composite-models.html) +// in the IoT SiteWise User Guide. +func (c *Client) DescribeAssetModelCompositeModel(ctx context.Context, params *DescribeAssetModelCompositeModelInput, optFns ...func(*Options)) (*DescribeAssetModelCompositeModelOutput, error) { + if params == nil { + params = &DescribeAssetModelCompositeModelInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeAssetModelCompositeModel", params, optFns, c.addOperationDescribeAssetModelCompositeModelMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeAssetModelCompositeModelOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeAssetModelCompositeModelInput struct { + + // The ID of a composite model on this asset model. This can be either the actual + // ID in UUID format, or else externalId: followed by the external ID, if it has + // one. For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. + // + // This member is required. + AssetModelCompositeModelId *string + + // The ID of the asset model. This can be either the actual ID in UUID format, or + // else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. + // + // This member is required. + AssetModelId *string + + noSmithyDocumentSerde +} + +type DescribeAssetModelCompositeModelOutput struct { + + // The description for the composite model. + // + // This member is required. + AssetModelCompositeModelDescription *string + + // The ID of a composite model on this asset model. + // + // This member is required. + AssetModelCompositeModelId *string + + // The unique, friendly name for the composite model. + // + // This member is required. + AssetModelCompositeModelName *string + + // The path to the composite model listing the parent composite models. + // + // This member is required. + AssetModelCompositeModelPath []types.AssetModelCompositeModelPathSegment + + // The property definitions of the composite model. + // + // This member is required. + AssetModelCompositeModelProperties []types.AssetModelProperty + + // The list of composite model summaries for the composite model. + // + // This member is required. + AssetModelCompositeModelSummaries []types.AssetModelCompositeModelSummary + + // The composite model type. Valid values are AWS/ALARM , CUSTOM , or + // AWS/L4E_ANOMALY . + // + // This member is required. + AssetModelCompositeModelType *string + + // The ID of the asset model, in UUID format. + // + // This member is required. + AssetModelId *string + + // The available actions for a composite model on this asset model. + ActionDefinitions []types.ActionDefinition + + // The external ID of a composite model on this asset model. + AssetModelCompositeModelExternalId *string + + // Metadata for the composition relationship established by using + // composedAssetModelId in CreateAssetModelCompositeModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModelCompositeModel.html) + // . For instance, an array detailing the path of the composition relationship for + // this composite model. + CompositionDetails *types.CompositionDetails + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeAssetModelCompositeModelMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAssetModelCompositeModel{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAssetModelCompositeModel{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAssetModelCompositeModel"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opDescribeAssetModelCompositeModelMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeAssetModelCompositeModelValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssetModelCompositeModel(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opDescribeAssetModelCompositeModelMiddleware struct { +} + +func (*endpointPrefix_opDescribeAssetModelCompositeModelMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opDescribeAssetModelCompositeModelMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opDescribeAssetModelCompositeModelMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opDescribeAssetModelCompositeModelMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opDescribeAssetModelCompositeModel(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeAssetModelCompositeModel", + } +} diff --git a/service/iotsitewise/api_op_DescribeAssetProperty.go b/service/iotsitewise/api_op_DescribeAssetProperty.go index 206550966d0..d3b4e29dc04 100644 --- a/service/iotsitewise/api_op_DescribeAssetProperty.go +++ b/service/iotsitewise/api_op_DescribeAssetProperty.go @@ -36,12 +36,18 @@ func (c *Client) DescribeAssetProperty(ctx context.Context, params *DescribeAsse type DescribeAssetPropertyInput struct { - // The ID of the asset. + // The ID of the asset. This can be either the actual ID in UUID format, or else + // externalId: followed by the external ID, if it has one. For more information, + // see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string - // The ID of the asset property. + // The ID of the asset property. This can be either the actual ID in UUID format, + // or else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. PropertyId *string @@ -51,12 +57,12 @@ type DescribeAssetPropertyInput struct { type DescribeAssetPropertyOutput struct { - // The ID of the asset. + // The ID of the asset, in UUID format. // // This member is required. AssetId *string - // The ID of the asset model. + // The ID of the asset model, in UUID format. // // This member is required. AssetModelId *string @@ -66,14 +72,18 @@ type DescribeAssetPropertyOutput struct { // This member is required. AssetName *string + // The external ID of the asset. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + AssetExternalId *string + // The asset property's definition, alias, and notification state. This response // includes this object for normal asset properties. If you describe an asset // property in a composite model, this response includes the asset property // information in compositeModel . AssetProperty *types.Property - // The composite asset model that declares this asset property, if this asset - // property exists in a composite model. + // The composite model that declares this asset property, if this asset property + // exists in a composite model. CompositeModel *types.CompositeModelProperty // Metadata pertaining to the operation's result. diff --git a/service/iotsitewise/api_op_DescribeBulkImportJob.go b/service/iotsitewise/api_op_DescribeBulkImportJob.go index d2c997a606f..0eb7247c59a 100644 --- a/service/iotsitewise/api_op_DescribeBulkImportJob.go +++ b/service/iotsitewise/api_op_DescribeBulkImportJob.go @@ -86,7 +86,7 @@ type DescribeBulkImportJobOutput struct { // This member is required. JobRoleArn *string - // The status of the bulk import job can be one of following values. + // The status of the bulk import job can be one of following values: // - PENDING – IoT SiteWise is waiting for the current bulk import job to finish. // - CANCELLED – The bulk import job has been canceled. // - RUNNING – IoT SiteWise is processing your request to import your data from @@ -103,6 +103,15 @@ type DescribeBulkImportJobOutput struct { // This member is required. JobStatus types.JobStatus + // If set to true, ingest new data into IoT SiteWise storage. Measurements with + // notifications, metrics and transforms are computed. If set to false, historical + // data is ingested into IoT SiteWise as is. + AdaptiveIngestion *bool + + // If set to true, your data files is deleted from S3, after ingestion into IoT + // SiteWise storage. + DeleteFilesAfterImport *bool + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/iotsitewise/api_op_DescribePortal.go b/service/iotsitewise/api_op_DescribePortal.go index b07cbb8626b..26377e98249 100644 --- a/service/iotsitewise/api_op_DescribePortal.go +++ b/service/iotsitewise/api_op_DescribePortal.go @@ -53,8 +53,8 @@ type DescribePortalOutput struct { PortalArn *string // The IAM Identity Center application generated client ID (used with IAM Identity - // Center APIs). IoT SiteWise includes portalClientId for only portals that use - // IAM Identity Center to authenticate users. + // Center API operations). IoT SiteWise includes portalClientId for only portals + // that use IAM Identity Center to authenticate users. // // This member is required. PortalClientId *string diff --git a/service/iotsitewise/api_op_DescribeStorageConfiguration.go b/service/iotsitewise/api_op_DescribeStorageConfiguration.go index 550d24eca0e..669c9925f35 100644 --- a/service/iotsitewise/api_op_DescribeStorageConfiguration.go +++ b/service/iotsitewise/api_op_DescribeStorageConfiguration.go @@ -68,10 +68,19 @@ type DescribeStorageConfigurationOutput struct { // Contains information about the storage destination. MultiLayerStorage *types.MultiLayerStorage - // How many days your data is kept in the hot tier. By default, your data is kept - // indefinitely in the hot tier. + // The number of days your data is kept in the hot tier. By default, your data is + // kept indefinitely in the hot tier. RetentionPeriod *types.RetentionPeriod + // A service managed storage tier optimized for analytical queries. It stores + // periodically uploaded, buffered and historical data ingested with the + // CreaeBulkImportJob API. + WarmTier types.WarmTierState + + // Set this period to specify how long your data is stored in the warm tier before + // it is deleted. You can set this only if cold tier is enabled. + WarmTierRetentionPeriod *types.WarmTierRetentionPeriod + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/iotsitewise/api_op_DescribeTimeSeries.go b/service/iotsitewise/api_op_DescribeTimeSeries.go index 1e691a95372..87fe798c766 100644 --- a/service/iotsitewise/api_op_DescribeTimeSeries.go +++ b/service/iotsitewise/api_op_DescribeTimeSeries.go @@ -41,10 +41,16 @@ type DescribeTimeSeriesInput struct { // The alias that identifies the time series. Alias *string - // The ID of the asset in which the asset property was created. + // The ID of the asset in which the asset property was created. This can be either + // the actual ID in UUID format, or else externalId: followed by the external ID, + // if it has one. For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. AssetId *string - // The ID of the asset property. + // The ID of the asset property. This can be either the actual ID in UUID format, + // or else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. PropertyId *string noSmithyDocumentSerde @@ -93,7 +99,7 @@ type DescribeTimeSeriesOutput struct { // alarm state in alarm composite models. DataTypeSpec *string - // The ID of the asset property. + // The ID of the asset property, in UUID format. PropertyId *string // Metadata pertaining to the operation's result. diff --git a/service/iotsitewise/api_op_DisassociateAssets.go b/service/iotsitewise/api_op_DisassociateAssets.go index 04e2db69587..b8a2e5c8b45 100644 --- a/service/iotsitewise/api_op_DisassociateAssets.go +++ b/service/iotsitewise/api_op_DisassociateAssets.go @@ -30,20 +30,30 @@ func (c *Client) DisassociateAssets(ctx context.Context, params *DisassociateAss type DisassociateAssetsInput struct { - // The ID of the parent asset from which to disassociate the child asset. + // The ID of the parent asset from which to disassociate the child asset. This can + // be either the actual ID in UUID format, or else externalId: followed by the + // external ID, if it has one. For more information, see Referencing objects with + // external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string - // The ID of the child asset to disassociate. + // The ID of the child asset to disassociate. This can be either the actual ID in + // UUID format, or else externalId: followed by the external ID, if it has one. + // For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. ChildAssetId *string - // The ID of a hierarchy in the parent asset's model. Hierarchies allow different - // groupings of assets to be formed that all come from the same asset model. You - // can use the hierarchy ID to identify the correct asset to disassociate. For more - // information, see Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html) + // The ID of a hierarchy in the parent asset's model. (This can be either the + // actual ID in UUID format, or else externalId: followed by the external ID, if + // it has one. For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide.) Hierarchies allow different groupings of assets + // to be formed that all come from the same asset model. You can use the hierarchy + // ID to identify the correct asset to disassociate. For more information, see + // Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html) // in the IoT SiteWise User Guide. // // This member is required. diff --git a/service/iotsitewise/api_op_DisassociateTimeSeriesFromAssetProperty.go b/service/iotsitewise/api_op_DisassociateTimeSeriesFromAssetProperty.go index 23743c83aaa..fb31cfd89a3 100644 --- a/service/iotsitewise/api_op_DisassociateTimeSeriesFromAssetProperty.go +++ b/service/iotsitewise/api_op_DisassociateTimeSeriesFromAssetProperty.go @@ -34,12 +34,18 @@ type DisassociateTimeSeriesFromAssetPropertyInput struct { // This member is required. Alias *string - // The ID of the asset in which the asset property was created. + // The ID of the asset in which the asset property was created. This can be either + // the actual ID in UUID format, or else externalId: followed by the external ID, + // if it has one. For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string - // The ID of the asset property. + // The ID of the asset property. This can be either the actual ID in UUID format, + // or else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. PropertyId *string diff --git a/service/iotsitewise/api_op_ExecuteAction.go b/service/iotsitewise/api_op_ExecuteAction.go new file mode 100644 index 00000000000..a66004ce853 --- /dev/null +++ b/service/iotsitewise/api_op_ExecuteAction.go @@ -0,0 +1,184 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Executes an action on a target resource. +func (c *Client) ExecuteAction(ctx context.Context, params *ExecuteActionInput, optFns ...func(*Options)) (*ExecuteActionOutput, error) { + if params == nil { + params = &ExecuteActionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ExecuteAction", params, optFns, c.addOperationExecuteActionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ExecuteActionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ExecuteActionInput struct { + + // The ID of the action definition. + // + // This member is required. + ActionDefinitionId *string + + // The JSON payload of the action. + // + // This member is required. + ActionPayload *types.ActionPayload + + // The resource the action will be taken on. + // + // This member is required. + TargetResource *types.TargetResource + + // A unique case-sensitive identifier that you can provide to ensure the + // idempotency of the request. Don't reuse this client token if a new idempotent + // request is required. + ClientToken *string + + noSmithyDocumentSerde +} + +type ExecuteActionOutput struct { + + // The ID of the action. + // + // This member is required. + ActionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationExecuteActionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpExecuteAction{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpExecuteAction{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ExecuteAction"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opExecuteActionMiddleware(stack); err != nil { + return err + } + if err = addOpExecuteActionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExecuteAction(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opExecuteActionMiddleware struct { +} + +func (*endpointPrefix_opExecuteActionMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opExecuteActionMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opExecuteActionMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opExecuteActionMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opExecuteAction(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ExecuteAction", + } +} diff --git a/service/iotsitewise/api_op_ExecuteQuery.go b/service/iotsitewise/api_op_ExecuteQuery.go new file mode 100644 index 00000000000..18c03a4985d --- /dev/null +++ b/service/iotsitewise/api_op_ExecuteQuery.go @@ -0,0 +1,269 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Run SQL queries to retrieve metadata and time-series data from asset models, +// assets, measurements, metrics, transforms, and aggregates. +func (c *Client) ExecuteQuery(ctx context.Context, params *ExecuteQueryInput, optFns ...func(*Options)) (*ExecuteQueryOutput, error) { + if params == nil { + params = &ExecuteQueryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ExecuteQuery", params, optFns, c.addOperationExecuteQueryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ExecuteQueryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ExecuteQueryInput struct { + + // The IoT SiteWise query statement. + // + // This member is required. + QueryStatement *string + + // The maximum number of results to return at one time. The default is 25. + MaxResults *int32 + + // The string that specifies the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ExecuteQueryOutput struct { + + // Represents a single column in the query results. + Columns []types.ColumnInfo + + // The string that specifies the next page of results. + NextToken *string + + // Represents a single row in the query results. + Rows []types.Row + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationExecuteQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpExecuteQuery{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpExecuteQuery{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ExecuteQuery"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opExecuteQueryMiddleware(stack); err != nil { + return err + } + if err = addOpExecuteQueryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExecuteQuery(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opExecuteQueryMiddleware struct { +} + +func (*endpointPrefix_opExecuteQueryMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opExecuteQueryMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "data." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opExecuteQueryMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opExecuteQueryMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ExecuteQueryAPIClient is a client that implements the ExecuteQuery operation. +type ExecuteQueryAPIClient interface { + ExecuteQuery(context.Context, *ExecuteQueryInput, ...func(*Options)) (*ExecuteQueryOutput, error) +} + +var _ ExecuteQueryAPIClient = (*Client)(nil) + +// ExecuteQueryPaginatorOptions is the paginator options for ExecuteQuery +type ExecuteQueryPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + 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 +} + +// ExecuteQueryPaginator is a paginator for ExecuteQuery +type ExecuteQueryPaginator struct { + options ExecuteQueryPaginatorOptions + client ExecuteQueryAPIClient + params *ExecuteQueryInput + nextToken *string + firstPage bool +} + +// NewExecuteQueryPaginator returns a new ExecuteQueryPaginator +func NewExecuteQueryPaginator(client ExecuteQueryAPIClient, params *ExecuteQueryInput, optFns ...func(*ExecuteQueryPaginatorOptions)) *ExecuteQueryPaginator { + if params == nil { + params = &ExecuteQueryInput{} + } + + options := ExecuteQueryPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ExecuteQueryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ExecuteQueryPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ExecuteQuery page. +func (p *ExecuteQueryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ExecuteQueryOutput, 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.ExecuteQuery(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_opExecuteQuery(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ExecuteQuery", + } +} diff --git a/service/iotsitewise/api_op_GetAssetPropertyAggregates.go b/service/iotsitewise/api_op_GetAssetPropertyAggregates.go index 7d48c7a3b4b..7d8f95898a4 100644 --- a/service/iotsitewise/api_op_GetAssetPropertyAggregates.go +++ b/service/iotsitewise/api_op_GetAssetPropertyAggregates.go @@ -61,14 +61,14 @@ type GetAssetPropertyAggregatesInput struct { // This member is required. StartDate *time.Time - // The ID of the asset. + // The ID of the asset, in UUID format. AssetId *string // The maximum number of results to return for each paginated request. A result // set is returned in the two cases, whichever occurs first. // - The size of the result set is equal to 1 MB. // - The number of data points in the result set is equal to the value of - // maxResults . The maximum value of maxResults is 250. + // maxResults . The maximum value of maxResults is 2500. MaxResults *int32 // The token to be used for the next set of paginated results. @@ -80,7 +80,7 @@ type GetAssetPropertyAggregatesInput struct { // in the IoT SiteWise User Guide. PropertyAlias *string - // The ID of the asset property. + // The ID of the asset property, in UUID format. PropertyId *string // The quality by which to filter asset data. @@ -233,7 +233,7 @@ type GetAssetPropertyAggregatesPaginatorOptions struct { // set is returned in the two cases, whichever occurs first. // - The size of the result set is equal to 1 MB. // - The number of data points in the result set is equal to the value of - // maxResults . The maximum value of maxResults is 250. + // maxResults . The maximum value of maxResults is 2500. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotsitewise/api_op_GetAssetPropertyValue.go b/service/iotsitewise/api_op_GetAssetPropertyValue.go index e68a8bee8bf..7d590365da9 100644 --- a/service/iotsitewise/api_op_GetAssetPropertyValue.go +++ b/service/iotsitewise/api_op_GetAssetPropertyValue.go @@ -38,7 +38,7 @@ func (c *Client) GetAssetPropertyValue(ctx context.Context, params *GetAssetProp type GetAssetPropertyValueInput struct { - // The ID of the asset. + // The ID of the asset, in UUID format. AssetId *string // The alias that identifies the property, such as an OPC-UA server data stream @@ -47,7 +47,7 @@ type GetAssetPropertyValueInput struct { // in the IoT SiteWise User Guide. PropertyAlias *string - // The ID of the asset property. + // The ID of the asset property, in UUID format. PropertyId *string noSmithyDocumentSerde diff --git a/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go b/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go index 64e50d1a147..56ae3cbe60b 100644 --- a/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go +++ b/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go @@ -39,7 +39,7 @@ func (c *Client) GetAssetPropertyValueHistory(ctx context.Context, params *GetAs type GetAssetPropertyValueHistoryInput struct { - // The ID of the asset. + // The ID of the asset, in UUID format. AssetId *string // The inclusive end of the range from which to query historical data, expressed @@ -62,7 +62,7 @@ type GetAssetPropertyValueHistoryInput struct { // in the IoT SiteWise User Guide. PropertyAlias *string - // The ID of the asset property. + // The ID of the asset property, in UUID format. PropertyId *string // The quality by which to filter asset data. diff --git a/service/iotsitewise/api_op_GetInterpolatedAssetPropertyValues.go b/service/iotsitewise/api_op_GetInterpolatedAssetPropertyValues.go index b773d569774..2d65e9b2779 100644 --- a/service/iotsitewise/api_op_GetInterpolatedAssetPropertyValues.go +++ b/service/iotsitewise/api_op_GetInterpolatedAssetPropertyValues.go @@ -85,7 +85,7 @@ type GetInterpolatedAssetPropertyValuesInput struct { // This member is required. Type *string - // The ID of the asset. + // The ID of the asset, in UUID format. AssetId *string // The nanosecond offset converted from endTimeInSeconds . @@ -123,7 +123,7 @@ type GetInterpolatedAssetPropertyValuesInput struct { // in the IoT SiteWise User Guide. PropertyAlias *string - // The ID of the asset property. + // The ID of the asset property, in UUID format. PropertyId *string // The nanosecond offset converted from startTimeInSeconds . diff --git a/service/iotsitewise/api_op_ListActions.go b/service/iotsitewise/api_op_ListActions.go new file mode 100644 index 00000000000..5736acdc3db --- /dev/null +++ b/service/iotsitewise/api_op_ListActions.go @@ -0,0 +1,186 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a paginated list of actions for a specific target resource. +func (c *Client) ListActions(ctx context.Context, params *ListActionsInput, optFns ...func(*Options)) (*ListActionsOutput, error) { + if params == nil { + params = &ListActionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListActions", params, optFns, c.addOperationListActionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListActionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListActionsInput struct { + + // The ID of the target resource. + // + // This member is required. + TargetResourceId *string + + // The type of resource. + // + // This member is required. + TargetResourceType types.TargetResourceType + + // The maximum number of results to return for each paginated request. + MaxResults *int32 + + // The token to be used for the next set of paginated results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListActionsOutput struct { + + // A list that summarizes the actions associated with the specified asset. + // + // This member is required. + ActionSummaries []types.ActionSummary + + // The token for the next set of results, or null if there are no additional + // results. + // + // This member is required. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListActionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListActions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListActions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListActions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListActionsMiddleware(stack); err != nil { + return err + } + if err = addOpListActionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListActions(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opListActionsMiddleware struct { +} + +func (*endpointPrefix_opListActionsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListActionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListActionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListActionsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opListActions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListActions", + } +} diff --git a/service/iotsitewise/api_op_ListAssetModelCompositeModels.go b/service/iotsitewise/api_op_ListAssetModelCompositeModels.go new file mode 100644 index 00000000000..a4125bf8a3a --- /dev/null +++ b/service/iotsitewise/api_op_ListAssetModelCompositeModels.go @@ -0,0 +1,275 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a paginated list of composite models associated with the asset model +func (c *Client) ListAssetModelCompositeModels(ctx context.Context, params *ListAssetModelCompositeModelsInput, optFns ...func(*Options)) (*ListAssetModelCompositeModelsOutput, error) { + if params == nil { + params = &ListAssetModelCompositeModelsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAssetModelCompositeModels", params, optFns, c.addOperationListAssetModelCompositeModelsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAssetModelCompositeModelsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAssetModelCompositeModelsInput struct { + + // The ID of the asset model. This can be either the actual ID in UUID format, or + // else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. + // + // This member is required. + AssetModelId *string + + // The maximum number of results to return for each paginated request. Default: 50 + MaxResults *int32 + + // The token to be used for the next set of paginated results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAssetModelCompositeModelsOutput struct { + + // A list that summarizes each composite model. + // + // This member is required. + AssetModelCompositeModelSummaries []types.AssetModelCompositeModelSummary + + // The token for the next set of results, or null if there are no additional + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAssetModelCompositeModelsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssetModelCompositeModels{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssetModelCompositeModels{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAssetModelCompositeModels"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListAssetModelCompositeModelsMiddleware(stack); err != nil { + return err + } + if err = addOpListAssetModelCompositeModelsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssetModelCompositeModels(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opListAssetModelCompositeModelsMiddleware struct { +} + +func (*endpointPrefix_opListAssetModelCompositeModelsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListAssetModelCompositeModelsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListAssetModelCompositeModelsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListAssetModelCompositeModelsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListAssetModelCompositeModelsAPIClient is a client that implements the +// ListAssetModelCompositeModels operation. +type ListAssetModelCompositeModelsAPIClient interface { + ListAssetModelCompositeModels(context.Context, *ListAssetModelCompositeModelsInput, ...func(*Options)) (*ListAssetModelCompositeModelsOutput, error) +} + +var _ ListAssetModelCompositeModelsAPIClient = (*Client)(nil) + +// ListAssetModelCompositeModelsPaginatorOptions is the paginator options for +// ListAssetModelCompositeModels +type ListAssetModelCompositeModelsPaginatorOptions struct { + // The maximum number of results to return for each paginated request. Default: 50 + 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 +} + +// ListAssetModelCompositeModelsPaginator is a paginator for +// ListAssetModelCompositeModels +type ListAssetModelCompositeModelsPaginator struct { + options ListAssetModelCompositeModelsPaginatorOptions + client ListAssetModelCompositeModelsAPIClient + params *ListAssetModelCompositeModelsInput + nextToken *string + firstPage bool +} + +// NewListAssetModelCompositeModelsPaginator returns a new +// ListAssetModelCompositeModelsPaginator +func NewListAssetModelCompositeModelsPaginator(client ListAssetModelCompositeModelsAPIClient, params *ListAssetModelCompositeModelsInput, optFns ...func(*ListAssetModelCompositeModelsPaginatorOptions)) *ListAssetModelCompositeModelsPaginator { + if params == nil { + params = &ListAssetModelCompositeModelsInput{} + } + + options := ListAssetModelCompositeModelsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAssetModelCompositeModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssetModelCompositeModelsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAssetModelCompositeModels page. +func (p *ListAssetModelCompositeModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetModelCompositeModelsOutput, 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.ListAssetModelCompositeModels(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_opListAssetModelCompositeModels(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAssetModelCompositeModels", + } +} diff --git a/service/iotsitewise/api_op_ListAssetModelProperties.go b/service/iotsitewise/api_op_ListAssetModelProperties.go index 1bdbc406072..27ea5b03496 100644 --- a/service/iotsitewise/api_op_ListAssetModelProperties.go +++ b/service/iotsitewise/api_op_ListAssetModelProperties.go @@ -32,7 +32,10 @@ func (c *Client) ListAssetModelProperties(ctx context.Context, params *ListAsset type ListAssetModelPropertiesInput struct { - // The ID of the asset model. + // The ID of the asset model. This can be either the actual ID in UUID format, or + // else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetModelId *string diff --git a/service/iotsitewise/api_op_ListAssetModels.go b/service/iotsitewise/api_op_ListAssetModels.go index 4eb051dc34f..58ad5b7e52e 100644 --- a/service/iotsitewise/api_op_ListAssetModels.go +++ b/service/iotsitewise/api_op_ListAssetModels.go @@ -30,6 +30,14 @@ func (c *Client) ListAssetModels(ctx context.Context, params *ListAssetModelsInp type ListAssetModelsInput struct { + // The type of asset model. + // - ASSET_MODEL – (default) An asset model that you can use to create assets. + // Can't be included as a component in another asset model. + // - COMPONENT_MODEL – A reusable component that you can include in the + // composite models of other asset models. You can't create assets directly from + // this type of asset model. + AssetModelTypes []types.AssetModelType + // The maximum number of results to return for each paginated request. Default: 50 MaxResults *int32 diff --git a/service/iotsitewise/api_op_ListAssetProperties.go b/service/iotsitewise/api_op_ListAssetProperties.go index 99bb541a13f..7c93be33a3e 100644 --- a/service/iotsitewise/api_op_ListAssetProperties.go +++ b/service/iotsitewise/api_op_ListAssetProperties.go @@ -32,7 +32,10 @@ func (c *Client) ListAssetProperties(ctx context.Context, params *ListAssetPrope type ListAssetPropertiesInput struct { - // The ID of the asset. + // The ID of the asset. This can be either the actual ID in UUID format, or else + // externalId: followed by the external ID, if it has one. For more information, + // see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string diff --git a/service/iotsitewise/api_op_ListAssetRelationships.go b/service/iotsitewise/api_op_ListAssetRelationships.go index 881437e327a..171f0e5c74a 100644 --- a/service/iotsitewise/api_op_ListAssetRelationships.go +++ b/service/iotsitewise/api_op_ListAssetRelationships.go @@ -32,7 +32,10 @@ func (c *Client) ListAssetRelationships(ctx context.Context, params *ListAssetRe type ListAssetRelationshipsInput struct { - // The ID of the asset. + // The ID of the asset. This can be either the actual ID in UUID format, or else + // externalId: followed by the external ID, if it has one. For more information, + // see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string diff --git a/service/iotsitewise/api_op_ListAssets.go b/service/iotsitewise/api_op_ListAssets.go index 6e07bb25c6d..29f9496b10f 100644 --- a/service/iotsitewise/api_op_ListAssets.go +++ b/service/iotsitewise/api_op_ListAssets.go @@ -39,7 +39,10 @@ func (c *Client) ListAssets(ctx context.Context, params *ListAssetsInput, optFns type ListAssetsInput struct { // The ID of the asset model by which to filter the list of assets. This parameter - // is required if you choose ALL for filter . + // is required if you choose ALL for filter . This can be either the actual ID in + // UUID format, or else externalId: followed by the external ID, if it has one. + // For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. AssetModelId *string // The filter for the requested list of assets. Choose one of the following diff --git a/service/iotsitewise/api_op_ListAssociatedAssets.go b/service/iotsitewise/api_op_ListAssociatedAssets.go index 728ed1579dc..d9b32cd36dc 100644 --- a/service/iotsitewise/api_op_ListAssociatedAssets.go +++ b/service/iotsitewise/api_op_ListAssociatedAssets.go @@ -34,13 +34,19 @@ func (c *Client) ListAssociatedAssets(ctx context.Context, params *ListAssociate type ListAssociatedAssetsInput struct { - // The ID of the asset to query. + // The ID of the asset to query. This can be either the actual ID in UUID format, + // or else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string - // The ID of the hierarchy by which child assets are associated to the asset. To - // find a hierarchy ID, use the DescribeAsset (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAsset.html) + // The ID of the hierarchy by which child assets are associated to the asset. + // (This can be either the actual ID in UUID format, or else externalId: followed + // by the external ID, if it has one. For more information, see Referencing + // objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide.) To find a hierarchy ID, use the DescribeAsset (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAsset.html) // or DescribeAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetModel.html) // operations. This parameter is required if you choose CHILD for // traversalDirection . For more information, see Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html) diff --git a/service/iotsitewise/api_op_ListCompositionRelationships.go b/service/iotsitewise/api_op_ListCompositionRelationships.go new file mode 100644 index 00000000000..bdf64b14fd7 --- /dev/null +++ b/service/iotsitewise/api_op_ListCompositionRelationships.go @@ -0,0 +1,276 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a paginated list of composition relationships for an asset model of +// type COMPONENT_MODEL . +func (c *Client) ListCompositionRelationships(ctx context.Context, params *ListCompositionRelationshipsInput, optFns ...func(*Options)) (*ListCompositionRelationshipsOutput, error) { + if params == nil { + params = &ListCompositionRelationshipsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCompositionRelationships", params, optFns, c.addOperationListCompositionRelationshipsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCompositionRelationshipsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCompositionRelationshipsInput struct { + + // The ID of the asset model. This can be either the actual ID in UUID format, or + // else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. + // + // This member is required. + AssetModelId *string + + // The maximum number of results to return for each paginated request. Default: 50 + MaxResults *int32 + + // The token to be used for the next set of paginated results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListCompositionRelationshipsOutput struct { + + // A list that summarizes each composition relationship. + // + // This member is required. + CompositionRelationshipSummaries []types.CompositionRelationshipSummary + + // The token for the next set of results, or null if there are no additional + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCompositionRelationshipsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCompositionRelationships{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCompositionRelationships{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCompositionRelationships"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListCompositionRelationshipsMiddleware(stack); err != nil { + return err + } + if err = addOpListCompositionRelationshipsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCompositionRelationships(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opListCompositionRelationshipsMiddleware struct { +} + +func (*endpointPrefix_opListCompositionRelationshipsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListCompositionRelationshipsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListCompositionRelationshipsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListCompositionRelationshipsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListCompositionRelationshipsAPIClient is a client that implements the +// ListCompositionRelationships operation. +type ListCompositionRelationshipsAPIClient interface { + ListCompositionRelationships(context.Context, *ListCompositionRelationshipsInput, ...func(*Options)) (*ListCompositionRelationshipsOutput, error) +} + +var _ ListCompositionRelationshipsAPIClient = (*Client)(nil) + +// ListCompositionRelationshipsPaginatorOptions is the paginator options for +// ListCompositionRelationships +type ListCompositionRelationshipsPaginatorOptions struct { + // The maximum number of results to return for each paginated request. Default: 50 + 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 +} + +// ListCompositionRelationshipsPaginator is a paginator for +// ListCompositionRelationships +type ListCompositionRelationshipsPaginator struct { + options ListCompositionRelationshipsPaginatorOptions + client ListCompositionRelationshipsAPIClient + params *ListCompositionRelationshipsInput + nextToken *string + firstPage bool +} + +// NewListCompositionRelationshipsPaginator returns a new +// ListCompositionRelationshipsPaginator +func NewListCompositionRelationshipsPaginator(client ListCompositionRelationshipsAPIClient, params *ListCompositionRelationshipsInput, optFns ...func(*ListCompositionRelationshipsPaginatorOptions)) *ListCompositionRelationshipsPaginator { + if params == nil { + params = &ListCompositionRelationshipsInput{} + } + + options := ListCompositionRelationshipsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCompositionRelationshipsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCompositionRelationshipsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCompositionRelationships page. +func (p *ListCompositionRelationshipsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCompositionRelationshipsOutput, 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.ListCompositionRelationships(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_opListCompositionRelationships(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCompositionRelationships", + } +} diff --git a/service/iotsitewise/api_op_ListTimeSeries.go b/service/iotsitewise/api_op_ListTimeSeries.go index f40ad510d46..47a3939d503 100644 --- a/service/iotsitewise/api_op_ListTimeSeries.go +++ b/service/iotsitewise/api_op_ListTimeSeries.go @@ -33,7 +33,10 @@ type ListTimeSeriesInput struct { // The alias prefix of the time series. AliasPrefix *string - // The ID of the asset in which the asset property was created. + // The ID of the asset in which the asset property was created. This can be either + // the actual ID in UUID format, or else externalId: followed by the external ID, + // if it has one. For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. AssetId *string // The maximum number of results to return for each paginated request. diff --git a/service/iotsitewise/api_op_PutStorageConfiguration.go b/service/iotsitewise/api_op_PutStorageConfiguration.go index 2931f3da383..49302762749 100644 --- a/service/iotsitewise/api_op_PutStorageConfiguration.go +++ b/service/iotsitewise/api_op_PutStorageConfiguration.go @@ -56,10 +56,19 @@ type PutStorageConfigurationInput struct { // storage type, you must specify a MultiLayerStorage object. MultiLayerStorage *types.MultiLayerStorage - // How many days your data is kept in the hot tier. By default, your data is kept - // indefinitely in the hot tier. + // The number of days your data is kept in the hot tier. By default, your data is + // kept indefinitely in the hot tier. RetentionPeriod *types.RetentionPeriod + // A service managed storage tier optimized for analytical queries. It stores + // periodically uploaded, buffered and historical data ingested with the + // CreaeBulkImportJob API. + WarmTier types.WarmTierState + + // Set this period to specify how long your data is stored in the warm tier before + // it is deleted. You can set this only if cold tier is enabled. + WarmTierRetentionPeriod *types.WarmTierRetentionPeriod + noSmithyDocumentSerde } @@ -95,10 +104,19 @@ type PutStorageConfigurationOutput struct { // Contains information about the storage destination. MultiLayerStorage *types.MultiLayerStorage - // How many days your data is kept in the hot tier. By default, your data is kept - // indefinitely in the hot tier. + // The number of days your data is kept in the hot tier. By default, your data is + // kept indefinitely in the hot tier. RetentionPeriod *types.RetentionPeriod + // A service managed storage tier optimized for analytical queries. It stores + // periodically uploaded, buffered and historical data ingested with the + // CreaeBulkImportJob API. + WarmTier types.WarmTierState + + // Set this period to specify how long your data is stored in the warm tier before + // it is deleted. You can set this only if cold tier is enabled. + WarmTierRetentionPeriod *types.WarmTierRetentionPeriod + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/iotsitewise/api_op_UpdateAsset.go b/service/iotsitewise/api_op_UpdateAsset.go index 7d089e631df..b9559a818a7 100644 --- a/service/iotsitewise/api_op_UpdateAsset.go +++ b/service/iotsitewise/api_op_UpdateAsset.go @@ -31,7 +31,10 @@ func (c *Client) UpdateAsset(ctx context.Context, params *UpdateAssetInput, optF type UpdateAssetInput struct { - // The ID of the asset to update. + // The ID of the asset to update. This can be either the actual ID in UUID format, + // or else externalId: followed by the external ID, if it has one. For more + // information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string @@ -44,6 +47,12 @@ type UpdateAssetInput struct { // A description for the asset. AssetDescription *string + // An external ID to assign to the asset. The asset must not already have an + // external ID. The external ID must be unique within your Amazon Web Services + // account. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + AssetExternalId *string + // A unique case-sensitive identifier that you can provide to ensure the // idempotency of the request. Don't reuse this client token if a new idempotent // request is required. diff --git a/service/iotsitewise/api_op_UpdateAssetModel.go b/service/iotsitewise/api_op_UpdateAssetModel.go index accb88d47ef..8351486e989 100644 --- a/service/iotsitewise/api_op_UpdateAssetModel.go +++ b/service/iotsitewise/api_op_UpdateAssetModel.go @@ -40,7 +40,10 @@ func (c *Client) UpdateAssetModel(ctx context.Context, params *UpdateAssetModelI type UpdateAssetModelInput struct { - // The ID of the asset model to update. + // The ID of the asset model to update. This can be either the actual ID in UUID + // format, or else externalId: followed by the external ID, if it has one. For + // more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetModelId *string @@ -50,15 +53,24 @@ type UpdateAssetModelInput struct { // This member is required. AssetModelName *string - // The composite asset models that are part of this asset model. Composite asset - // models are asset models that contain specific properties. Each composite model - // has a type that defines the properties that the composite model supports. Use - // composite asset models to define alarms on this asset model. + // The composite models that are part of this asset model. It groups properties + // (such as attributes, measurements, transforms, and metrics) and child composite + // models that model parts of your industrial equipment. Each composite model has a + // type that defines the properties that the composite model supports. Use + // composite models to define alarms on this asset model. When creating custom + // composite models, you need to use CreateAssetModelCompositeModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModelCompositeModel.html) + // . For more information, see . AssetModelCompositeModels []types.AssetModelCompositeModel // A description for the asset model. AssetModelDescription *string + // An external ID to assign to the asset model. The asset model must not already + // have an external ID. The external ID must be unique within your Amazon Web + // Services account. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + AssetModelExternalId *string + // The updated hierarchy definitions of the asset model. Each hierarchy specifies // an asset model whose assets can be children of any other assets created from // this asset model. For more information, see Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html) diff --git a/service/iotsitewise/api_op_UpdateAssetModelCompositeModel.go b/service/iotsitewise/api_op_UpdateAssetModelCompositeModel.go new file mode 100644 index 00000000000..a5aea2d4a2b --- /dev/null +++ b/service/iotsitewise/api_op_UpdateAssetModelCompositeModel.go @@ -0,0 +1,254 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +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/iotsitewise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a composite model and all of the assets that were created from the +// model. Each asset created from the model inherits the updated asset model's +// property and hierarchy definitions. For more information, see Updating assets +// and models (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/update-assets-and-models.html) +// in the IoT SiteWise User Guide. If you remove a property from a composite asset +// model, IoT SiteWise deletes all previous data for that property. You can’t +// change the type or data type of an existing property. To replace an existing +// composite asset model property with a new one with the same name , do the +// following: +// - Submit an UpdateAssetModelCompositeModel request with the entire existing +// property removed. +// - Submit a second UpdateAssetModelCompositeModel request that includes the new +// property. The new asset property will have the same name as the previous one +// and IoT SiteWise will generate a new unique id . +func (c *Client) UpdateAssetModelCompositeModel(ctx context.Context, params *UpdateAssetModelCompositeModelInput, optFns ...func(*Options)) (*UpdateAssetModelCompositeModelOutput, error) { + if params == nil { + params = &UpdateAssetModelCompositeModelInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAssetModelCompositeModel", params, optFns, c.addOperationUpdateAssetModelCompositeModelMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAssetModelCompositeModelOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAssetModelCompositeModelInput struct { + + // The ID of a composite model on this asset model. + // + // This member is required. + AssetModelCompositeModelId *string + + // A unique, friendly name for the composite model. + // + // This member is required. + AssetModelCompositeModelName *string + + // The ID of the asset model, in UUID format. + // + // This member is required. + AssetModelId *string + + // A description for the composite model. + AssetModelCompositeModelDescription *string + + // An external ID to assign to the asset model. You can only set the external ID + // of the asset model if it wasn't set when it was created, or you're setting it to + // the exact same thing as when it was created. + AssetModelCompositeModelExternalId *string + + // The property definitions of the composite model. For more information, see . + // You can specify up to 200 properties per composite model. For more information, + // see Quotas (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html) + // in the IoT SiteWise User Guide. + AssetModelCompositeModelProperties []types.AssetModelProperty + + // A unique case-sensitive identifier that you can provide to ensure the + // idempotency of the request. Don't reuse this client token if a new idempotent + // request is required. + ClientToken *string + + noSmithyDocumentSerde +} + +type UpdateAssetModelCompositeModelOutput struct { + + // The path to the composite model listing the parent composite models. + // + // This member is required. + AssetModelCompositeModelPath []types.AssetModelCompositeModelPathSegment + + // Contains current status information for an asset model. For more information, + // see Asset and model states (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html) + // in the IoT SiteWise User Guide. + // + // This member is required. + AssetModelStatus *types.AssetModelStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAssetModelCompositeModelMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAssetModelCompositeModel{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAssetModelCompositeModel{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAssetModelCompositeModel"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opUpdateAssetModelCompositeModelMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opUpdateAssetModelCompositeModelMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateAssetModelCompositeModelValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAssetModelCompositeModel(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opUpdateAssetModelCompositeModelMiddleware struct { +} + +func (*endpointPrefix_opUpdateAssetModelCompositeModelMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opUpdateAssetModelCompositeModelMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opUpdateAssetModelCompositeModelMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opUpdateAssetModelCompositeModelMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +type idempotencyToken_initializeOpUpdateAssetModelCompositeModel struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdateAssetModelCompositeModel) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdateAssetModelCompositeModel) 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.(*UpdateAssetModelCompositeModelInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAssetModelCompositeModelInput ") + } + + 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_opUpdateAssetModelCompositeModelMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAssetModelCompositeModel{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdateAssetModelCompositeModel(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateAssetModelCompositeModel", + } +} diff --git a/service/iotsitewise/api_op_UpdateAssetProperty.go b/service/iotsitewise/api_op_UpdateAssetProperty.go index eaff569d9e4..e48c9884a52 100644 --- a/service/iotsitewise/api_op_UpdateAssetProperty.go +++ b/service/iotsitewise/api_op_UpdateAssetProperty.go @@ -35,12 +35,18 @@ func (c *Client) UpdateAssetProperty(ctx context.Context, params *UpdateAssetPro type UpdateAssetPropertyInput struct { - // The ID of the asset to be updated. + // The ID of the asset to be updated. This can be either the actual ID in UUID + // format, or else externalId: followed by the external ID, if it has one. For + // more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. AssetId *string - // The ID of the asset property to be updated. + // The ID of the asset property to be updated. This can be either the actual ID in + // UUID format, or else externalId: followed by the external ID, if it has one. + // For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. PropertyId *string diff --git a/service/iotsitewise/deserializers.go b/service/iotsitewise/deserializers.go index fb0aeea0f9b..b13610cbcef 100644 --- a/service/iotsitewise/deserializers.go +++ b/service/iotsitewise/deserializers.go @@ -1772,6 +1772,185 @@ func awsRestjson1_deserializeOpDocumentCreateAssetModelOutput(v **CreateAssetMod return nil } +type awsRestjson1_deserializeOpCreateAssetModelCompositeModel struct { +} + +func (*awsRestjson1_deserializeOpCreateAssetModelCompositeModel) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateAssetModelCompositeModel) 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_deserializeOpErrorCreateAssetModelCompositeModel(response, &metadata) + } + output := &CreateAssetModelCompositeModelOutput{} + 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_deserializeOpDocumentCreateAssetModelCompositeModelOutput(&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_deserializeOpErrorCreateAssetModelCompositeModel(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateAssetModelCompositeModelOutput(v **CreateAssetModelCompositeModelOutput, 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 *CreateAssetModelCompositeModelOutput + if *v == nil { + sv = &CreateAssetModelCompositeModelOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assetModelCompositeModelId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.AssetModelCompositeModelId = ptr.String(jtv) + } + + case "assetModelCompositeModelPath": + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModelPath(&sv.AssetModelCompositeModelPath, value); err != nil { + return err + } + + case "assetModelStatus": + if err := awsRestjson1_deserializeDocumentAssetModelStatus(&sv.AssetModelStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateBulkImportJob struct { } @@ -3080,14 +3259,14 @@ func awsRestjson1_deserializeOpDocumentDeleteAssetModelOutput(v **DeleteAssetMod return nil } -type awsRestjson1_deserializeOpDeleteDashboard struct { +type awsRestjson1_deserializeOpDeleteAssetModelCompositeModel struct { } -func (*awsRestjson1_deserializeOpDeleteDashboard) ID() string { +func (*awsRestjson1_deserializeOpDeleteAssetModelCompositeModel) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAssetModelCompositeModel) 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) @@ -3101,15 +3280,43 @@ func (m *awsRestjson1_deserializeOpDeleteDashboard) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteDashboard(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAssetModelCompositeModel(response, &metadata) } - output := &DeleteDashboardOutput{} + output := &DeleteAssetModelCompositeModelOutput{} 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_deserializeOpDocumentDeleteAssetModelCompositeModelOutput(&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_deserializeOpErrorDeleteDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAssetModelCompositeModel(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)} @@ -3150,6 +3357,9 @@ func awsRestjson1_deserializeOpErrorDeleteDashboard(response *smithyhttp.Respons } switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -3172,14 +3382,50 @@ func awsRestjson1_deserializeOpErrorDeleteDashboard(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteGateway struct { +func awsRestjson1_deserializeOpDocumentDeleteAssetModelCompositeModelOutput(v **DeleteAssetModelCompositeModelOutput, 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 *DeleteAssetModelCompositeModelOutput + if *v == nil { + sv = &DeleteAssetModelCompositeModelOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assetModelStatus": + if err := awsRestjson1_deserializeDocumentAssetModelStatus(&sv.AssetModelStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteGateway) ID() string { +type awsRestjson1_deserializeOpDeleteDashboard struct { +} + +func (*awsRestjson1_deserializeOpDeleteDashboard) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteGateway) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteDashboard) 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) @@ -3193,21 +3439,15 @@ func (m *awsRestjson1_deserializeOpDeleteGateway) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteGateway(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDashboard(response, &metadata) } - output := &DeleteGatewayOutput{} + output := &DeleteDashboardOutput{} 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_deserializeOpErrorDeleteGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteDashboard(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)} @@ -3270,7 +3510,105 @@ func awsRestjson1_deserializeOpErrorDeleteGateway(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeletePortal struct { +type awsRestjson1_deserializeOpDeleteGateway struct { +} + +func (*awsRestjson1_deserializeOpDeleteGateway) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteGateway) 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_deserializeOpErrorDeleteGateway(response, &metadata) + } + output := &DeleteGatewayOutput{} + 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_deserializeOpErrorDeleteGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeletePortal struct { } func (*awsRestjson1_deserializeOpDeletePortal) ID() string { @@ -3842,14 +4180,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAccessPolicyOutput(v **DescribeAc return nil } -type awsRestjson1_deserializeOpDescribeAsset struct { +type awsRestjson1_deserializeOpDescribeAction struct { } -func (*awsRestjson1_deserializeOpDescribeAsset) ID() string { +func (*awsRestjson1_deserializeOpDescribeAction) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAsset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAction) 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) @@ -3863,9 +4201,9 @@ func (m *awsRestjson1_deserializeOpDescribeAsset) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAsset(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAction(response, &metadata) } - output := &DescribeAssetOutput{} + output := &DescribeActionOutput{} out.Result = output var buff [1024]byte @@ -3886,7 +4224,7 @@ func (m *awsRestjson1_deserializeOpDescribeAsset) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAssetOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeActionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3899,7 +4237,7 @@ func (m *awsRestjson1_deserializeOpDescribeAsset) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAsset(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAction(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)} @@ -3962,7 +4300,7 @@ func awsRestjson1_deserializeOpErrorDescribeAsset(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDescribeAssetOutput(v **DescribeAssetOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeActionOutput(v **DescribeActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3975,69 +4313,39 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetOutput(v **DescribeAssetOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAssetOutput + var sv *DescribeActionOutput if *v == nil { - sv = &DescribeAssetOutput{} + sv = &DescribeActionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetArn": + case "actionDefinitionId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) - } - sv.AssetArn = ptr.String(jtv) - } - - case "assetCompositeModels": - if err := awsRestjson1_deserializeDocumentAssetCompositeModels(&sv.AssetCompositeModels, value); err != nil { - return err - } - - case "assetCreationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.AssetCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } + sv.ActionDefinitionId = ptr.String(jtv) } - case "assetDescription": + case "actionId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.AssetDescription = ptr.String(jtv) + sv.ActionId = ptr.String(jtv) } - case "assetHierarchies": - if err := awsRestjson1_deserializeDocumentAssetHierarchies(&sv.AssetHierarchies, value); err != nil { + case "actionPayload": + if err := awsRestjson1_deserializeDocumentActionPayload(&sv.ActionPayload, value); err != nil { return err } - case "assetId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) - } - sv.AssetId = ptr.String(jtv) - } - - case "assetLastUpdateDate": + case "executionTime": if value != nil { switch jtv := value.(type) { case json.Number: @@ -4045,7 +4353,7 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetOutput(v **DescribeAssetOutp if err != nil { return err } - sv.AssetLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.ExecutionTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -4053,31 +4361,8 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetOutput(v **DescribeAssetOutp } } - case "assetModelId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) - } - sv.AssetModelId = ptr.String(jtv) - } - - case "assetName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.AssetName = ptr.String(jtv) - } - - case "assetProperties": - if err := awsRestjson1_deserializeDocumentAssetProperties(&sv.AssetProperties, value); err != nil { - return err - } - - case "assetStatus": - if err := awsRestjson1_deserializeDocumentAssetStatus(&sv.AssetStatus, value); err != nil { + case "targetResource": + if err := awsRestjson1_deserializeDocumentTargetResource(&sv.TargetResource, value); err != nil { return err } @@ -4090,14 +4375,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetOutput(v **DescribeAssetOutp return nil } -type awsRestjson1_deserializeOpDescribeAssetModel struct { +type awsRestjson1_deserializeOpDescribeAsset struct { } -func (*awsRestjson1_deserializeOpDescribeAssetModel) ID() string { +func (*awsRestjson1_deserializeOpDescribeAsset) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAssetModel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAsset) 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) @@ -4111,9 +4396,9 @@ func (m *awsRestjson1_deserializeOpDescribeAssetModel) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAssetModel(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAsset(response, &metadata) } - output := &DescribeAssetModelOutput{} + output := &DescribeAssetOutput{} out.Result = output var buff [1024]byte @@ -4134,7 +4419,7 @@ func (m *awsRestjson1_deserializeOpDescribeAssetModel) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAssetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4147,7 +4432,7 @@ func (m *awsRestjson1_deserializeOpDescribeAssetModel) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAssetModel(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAsset(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)} @@ -4210,7 +4495,7 @@ func awsRestjson1_deserializeOpErrorDescribeAssetModel(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(v **DescribeAssetModelOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAssetOutput(v **DescribeAssetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4223,30 +4508,35 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(v **DescribeAsse return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAssetModelOutput + var sv *DescribeAssetOutput if *v == nil { - sv = &DescribeAssetModelOutput{} + sv = &DescribeAssetOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetModelArn": + case "assetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.AssetModelArn = ptr.String(jtv) + sv.AssetArn = ptr.String(jtv) } - case "assetModelCompositeModels": - if err := awsRestjson1_deserializeDocumentAssetModelCompositeModels(&sv.AssetModelCompositeModels, value); err != nil { + case "assetCompositeModels": + if err := awsRestjson1_deserializeDocumentAssetCompositeModels(&sv.AssetCompositeModels, value); err != nil { return err } - case "assetModelCreationDate": + case "assetCompositeModelSummaries": + if err := awsRestjson1_deserializeDocumentAssetCompositeModelSummaries(&sv.AssetCompositeModelSummaries, value); err != nil { + return err + } + + case "assetCreationDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -4254,7 +4544,7 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(v **DescribeAsse if err != nil { return err } - sv.AssetModelCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.AssetCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -4262,30 +4552,39 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(v **DescribeAsse } } - case "assetModelDescription": + case "assetDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.AssetModelDescription = ptr.String(jtv) + sv.AssetDescription = ptr.String(jtv) } - case "assetModelHierarchies": - if err := awsRestjson1_deserializeDocumentAssetModelHierarchies(&sv.AssetModelHierarchies, value); err != nil { + case "assetExternalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.AssetExternalId = ptr.String(jtv) + } + + case "assetHierarchies": + if err := awsRestjson1_deserializeDocumentAssetHierarchies(&sv.AssetHierarchies, value); err != nil { return err } - case "assetModelId": + case "assetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.AssetModelId = ptr.String(jtv) + sv.AssetId = ptr.String(jtv) } - case "assetModelLastUpdateDate": + case "assetLastUpdateDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -4293,7 +4592,7 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(v **DescribeAsse if err != nil { return err } - sv.AssetModelLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.AssetLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -4301,22 +4600,31 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(v **DescribeAsse } } - case "assetModelName": + case "assetModelId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.AssetModelId = ptr.String(jtv) + } + + case "assetName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.AssetModelName = ptr.String(jtv) + sv.AssetName = ptr.String(jtv) } - case "assetModelProperties": - if err := awsRestjson1_deserializeDocumentAssetModelProperties(&sv.AssetModelProperties, value); err != nil { + case "assetProperties": + if err := awsRestjson1_deserializeDocumentAssetProperties(&sv.AssetProperties, value); err != nil { return err } - case "assetModelStatus": - if err := awsRestjson1_deserializeDocumentAssetModelStatus(&sv.AssetModelStatus, value); err != nil { + case "assetStatus": + if err := awsRestjson1_deserializeDocumentAssetStatus(&sv.AssetStatus, value); err != nil { return err } @@ -4329,14 +4637,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(v **DescribeAsse return nil } -type awsRestjson1_deserializeOpDescribeAssetProperty struct { +type awsRestjson1_deserializeOpDescribeAssetCompositeModel struct { } -func (*awsRestjson1_deserializeOpDescribeAssetProperty) ID() string { +func (*awsRestjson1_deserializeOpDescribeAssetCompositeModel) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAssetProperty) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAssetCompositeModel) 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) @@ -4350,9 +4658,9 @@ func (m *awsRestjson1_deserializeOpDescribeAssetProperty) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAssetProperty(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAssetCompositeModel(response, &metadata) } - output := &DescribeAssetPropertyOutput{} + output := &DescribeAssetCompositeModelOutput{} out.Result = output var buff [1024]byte @@ -4373,7 +4681,7 @@ func (m *awsRestjson1_deserializeOpDescribeAssetProperty) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAssetPropertyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAssetCompositeModelOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4386,7 +4694,7 @@ func (m *awsRestjson1_deserializeOpDescribeAssetProperty) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAssetProperty(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAssetCompositeModel(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)} @@ -4449,7 +4757,7 @@ func awsRestjson1_deserializeOpErrorDescribeAssetProperty(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentDescribeAssetPropertyOutput(v **DescribeAssetPropertyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAssetCompositeModelOutput(v **DescribeAssetCompositeModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4462,52 +4770,89 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetPropertyOutput(v **DescribeA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAssetPropertyOutput + var sv *DescribeAssetCompositeModelOutput if *v == nil { - sv = &DescribeAssetPropertyOutput{} + sv = &DescribeAssetCompositeModelOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetId": + case "actionDefinitions": + if err := awsRestjson1_deserializeDocumentActionDefinitions(&sv.ActionDefinitions, value); err != nil { + return err + } + + case "assetCompositeModelDescription": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.AssetId = ptr.String(jtv) + sv.AssetCompositeModelDescription = ptr.String(jtv) } - case "assetModelId": + case "assetCompositeModelExternalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.AssetCompositeModelExternalId = ptr.String(jtv) + } + + case "assetCompositeModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.AssetModelId = ptr.String(jtv) + sv.AssetCompositeModelId = ptr.String(jtv) } - case "assetName": + case "assetCompositeModelName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.AssetName = ptr.String(jtv) + sv.AssetCompositeModelName = ptr.String(jtv) } - case "assetProperty": - if err := awsRestjson1_deserializeDocumentProperty(&sv.AssetProperty, value); err != nil { + case "assetCompositeModelPath": + if err := awsRestjson1_deserializeDocumentAssetCompositeModelPath(&sv.AssetCompositeModelPath, value); err != nil { return err } - case "compositeModel": - if err := awsRestjson1_deserializeDocumentCompositeModelProperty(&sv.CompositeModel, value); err != nil { + case "assetCompositeModelProperties": + if err := awsRestjson1_deserializeDocumentAssetProperties(&sv.AssetCompositeModelProperties, value); err != nil { + return err + } + + case "assetCompositeModelSummaries": + if err := awsRestjson1_deserializeDocumentAssetCompositeModelSummaries(&sv.AssetCompositeModelSummaries, value); err != nil { return err } + case "assetCompositeModelType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.AssetCompositeModelType = ptr.String(jtv) + } + + case "assetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.AssetId = ptr.String(jtv) + } + default: _, _ = key, value @@ -4517,14 +4862,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAssetPropertyOutput(v **DescribeA return nil } -type awsRestjson1_deserializeOpDescribeBulkImportJob struct { +type awsRestjson1_deserializeOpDescribeAssetModel struct { } -func (*awsRestjson1_deserializeOpDescribeBulkImportJob) ID() string { +func (*awsRestjson1_deserializeOpDescribeAssetModel) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeBulkImportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAssetModel) 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) @@ -4538,9 +4883,9 @@ func (m *awsRestjson1_deserializeOpDescribeBulkImportJob) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeBulkImportJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAssetModel(response, &metadata) } - output := &DescribeBulkImportJobOutput{} + output := &DescribeAssetModelOutput{} out.Result = output var buff [1024]byte @@ -4561,7 +4906,7 @@ func (m *awsRestjson1_deserializeOpDescribeBulkImportJob) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4574,7 +4919,7 @@ func (m *awsRestjson1_deserializeOpDescribeBulkImportJob) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeBulkImportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAssetModel(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)} @@ -4637,7 +4982,7 @@ func awsRestjson1_deserializeOpErrorDescribeBulkImportJob(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(v **DescribeBulkImportJobOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAssetModelOutput(v **DescribeAssetModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4650,31 +4995,35 @@ func awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(v **DescribeB return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeBulkImportJobOutput + var sv *DescribeAssetModelOutput if *v == nil { - sv = &DescribeBulkImportJobOutput{} + sv = &DescribeAssetModelOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "errorReportLocation": - if err := awsRestjson1_deserializeDocumentErrorReportLocation(&sv.ErrorReportLocation, value); err != nil { - return err + case "assetModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.AssetModelArn = ptr.String(jtv) } - case "files": - if err := awsRestjson1_deserializeDocumentFiles(&sv.Files, value); err != nil { + case "assetModelCompositeModels": + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModels(&sv.AssetModelCompositeModels, value); err != nil { return err } - case "jobConfiguration": - if err := awsRestjson1_deserializeDocumentJobConfiguration(&sv.JobConfiguration, value); err != nil { + case "assetModelCompositeModelSummaries": + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModelSummaries(&sv.AssetModelCompositeModelSummaries, value); err != nil { return err } - case "jobCreationDate": + case "assetModelCreationDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -4682,7 +5031,7 @@ func awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(v **DescribeB if err != nil { return err } - sv.JobCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.AssetModelCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -4690,16 +5039,39 @@ func awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(v **DescribeB } } - case "jobId": + case "assetModelDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.AssetModelDescription = ptr.String(jtv) + } + + case "assetModelExternalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.AssetModelExternalId = ptr.String(jtv) + } + + case "assetModelHierarchies": + if err := awsRestjson1_deserializeDocumentAssetModelHierarchies(&sv.AssetModelHierarchies, value); err != nil { + return err + } + + case "assetModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.JobId = ptr.String(jtv) + sv.AssetModelId = ptr.String(jtv) } - case "jobLastUpdateDate": + case "assetModelLastUpdateDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -4707,7 +5079,7 @@ func awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(v **DescribeB if err != nil { return err } - sv.JobLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.AssetModelLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -4715,31 +5087,32 @@ func awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(v **DescribeB } } - case "jobName": + case "assetModelName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.JobName = ptr.String(jtv) + sv.AssetModelName = ptr.String(jtv) } - case "jobRoleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) - } - sv.JobRoleArn = ptr.String(jtv) + case "assetModelProperties": + if err := awsRestjson1_deserializeDocumentAssetModelProperties(&sv.AssetModelProperties, value); err != nil { + return err } - case "jobStatus": + case "assetModelStatus": + if err := awsRestjson1_deserializeDocumentAssetModelStatus(&sv.AssetModelStatus, value); err != nil { + return err + } + + case "assetModelType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected AssetModelType to be of type string, got %T instead", value) } - sv.JobStatus = types.JobStatus(jtv) + sv.AssetModelType = types.AssetModelType(jtv) } default: @@ -4751,14 +5124,14 @@ func awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(v **DescribeB return nil } -type awsRestjson1_deserializeOpDescribeDashboard struct { +type awsRestjson1_deserializeOpDescribeAssetModelCompositeModel struct { } -func (*awsRestjson1_deserializeOpDescribeDashboard) ID() string { +func (*awsRestjson1_deserializeOpDescribeAssetModelCompositeModel) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAssetModelCompositeModel) 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) @@ -4772,9 +5145,9 @@ func (m *awsRestjson1_deserializeOpDescribeDashboard) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeDashboard(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAssetModelCompositeModel(response, &metadata) } - output := &DescribeDashboardOutput{} + output := &DescribeAssetModelCompositeModelOutput{} out.Result = output var buff [1024]byte @@ -4795,7 +5168,7 @@ func (m *awsRestjson1_deserializeOpDescribeDashboard) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeDashboardOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAssetModelCompositeModelOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4808,7 +5181,7 @@ func (m *awsRestjson1_deserializeOpDescribeDashboard) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAssetModelCompositeModel(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)} @@ -4871,7 +5244,7 @@ func awsRestjson1_deserializeOpErrorDescribeDashboard(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentDescribeDashboardOutput(v **DescribeDashboardOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAssetModelCompositeModelOutput(v **DescribeAssetModelCompositeModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4884,99 +5257,92 @@ func awsRestjson1_deserializeOpDocumentDescribeDashboardOutput(v **DescribeDashb return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeDashboardOutput + var sv *DescribeAssetModelCompositeModelOutput if *v == nil { - sv = &DescribeDashboardOutput{} + sv = &DescribeAssetModelCompositeModelOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "dashboardArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) - } - sv.DashboardArn = ptr.String(jtv) + case "actionDefinitions": + if err := awsRestjson1_deserializeDocumentActionDefinitions(&sv.ActionDefinitions, value); err != nil { + return err } - case "dashboardCreationDate": + case "assetModelCompositeModelDescription": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DashboardCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } + sv.AssetModelCompositeModelDescription = ptr.String(jtv) } - case "dashboardDefinition": + case "assetModelCompositeModelExternalId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DashboardDefinition to be of type string, got %T instead", value) + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } - sv.DashboardDefinition = ptr.String(jtv) + sv.AssetModelCompositeModelExternalId = ptr.String(jtv) } - case "dashboardDescription": + case "assetModelCompositeModelId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.DashboardDescription = ptr.String(jtv) + sv.AssetModelCompositeModelId = ptr.String(jtv) } - case "dashboardId": + case "assetModelCompositeModelName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.DashboardId = ptr.String(jtv) + sv.AssetModelCompositeModelName = ptr.String(jtv) } - case "dashboardLastUpdateDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DashboardLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + case "assetModelCompositeModelPath": + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModelPath(&sv.AssetModelCompositeModelPath, value); err != nil { + return err + } - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + case "assetModelCompositeModelProperties": + if err := awsRestjson1_deserializeDocumentAssetModelProperties(&sv.AssetModelCompositeModelProperties, value); err != nil { + return err + } - } + case "assetModelCompositeModelSummaries": + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModelSummaries(&sv.AssetModelCompositeModelSummaries, value); err != nil { + return err } - case "dashboardName": + case "assetModelCompositeModelType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.DashboardName = ptr.String(jtv) + sv.AssetModelCompositeModelType = ptr.String(jtv) } - case "projectId": + case "assetModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.ProjectId = ptr.String(jtv) + sv.AssetModelId = ptr.String(jtv) + } + + case "compositionDetails": + if err := awsRestjson1_deserializeDocumentCompositionDetails(&sv.CompositionDetails, value); err != nil { + return err } default: @@ -4988,14 +5354,14 @@ func awsRestjson1_deserializeOpDocumentDescribeDashboardOutput(v **DescribeDashb return nil } -type awsRestjson1_deserializeOpDescribeDefaultEncryptionConfiguration struct { +type awsRestjson1_deserializeOpDescribeAssetProperty struct { } -func (*awsRestjson1_deserializeOpDescribeDefaultEncryptionConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDescribeAssetProperty) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeDefaultEncryptionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAssetProperty) 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) @@ -5009,9 +5375,9 @@ func (m *awsRestjson1_deserializeOpDescribeDefaultEncryptionConfiguration) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeDefaultEncryptionConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAssetProperty(response, &metadata) } - output := &DescribeDefaultEncryptionConfigurationOutput{} + output := &DescribeAssetPropertyOutput{} out.Result = output var buff [1024]byte @@ -5032,7 +5398,7 @@ func (m *awsRestjson1_deserializeOpDescribeDefaultEncryptionConfiguration) Handl return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeDefaultEncryptionConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAssetPropertyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5045,7 +5411,7 @@ func (m *awsRestjson1_deserializeOpDescribeDefaultEncryptionConfiguration) Handl return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeDefaultEncryptionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAssetProperty(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)} @@ -5092,6 +5458,9 @@ func awsRestjson1_deserializeOpErrorDescribeDefaultEncryptionConfiguration(respo case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5105,7 +5474,7 @@ func awsRestjson1_deserializeOpErrorDescribeDefaultEncryptionConfiguration(respo } } -func awsRestjson1_deserializeOpDocumentDescribeDefaultEncryptionConfigurationOutput(v **DescribeDefaultEncryptionConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAssetPropertyOutput(v **DescribeAssetPropertyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5118,55 +5487,78 @@ func awsRestjson1_deserializeOpDocumentDescribeDefaultEncryptionConfigurationOut return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeDefaultEncryptionConfigurationOutput + var sv *DescribeAssetPropertyOutput if *v == nil { - sv = &DescribeDefaultEncryptionConfigurationOutput{} + sv = &DescribeAssetPropertyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "configurationStatus": - if err := awsRestjson1_deserializeDocumentConfigurationStatus(&sv.ConfigurationStatus, value); err != nil { - return err + case "assetExternalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.AssetExternalId = ptr.String(jtv) } - case "encryptionType": + case "assetId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.EncryptionType = types.EncryptionType(jtv) + sv.AssetId = ptr.String(jtv) } - case "kmsKeyArn": + case "assetModelId": 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 ID to be of type string, got %T instead", value) } - sv.KmsKeyArn = ptr.String(jtv) + sv.AssetModelId = ptr.String(jtv) } - default: - _, _ = key, value - + case "assetName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.AssetName = ptr.String(jtv) + } + + case "assetProperty": + if err := awsRestjson1_deserializeDocumentProperty(&sv.AssetProperty, value); err != nil { + return err + } + + case "compositeModel": + if err := awsRestjson1_deserializeDocumentCompositeModelProperty(&sv.CompositeModel, value); err != nil { + return err + } + + default: + _, _ = key, value + } } *v = sv return nil } -type awsRestjson1_deserializeOpDescribeGateway struct { +type awsRestjson1_deserializeOpDescribeBulkImportJob struct { } -func (*awsRestjson1_deserializeOpDescribeGateway) ID() string { +func (*awsRestjson1_deserializeOpDescribeBulkImportJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeGateway) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeBulkImportJob) 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) @@ -5180,9 +5572,9 @@ func (m *awsRestjson1_deserializeOpDescribeGateway) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeGateway(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeBulkImportJob(response, &metadata) } - output := &DescribeGatewayOutput{} + output := &DescribeBulkImportJobOutput{} out.Result = output var buff [1024]byte @@ -5203,7 +5595,7 @@ func (m *awsRestjson1_deserializeOpDescribeGateway) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeGatewayOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5216,7 +5608,7 @@ func (m *awsRestjson1_deserializeOpDescribeGateway) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeBulkImportJob(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)} @@ -5279,7 +5671,7 @@ func awsRestjson1_deserializeOpErrorDescribeGateway(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentDescribeGatewayOutput(v **DescribeGatewayOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeBulkImportJobOutput(v **DescribeBulkImportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5292,16 +5684,49 @@ func awsRestjson1_deserializeOpDocumentDescribeGatewayOutput(v **DescribeGateway return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeGatewayOutput + var sv *DescribeBulkImportJobOutput if *v == nil { - sv = &DescribeGatewayOutput{} + sv = &DescribeBulkImportJobOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "creationDate": + case "adaptiveIngestion": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected AdaptiveIngestion to be of type *bool, got %T instead", value) + } + sv.AdaptiveIngestion = ptr.Bool(jtv) + } + + case "deleteFilesAfterImport": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected DeleteFilesAfterImport to be of type *bool, got %T instead", value) + } + sv.DeleteFilesAfterImport = ptr.Bool(jtv) + } + + case "errorReportLocation": + if err := awsRestjson1_deserializeDocumentErrorReportLocation(&sv.ErrorReportLocation, value); err != nil { + return err + } + + case "files": + if err := awsRestjson1_deserializeDocumentFiles(&sv.Files, value); err != nil { + return err + } + + case "jobConfiguration": + if err := awsRestjson1_deserializeDocumentJobConfiguration(&sv.JobConfiguration, value); err != nil { + return err + } + + case "jobCreationDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -5309,7 +5734,7 @@ func awsRestjson1_deserializeOpDocumentDescribeGatewayOutput(v **DescribeGateway if err != nil { return err } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.JobCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -5317,57 +5742,56 @@ func awsRestjson1_deserializeOpDocumentDescribeGatewayOutput(v **DescribeGateway } } - case "gatewayArn": + case "jobId": 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 ID to be of type string, got %T instead", value) } - sv.GatewayArn = ptr.String(jtv) + sv.JobId = ptr.String(jtv) } - case "gatewayCapabilitySummaries": - if err := awsRestjson1_deserializeDocumentGatewayCapabilitySummaries(&sv.GatewayCapabilitySummaries, value); err != nil { - return err + case "jobLastUpdateDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.JobLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } } - case "gatewayId": + case "jobName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.GatewayId = ptr.String(jtv) + sv.JobName = ptr.String(jtv) } - case "gatewayName": + case "jobRoleArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.GatewayName = ptr.String(jtv) - } - - case "gatewayPlatform": - if err := awsRestjson1_deserializeDocumentGatewayPlatform(&sv.GatewayPlatform, value); err != nil { - return err + sv.JobRoleArn = ptr.String(jtv) } - case "lastUpdateDate": + case "jobStatus": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) } + sv.JobStatus = types.JobStatus(jtv) } default: @@ -5379,14 +5803,14 @@ func awsRestjson1_deserializeOpDocumentDescribeGatewayOutput(v **DescribeGateway return nil } -type awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration struct { +type awsRestjson1_deserializeOpDescribeDashboard struct { } -func (*awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDescribeDashboard) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeDashboard) 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) @@ -5400,9 +5824,9 @@ func (m *awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeGatewayCapabilityConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeDashboard(response, &metadata) } - output := &DescribeGatewayCapabilityConfigurationOutput{} + output := &DescribeDashboardOutput{} out.Result = output var buff [1024]byte @@ -5423,7 +5847,7 @@ func (m *awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration) Handl return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeGatewayCapabilityConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeDashboardOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5436,7 +5860,7 @@ func (m *awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration) Handl return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeGatewayCapabilityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeDashboard(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)} @@ -5499,7 +5923,7 @@ func awsRestjson1_deserializeOpErrorDescribeGatewayCapabilityConfiguration(respo } } -func awsRestjson1_deserializeOpDocumentDescribeGatewayCapabilityConfigurationOutput(v **DescribeGatewayCapabilityConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeDashboardOutput(v **DescribeDashboardOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5512,49 +5936,99 @@ func awsRestjson1_deserializeOpDocumentDescribeGatewayCapabilityConfigurationOut return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeGatewayCapabilityConfigurationOutput + var sv *DescribeDashboardOutput if *v == nil { - sv = &DescribeGatewayCapabilityConfigurationOutput{} + sv = &DescribeDashboardOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "capabilityConfiguration": + case "dashboardArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CapabilityConfiguration to be of type string, got %T instead", value) + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.CapabilityConfiguration = ptr.String(jtv) + sv.DashboardArn = ptr.String(jtv) } - case "capabilityNamespace": + case "dashboardCreationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DashboardCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "dashboardDefinition": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CapabilityNamespace to be of type string, got %T instead", value) + return fmt.Errorf("expected DashboardDefinition to be of type string, got %T instead", value) } - sv.CapabilityNamespace = ptr.String(jtv) + sv.DashboardDefinition = ptr.String(jtv) } - case "capabilitySyncStatus": + case "dashboardDescription": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CapabilitySyncStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.CapabilitySyncStatus = types.CapabilitySyncStatus(jtv) + sv.DashboardDescription = ptr.String(jtv) } - case "gatewayId": + case "dashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.GatewayId = ptr.String(jtv) + sv.DashboardId = ptr.String(jtv) + } + + case "dashboardLastUpdateDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DashboardLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "dashboardName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.DashboardName = ptr.String(jtv) + } + + case "projectId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.ProjectId = ptr.String(jtv) } default: @@ -5566,14 +6040,14 @@ func awsRestjson1_deserializeOpDocumentDescribeGatewayCapabilityConfigurationOut return nil } -type awsRestjson1_deserializeOpDescribeLoggingOptions struct { +type awsRestjson1_deserializeOpDescribeDefaultEncryptionConfiguration struct { } -func (*awsRestjson1_deserializeOpDescribeLoggingOptions) ID() string { +func (*awsRestjson1_deserializeOpDescribeDefaultEncryptionConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeLoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeDefaultEncryptionConfiguration) 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) @@ -5587,9 +6061,9 @@ func (m *awsRestjson1_deserializeOpDescribeLoggingOptions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeLoggingOptions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeDefaultEncryptionConfiguration(response, &metadata) } - output := &DescribeLoggingOptionsOutput{} + output := &DescribeDefaultEncryptionConfigurationOutput{} out.Result = output var buff [1024]byte @@ -5610,7 +6084,7 @@ func (m *awsRestjson1_deserializeOpDescribeLoggingOptions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeLoggingOptionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeDefaultEncryptionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5623,7 +6097,7 @@ func (m *awsRestjson1_deserializeOpDescribeLoggingOptions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeLoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeDefaultEncryptionConfiguration(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)} @@ -5670,9 +6144,6 @@ func awsRestjson1_deserializeOpErrorDescribeLoggingOptions(response *smithyhttp. case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5686,7 +6157,7 @@ func awsRestjson1_deserializeOpErrorDescribeLoggingOptions(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentDescribeLoggingOptionsOutput(v **DescribeLoggingOptionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeDefaultEncryptionConfigurationOutput(v **DescribeDefaultEncryptionConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5699,37 +6170,55 @@ func awsRestjson1_deserializeOpDocumentDescribeLoggingOptionsOutput(v **Describe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeLoggingOptionsOutput + var sv *DescribeDefaultEncryptionConfigurationOutput if *v == nil { - sv = &DescribeLoggingOptionsOutput{} + sv = &DescribeDefaultEncryptionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "loggingOptions": - if err := awsRestjson1_deserializeDocumentLoggingOptions(&sv.LoggingOptions, value); err != nil { + case "configurationStatus": + if err := awsRestjson1_deserializeDocumentConfigurationStatus(&sv.ConfigurationStatus, value); err != nil { return err } - default: - _, _ = key, value - - } - } - *v = sv - return nil + case "encryptionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value) + } + sv.EncryptionType = types.EncryptionType(jtv) + } + + case "kmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -type awsRestjson1_deserializeOpDescribePortal struct { +type awsRestjson1_deserializeOpDescribeGateway struct { } -func (*awsRestjson1_deserializeOpDescribePortal) ID() string { +func (*awsRestjson1_deserializeOpDescribeGateway) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribePortal) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeGateway) 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) @@ -5743,9 +6232,9 @@ func (m *awsRestjson1_deserializeOpDescribePortal) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribePortal(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeGateway(response, &metadata) } - output := &DescribePortalOutput{} + output := &DescribeGatewayOutput{} out.Result = output var buff [1024]byte @@ -5766,7 +6255,7 @@ func (m *awsRestjson1_deserializeOpDescribePortal) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribePortalOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeGatewayOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5779,7 +6268,7 @@ func (m *awsRestjson1_deserializeOpDescribePortal) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribePortal(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeGateway(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)} @@ -5842,7 +6331,7 @@ func awsRestjson1_deserializeOpErrorDescribePortal(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentDescribePortalOutput(v **DescribePortalOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeGatewayOutput(v **DescribeGatewayOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5855,66 +6344,16 @@ func awsRestjson1_deserializeOpDocumentDescribePortalOutput(v **DescribePortalOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribePortalOutput + var sv *DescribeGatewayOutput if *v == nil { - sv = &DescribePortalOutput{} + sv = &DescribeGatewayOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "alarms": - if err := awsRestjson1_deserializeDocumentAlarms(&sv.Alarms, value); err != nil { - return err - } - - case "notificationSenderEmail": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Email to be of type string, got %T instead", value) - } - sv.NotificationSenderEmail = ptr.String(jtv) - } - - case "portalArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) - } - sv.PortalArn = ptr.String(jtv) - } - - case "portalAuthMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AuthMode to be of type string, got %T instead", value) - } - sv.PortalAuthMode = types.AuthMode(jtv) - } - - case "portalClientId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PortalClientId to be of type string, got %T instead", value) - } - sv.PortalClientId = ptr.String(jtv) - } - - case "portalContactEmail": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Email to be of type string, got %T instead", value) - } - sv.PortalContactEmail = ptr.String(jtv) - } - - case "portalCreationDate": + case "creationDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -5922,7 +6361,7 @@ func awsRestjson1_deserializeOpDocumentDescribePortalOutput(v **DescribePortalOu if err != nil { return err } - sv.PortalCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -5930,75 +6369,57 @@ func awsRestjson1_deserializeOpDocumentDescribePortalOutput(v **DescribePortalOu } } - case "portalDescription": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.PortalDescription = ptr.String(jtv) - } - - case "portalId": + case "gatewayArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) - } - sv.PortalId = ptr.String(jtv) - } - - case "portalLastUpdateDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.PortalLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } + sv.GatewayArn = ptr.String(jtv) } - case "portalLogoImageLocation": - if err := awsRestjson1_deserializeDocumentImageLocation(&sv.PortalLogoImageLocation, value); err != nil { + case "gatewayCapabilitySummaries": + if err := awsRestjson1_deserializeDocumentGatewayCapabilitySummaries(&sv.GatewayCapabilitySummaries, value); err != nil { return err } - case "portalName": + case "gatewayId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.PortalName = ptr.String(jtv) + sv.GatewayId = ptr.String(jtv) } - case "portalStartUrl": + case "gatewayName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Url to be of type string, got %T instead", value) + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.PortalStartUrl = ptr.String(jtv) + sv.GatewayName = ptr.String(jtv) } - case "portalStatus": - if err := awsRestjson1_deserializeDocumentPortalStatus(&sv.PortalStatus, value); err != nil { + case "gatewayPlatform": + if err := awsRestjson1_deserializeDocumentGatewayPlatform(&sv.GatewayPlatform, value); err != nil { return err } - case "roleArn": + case "lastUpdateDate": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ARN 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.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.RoleArn = ptr.String(jtv) } default: @@ -6010,14 +6431,14 @@ func awsRestjson1_deserializeOpDocumentDescribePortalOutput(v **DescribePortalOu return nil } -type awsRestjson1_deserializeOpDescribeProject struct { +type awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration struct { } -func (*awsRestjson1_deserializeOpDescribeProject) ID() string { +func (*awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration) 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) @@ -6031,9 +6452,9 @@ func (m *awsRestjson1_deserializeOpDescribeProject) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeProject(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeGatewayCapabilityConfiguration(response, &metadata) } - output := &DescribeProjectOutput{} + output := &DescribeGatewayCapabilityConfigurationOutput{} out.Result = output var buff [1024]byte @@ -6054,7 +6475,7 @@ func (m *awsRestjson1_deserializeOpDescribeProject) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeProjectOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeGatewayCapabilityConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6067,7 +6488,7 @@ func (m *awsRestjson1_deserializeOpDescribeProject) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeGatewayCapabilityConfiguration(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)} @@ -6130,7 +6551,7 @@ func awsRestjson1_deserializeOpErrorDescribeProject(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentDescribeProjectOutput(v **DescribeProjectOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeGatewayCapabilityConfigurationOutput(v **DescribeGatewayCapabilityConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6143,90 +6564,49 @@ func awsRestjson1_deserializeOpDocumentDescribeProjectOutput(v **DescribeProject return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeProjectOutput + var sv *DescribeGatewayCapabilityConfigurationOutput if *v == nil { - sv = &DescribeProjectOutput{} + sv = &DescribeGatewayCapabilityConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "portalId": + case "capabilityConfiguration": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected CapabilityConfiguration to be of type string, got %T instead", value) } - sv.PortalId = ptr.String(jtv) + sv.CapabilityConfiguration = ptr.String(jtv) } - case "projectArn": + case "capabilityNamespace": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) - } - sv.ProjectArn = ptr.String(jtv) - } - - case "projectCreationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ProjectCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + return fmt.Errorf("expected CapabilityNamespace to be of type string, got %T instead", value) } + sv.CapabilityNamespace = ptr.String(jtv) } - case "projectDescription": + case "capabilitySyncStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected CapabilitySyncStatus to be of type string, got %T instead", value) } - sv.ProjectDescription = ptr.String(jtv) + sv.CapabilitySyncStatus = types.CapabilitySyncStatus(jtv) } - case "projectId": + case "gatewayId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.ProjectId = ptr.String(jtv) - } - - case "projectLastUpdateDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ProjectLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "projectName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.ProjectName = ptr.String(jtv) + sv.GatewayId = ptr.String(jtv) } default: @@ -6238,14 +6618,14 @@ func awsRestjson1_deserializeOpDocumentDescribeProjectOutput(v **DescribeProject return nil } -type awsRestjson1_deserializeOpDescribeStorageConfiguration struct { +type awsRestjson1_deserializeOpDescribeLoggingOptions struct { } -func (*awsRestjson1_deserializeOpDescribeStorageConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDescribeLoggingOptions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeStorageConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeLoggingOptions) 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) @@ -6259,9 +6639,9 @@ func (m *awsRestjson1_deserializeOpDescribeStorageConfiguration) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeStorageConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeLoggingOptions(response, &metadata) } - output := &DescribeStorageConfigurationOutput{} + output := &DescribeLoggingOptionsOutput{} out.Result = output var buff [1024]byte @@ -6282,7 +6662,7 @@ func (m *awsRestjson1_deserializeOpDescribeStorageConfiguration) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeStorageConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeLoggingOptionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6295,7 +6675,7 @@ func (m *awsRestjson1_deserializeOpDescribeStorageConfiguration) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeStorageConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeLoggingOptions(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)} @@ -6336,18 +6716,12 @@ func awsRestjson1_deserializeOpErrorDescribeStorageConfiguration(response *smith } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -6364,7 +6738,7 @@ func awsRestjson1_deserializeOpErrorDescribeStorageConfiguration(response *smith } } -func awsRestjson1_deserializeOpDocumentDescribeStorageConfigurationOutput(v **DescribeStorageConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeLoggingOptionsOutput(v **DescribeLoggingOptionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6377,64 +6751,20 @@ func awsRestjson1_deserializeOpDocumentDescribeStorageConfigurationOutput(v **De return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeStorageConfigurationOutput + var sv *DescribeLoggingOptionsOutput if *v == nil { - sv = &DescribeStorageConfigurationOutput{} + sv = &DescribeLoggingOptionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "configurationStatus": - if err := awsRestjson1_deserializeDocumentConfigurationStatus(&sv.ConfigurationStatus, value); err != nil { - return err - } - - case "disassociatedDataStorage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DisassociatedDataStorageState to be of type string, got %T instead", value) - } - sv.DisassociatedDataStorage = types.DisassociatedDataStorageState(jtv) - } - - case "lastUpdateDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "multiLayerStorage": - if err := awsRestjson1_deserializeDocumentMultiLayerStorage(&sv.MultiLayerStorage, value); err != nil { - return err - } - - case "retentionPeriod": - if err := awsRestjson1_deserializeDocumentRetentionPeriod(&sv.RetentionPeriod, value); err != nil { + case "loggingOptions": + if err := awsRestjson1_deserializeDocumentLoggingOptions(&sv.LoggingOptions, value); err != nil { return err } - case "storageType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected StorageType to be of type string, got %T instead", value) - } - sv.StorageType = types.StorageType(jtv) - } - default: _, _ = key, value @@ -6444,14 +6774,14 @@ func awsRestjson1_deserializeOpDocumentDescribeStorageConfigurationOutput(v **De return nil } -type awsRestjson1_deserializeOpDescribeTimeSeries struct { +type awsRestjson1_deserializeOpDescribePortal struct { } -func (*awsRestjson1_deserializeOpDescribeTimeSeries) ID() string { +func (*awsRestjson1_deserializeOpDescribePortal) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeTimeSeries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribePortal) 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) @@ -6465,9 +6795,9 @@ func (m *awsRestjson1_deserializeOpDescribeTimeSeries) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeTimeSeries(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribePortal(response, &metadata) } - output := &DescribeTimeSeriesOutput{} + output := &DescribePortalOutput{} out.Result = output var buff [1024]byte @@ -6488,7 +6818,7 @@ func (m *awsRestjson1_deserializeOpDescribeTimeSeries) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribePortalOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6501,7 +6831,7 @@ func (m *awsRestjson1_deserializeOpDescribeTimeSeries) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeTimeSeries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribePortal(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)} @@ -6564,7 +6894,7 @@ func awsRestjson1_deserializeOpErrorDescribeTimeSeries(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(v **DescribeTimeSeriesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribePortalOutput(v **DescribePortalOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6577,70 +6907,66 @@ func awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(v **DescribeTime return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeTimeSeriesOutput + var sv *DescribePortalOutput if *v == nil { - sv = &DescribeTimeSeriesOutput{} + sv = &DescribePortalOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "alias": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PropertyAlias to be of type string, got %T instead", value) - } - sv.Alias = ptr.String(jtv) + case "alarms": + if err := awsRestjson1_deserializeDocumentAlarms(&sv.Alarms, value); err != nil { + return err } - case "assetId": + case "notificationSenderEmail": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected Email to be of type string, got %T instead", value) } - sv.AssetId = ptr.String(jtv) + sv.NotificationSenderEmail = ptr.String(jtv) } - case "dataType": + case "portalArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PropertyDataType to be of type string, got %T instead", value) + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.DataType = types.PropertyDataType(jtv) + sv.PortalArn = ptr.String(jtv) } - case "dataTypeSpec": + case "portalAuthMode": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthMode to be of type string, got %T instead", value) } - sv.DataTypeSpec = ptr.String(jtv) + sv.PortalAuthMode = types.AuthMode(jtv) } - case "propertyId": + case "portalClientId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected PortalClientId to be of type string, got %T instead", value) } - sv.PropertyId = ptr.String(jtv) + sv.PortalClientId = ptr.String(jtv) } - case "timeSeriesArn": + case "portalContactEmail": 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 Email to be of type string, got %T instead", value) } - sv.TimeSeriesArn = ptr.String(jtv) + sv.PortalContactEmail = ptr.String(jtv) } - case "timeSeriesCreationDate": + case "portalCreationDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -6648,7 +6974,7 @@ func awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(v **DescribeTime if err != nil { return err } - sv.TimeSeriesCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.PortalCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -6656,16 +6982,25 @@ func awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(v **DescribeTime } } - case "timeSeriesId": + case "portalDescription": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TimeSeriesId to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.TimeSeriesId = ptr.String(jtv) + sv.PortalDescription = ptr.String(jtv) } - case "timeSeriesLastUpdateDate": + case "portalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.PortalId = ptr.String(jtv) + } + + case "portalLastUpdateDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -6673,7 +7008,7 @@ func awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(v **DescribeTime if err != nil { return err } - sv.TimeSeriesLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.PortalLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -6681,6 +7016,43 @@ func awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(v **DescribeTime } } + case "portalLogoImageLocation": + if err := awsRestjson1_deserializeDocumentImageLocation(&sv.PortalLogoImageLocation, value); err != nil { + return err + } + + case "portalName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.PortalName = ptr.String(jtv) + } + + case "portalStartUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.PortalStartUrl = ptr.String(jtv) + } + + case "portalStatus": + if err := awsRestjson1_deserializeDocumentPortalStatus(&sv.PortalStatus, value); err != nil { + return err + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + default: _, _ = key, value @@ -6690,14 +7062,14 @@ func awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(v **DescribeTime return nil } -type awsRestjson1_deserializeOpDisassociateAssets struct { +type awsRestjson1_deserializeOpDescribeProject struct { } -func (*awsRestjson1_deserializeOpDisassociateAssets) ID() string { +func (*awsRestjson1_deserializeOpDescribeProject) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateAssets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeProject) 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) @@ -6711,21 +7083,43 @@ func (m *awsRestjson1_deserializeOpDisassociateAssets) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateAssets(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeProject(response, &metadata) } - output := &DisassociateAssetsOutput{} + output := &DescribeProjectOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentDescribeProjectOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateAssets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeProject(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)} @@ -6766,9 +7160,6 @@ func awsRestjson1_deserializeOpErrorDisassociateAssets(response *smithyhttp.Resp } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -6791,115 +7182,122 @@ func awsRestjson1_deserializeOpErrorDisassociateAssets(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpDisassociateTimeSeriesFromAssetProperty struct { -} - -func (*awsRestjson1_deserializeOpDisassociateTimeSeriesFromAssetProperty) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDisassociateTimeSeriesFromAssetProperty) 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 +func awsRestjson1_deserializeOpDocumentDescribeProjectOutput(v **DescribeProjectOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - response, ok := out.RawResponse.(*smithyhttp.Response) + shape, ok := value.(map[string]interface{}) if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + return fmt.Errorf("unexpected JSON type %v", value) } - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateTimeSeriesFromAssetProperty(response, &metadata) - } - output := &DisassociateTimeSeriesFromAssetPropertyOutput{} - 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), - } + var sv *DescribeProjectOutput + if *v == nil { + sv = &DescribeProjectOutput{} + } else { + sv = *v } - return out, metadata, err -} + for key, value := range shape { + switch key { + case "portalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.PortalId = ptr.String(jtv) + } -func awsRestjson1_deserializeOpErrorDisassociateTimeSeriesFromAssetProperty(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()) + case "projectArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.ProjectArn = ptr.String(jtv) + } - errorCode := "UnknownError" - errorMessage := errorCode + case "projectCreationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ProjectCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + } + } - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case "projectDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.ProjectDescription = ptr.String(jtv) + } - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } + case "projectId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.ProjectId = ptr.String(jtv) + } - switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + case "projectLastUpdateDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ProjectLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + } + } - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + default: + _, _ = key, value - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, } - return genericError - } + *v = sv + return nil } -type awsRestjson1_deserializeOpGetAssetPropertyAggregates struct { +type awsRestjson1_deserializeOpDescribeStorageConfiguration struct { } -func (*awsRestjson1_deserializeOpGetAssetPropertyAggregates) ID() string { +func (*awsRestjson1_deserializeOpDescribeStorageConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAssetPropertyAggregates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeStorageConfiguration) 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) @@ -6913,9 +7311,9 @@ func (m *awsRestjson1_deserializeOpGetAssetPropertyAggregates) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAssetPropertyAggregates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeStorageConfiguration(response, &metadata) } - output := &GetAssetPropertyAggregatesOutput{} + output := &DescribeStorageConfigurationOutput{} out.Result = output var buff [1024]byte @@ -6936,7 +7334,7 @@ func (m *awsRestjson1_deserializeOpGetAssetPropertyAggregates) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetAssetPropertyAggregatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeStorageConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6949,7 +7347,7 @@ func (m *awsRestjson1_deserializeOpGetAssetPropertyAggregates) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAssetPropertyAggregates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeStorageConfiguration(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)} @@ -6990,18 +7388,21 @@ func awsRestjson1_deserializeOpErrorGetAssetPropertyAggregates(response *smithyh } switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -7015,7 +7416,7 @@ func awsRestjson1_deserializeOpErrorGetAssetPropertyAggregates(response *smithyh } } -func awsRestjson1_deserializeOpDocumentGetAssetPropertyAggregatesOutput(v **GetAssetPropertyAggregatesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeStorageConfigurationOutput(v **DescribeStorageConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7028,27 +7429,76 @@ func awsRestjson1_deserializeOpDocumentGetAssetPropertyAggregatesOutput(v **GetA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetAssetPropertyAggregatesOutput + var sv *DescribeStorageConfigurationOutput if *v == nil { - sv = &GetAssetPropertyAggregatesOutput{} + sv = &DescribeStorageConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "aggregatedValues": - if err := awsRestjson1_deserializeDocumentAggregatedValues(&sv.AggregatedValues, value); err != nil { + case "configurationStatus": + if err := awsRestjson1_deserializeDocumentConfigurationStatus(&sv.ConfigurationStatus, value); err != nil { return err } - case "nextToken": + case "disassociatedDataStorage": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected DisassociatedDataStorageState to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.DisassociatedDataStorage = types.DisassociatedDataStorageState(jtv) + } + + case "lastUpdateDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "multiLayerStorage": + if err := awsRestjson1_deserializeDocumentMultiLayerStorage(&sv.MultiLayerStorage, value); err != nil { + return err + } + + case "retentionPeriod": + if err := awsRestjson1_deserializeDocumentRetentionPeriod(&sv.RetentionPeriod, value); err != nil { + return err + } + + case "storageType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StorageType to be of type string, got %T instead", value) + } + sv.StorageType = types.StorageType(jtv) + } + + case "warmTier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WarmTierState to be of type string, got %T instead", value) + } + sv.WarmTier = types.WarmTierState(jtv) + } + + case "warmTierRetentionPeriod": + if err := awsRestjson1_deserializeDocumentWarmTierRetentionPeriod(&sv.WarmTierRetentionPeriod, value); err != nil { + return err } default: @@ -7060,14 +7510,14 @@ func awsRestjson1_deserializeOpDocumentGetAssetPropertyAggregatesOutput(v **GetA return nil } -type awsRestjson1_deserializeOpGetAssetPropertyValue struct { +type awsRestjson1_deserializeOpDescribeTimeSeries struct { } -func (*awsRestjson1_deserializeOpGetAssetPropertyValue) ID() string { +func (*awsRestjson1_deserializeOpDescribeTimeSeries) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAssetPropertyValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeTimeSeries) 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) @@ -7081,9 +7531,9 @@ func (m *awsRestjson1_deserializeOpGetAssetPropertyValue) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAssetPropertyValue(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeTimeSeries(response, &metadata) } - output := &GetAssetPropertyValueOutput{} + output := &DescribeTimeSeriesOutput{} out.Result = output var buff [1024]byte @@ -7104,7 +7554,7 @@ func (m *awsRestjson1_deserializeOpGetAssetPropertyValue) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetAssetPropertyValueOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7117,7 +7567,7 @@ func (m *awsRestjson1_deserializeOpGetAssetPropertyValue) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAssetPropertyValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeTimeSeries(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)} @@ -7167,9 +7617,6 @@ func awsRestjson1_deserializeOpErrorGetAssetPropertyValue(response *smithyhttp.R case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -7183,7 +7630,7 @@ func awsRestjson1_deserializeOpErrorGetAssetPropertyValue(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentGetAssetPropertyValueOutput(v **GetAssetPropertyValueOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeTimeSeriesOutput(v **DescribeTimeSeriesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7196,37 +7643,127 @@ func awsRestjson1_deserializeOpDocumentGetAssetPropertyValueOutput(v **GetAssetP return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetAssetPropertyValueOutput + var sv *DescribeTimeSeriesOutput if *v == nil { - sv = &GetAssetPropertyValueOutput{} + sv = &DescribeTimeSeriesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "propertyValue": - if err := awsRestjson1_deserializeDocumentAssetPropertyValue(&sv.PropertyValue, value); err != nil { - return err + case "alias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PropertyAlias to be of type string, got %T instead", value) + } + sv.Alias = ptr.String(jtv) } - default: - _, _ = key, value - - } + case "assetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.AssetId = ptr.String(jtv) + } + + case "dataType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PropertyDataType to be of type string, got %T instead", value) + } + sv.DataType = types.PropertyDataType(jtv) + } + + case "dataTypeSpec": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.DataTypeSpec = ptr.String(jtv) + } + + case "propertyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.PropertyId = ptr.String(jtv) + } + + case "timeSeriesArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.TimeSeriesArn = ptr.String(jtv) + } + + case "timeSeriesCreationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TimeSeriesCreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "timeSeriesId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimeSeriesId to be of type string, got %T instead", value) + } + sv.TimeSeriesId = ptr.String(jtv) + } + + case "timeSeriesLastUpdateDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TimeSeriesLastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } } *v = sv return nil } -type awsRestjson1_deserializeOpGetAssetPropertyValueHistory struct { +type awsRestjson1_deserializeOpDisassociateAssets struct { } -func (*awsRestjson1_deserializeOpGetAssetPropertyValueHistory) ID() string { +func (*awsRestjson1_deserializeOpDisassociateAssets) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAssetPropertyValueHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisassociateAssets) 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) @@ -7240,43 +7777,21 @@ func (m *awsRestjson1_deserializeOpGetAssetPropertyValueHistory) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAssetPropertyValueHistory(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateAssets(response, &metadata) } - output := &GetAssetPropertyValueHistoryOutput{} + output := &DisassociateAssetsOutput{} 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_deserializeOpDocumentGetAssetPropertyValueHistoryOutput(&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_deserializeOpErrorGetAssetPropertyValueHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisassociateAssets(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)} @@ -7317,6 +7832,9 @@ func awsRestjson1_deserializeOpErrorGetAssetPropertyValueHistory(response *smith } switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -7326,9 +7844,6 @@ func awsRestjson1_deserializeOpErrorGetAssetPropertyValueHistory(response *smith case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -7342,59 +7857,14 @@ func awsRestjson1_deserializeOpErrorGetAssetPropertyValueHistory(response *smith } } -func awsRestjson1_deserializeOpDocumentGetAssetPropertyValueHistoryOutput(v **GetAssetPropertyValueHistoryOutput, 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 *GetAssetPropertyValueHistoryOutput - if *v == nil { - sv = &GetAssetPropertyValueHistoryOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "assetPropertyValueHistory": - if err := awsRestjson1_deserializeDocumentAssetPropertyValueHistory(&sv.AssetPropertyValueHistory, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetInterpolatedAssetPropertyValues struct { +type awsRestjson1_deserializeOpDisassociateTimeSeriesFromAssetProperty struct { } -func (*awsRestjson1_deserializeOpGetInterpolatedAssetPropertyValues) ID() string { +func (*awsRestjson1_deserializeOpDisassociateTimeSeriesFromAssetProperty) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetInterpolatedAssetPropertyValues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDisassociateTimeSeriesFromAssetProperty) 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) @@ -7408,43 +7878,21 @@ func (m *awsRestjson1_deserializeOpGetInterpolatedAssetPropertyValues) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetInterpolatedAssetPropertyValues(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateTimeSeriesFromAssetProperty(response, &metadata) } - output := &GetInterpolatedAssetPropertyValuesOutput{} + output := &DisassociateTimeSeriesFromAssetPropertyOutput{} 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_deserializeOpDocumentGetInterpolatedAssetPropertyValuesOutput(&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_deserializeOpErrorGetInterpolatedAssetPropertyValues(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDisassociateTimeSeriesFromAssetProperty(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)} @@ -7485,6 +7933,9 @@ func awsRestjson1_deserializeOpErrorGetInterpolatedAssetPropertyValues(response } switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -7494,9 +7945,6 @@ func awsRestjson1_deserializeOpErrorGetInterpolatedAssetPropertyValues(response case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -7510,76 +7958,31 @@ func awsRestjson1_deserializeOpErrorGetInterpolatedAssetPropertyValues(response } } -func awsRestjson1_deserializeOpDocumentGetInterpolatedAssetPropertyValuesOutput(v **GetInterpolatedAssetPropertyValuesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil +type awsRestjson1_deserializeOpExecuteAction struct { +} + +func (*awsRestjson1_deserializeOpExecuteAction) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpExecuteAction) 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 } - shape, ok := value.(map[string]interface{}) + response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { - return fmt.Errorf("unexpected JSON type %v", value) + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - var sv *GetInterpolatedAssetPropertyValuesOutput - if *v == nil { - sv = &GetInterpolatedAssetPropertyValuesOutput{} - } else { - sv = *v + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorExecuteAction(response, &metadata) } - - for key, value := range shape { - switch key { - case "interpolatedAssetPropertyValues": - if err := awsRestjson1_deserializeDocumentInterpolatedAssetPropertyValues(&sv.InterpolatedAssetPropertyValues, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListAccessPolicies struct { -} - -func (*awsRestjson1_deserializeOpListAccessPolicies) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListAccessPolicies) 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_deserializeOpErrorListAccessPolicies(response, &metadata) - } - output := &ListAccessPoliciesOutput{} - out.Result = output + output := &ExecuteActionOutput{} + out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -7599,7 +8002,7 @@ func (m *awsRestjson1_deserializeOpListAccessPolicies) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAccessPoliciesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentExecuteActionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7612,7 +8015,7 @@ func (m *awsRestjson1_deserializeOpListAccessPolicies) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAccessPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorExecuteAction(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)} @@ -7653,12 +8056,21 @@ func awsRestjson1_deserializeOpErrorListAccessPolicies(response *smithyhttp.Resp } switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -7672,7 +8084,7 @@ func awsRestjson1_deserializeOpErrorListAccessPolicies(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListAccessPoliciesOutput(v **ListAccessPoliciesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentExecuteActionOutput(v **ExecuteActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7685,27 +8097,22 @@ func awsRestjson1_deserializeOpDocumentListAccessPoliciesOutput(v **ListAccessPo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAccessPoliciesOutput + var sv *ExecuteActionOutput if *v == nil { - sv = &ListAccessPoliciesOutput{} + sv = &ExecuteActionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "accessPolicySummaries": - if err := awsRestjson1_deserializeDocumentAccessPolicySummaries(&sv.AccessPolicySummaries, value); err != nil { - return err - } - - case "nextToken": + case "actionId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.ActionId = ptr.String(jtv) } default: @@ -7717,14 +8124,14 @@ func awsRestjson1_deserializeOpDocumentListAccessPoliciesOutput(v **ListAccessPo return nil } -type awsRestjson1_deserializeOpListAssetModelProperties struct { +type awsRestjson1_deserializeOpExecuteQuery struct { } -func (*awsRestjson1_deserializeOpListAssetModelProperties) ID() string { +func (*awsRestjson1_deserializeOpExecuteQuery) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssetModelProperties) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpExecuteQuery) 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) @@ -7738,9 +8145,9 @@ func (m *awsRestjson1_deserializeOpListAssetModelProperties) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssetModelProperties(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorExecuteQuery(response, &metadata) } - output := &ListAssetModelPropertiesOutput{} + output := &ExecuteQueryOutput{} out.Result = output var buff [1024]byte @@ -7761,7 +8168,7 @@ func (m *awsRestjson1_deserializeOpListAssetModelProperties) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssetModelPropertiesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentExecuteQueryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7774,7 +8181,7 @@ func (m *awsRestjson1_deserializeOpListAssetModelProperties) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssetModelProperties(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorExecuteQuery(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)} @@ -7815,18 +8222,27 @@ func awsRestjson1_deserializeOpErrorListAssetModelProperties(response *smithyhtt } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("QueryTimeoutException", errorCode): + return awsRestjson1_deserializeErrorQueryTimeoutException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7837,7 +8253,7 @@ func awsRestjson1_deserializeOpErrorListAssetModelProperties(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListAssetModelPropertiesOutput(v **ListAssetModelPropertiesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentExecuteQueryOutput(v **ExecuteQueryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7850,17 +8266,17 @@ func awsRestjson1_deserializeOpDocumentListAssetModelPropertiesOutput(v **ListAs return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssetModelPropertiesOutput + var sv *ExecuteQueryOutput if *v == nil { - sv = &ListAssetModelPropertiesOutput{} + sv = &ExecuteQueryOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetModelPropertySummaries": - if err := awsRestjson1_deserializeDocumentAssetModelPropertySummaries(&sv.AssetModelPropertySummaries, value); err != nil { + case "columns": + if err := awsRestjson1_deserializeDocumentColumnsList(&sv.Columns, value); err != nil { return err } @@ -7868,11 +8284,16 @@ func awsRestjson1_deserializeOpDocumentListAssetModelPropertiesOutput(v **ListAs if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected ExecuteQueryNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } + case "rows": + if err := awsRestjson1_deserializeDocumentRows(&sv.Rows, value); err != nil { + return err + } + default: _, _ = key, value @@ -7882,14 +8303,14 @@ func awsRestjson1_deserializeOpDocumentListAssetModelPropertiesOutput(v **ListAs return nil } -type awsRestjson1_deserializeOpListAssetModels struct { +type awsRestjson1_deserializeOpGetAssetPropertyAggregates struct { } -func (*awsRestjson1_deserializeOpListAssetModels) ID() string { +func (*awsRestjson1_deserializeOpGetAssetPropertyAggregates) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssetModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAssetPropertyAggregates) 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) @@ -7903,9 +8324,9 @@ func (m *awsRestjson1_deserializeOpListAssetModels) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssetModels(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAssetPropertyAggregates(response, &metadata) } - output := &ListAssetModelsOutput{} + output := &GetAssetPropertyAggregatesOutput{} out.Result = output var buff [1024]byte @@ -7926,7 +8347,7 @@ func (m *awsRestjson1_deserializeOpListAssetModels) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssetModelsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAssetPropertyAggregatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7939,7 +8360,7 @@ func (m *awsRestjson1_deserializeOpListAssetModels) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssetModels(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAssetPropertyAggregates(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)} @@ -7986,6 +8407,12 @@ func awsRestjson1_deserializeOpErrorListAssetModels(response *smithyhttp.Respons case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -7999,7 +8426,7 @@ func awsRestjson1_deserializeOpErrorListAssetModels(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListAssetModelsOutput(v **ListAssetModelsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAssetPropertyAggregatesOutput(v **GetAssetPropertyAggregatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8012,17 +8439,17 @@ func awsRestjson1_deserializeOpDocumentListAssetModelsOutput(v **ListAssetModels return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssetModelsOutput + var sv *GetAssetPropertyAggregatesOutput if *v == nil { - sv = &ListAssetModelsOutput{} + sv = &GetAssetPropertyAggregatesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetModelSummaries": - if err := awsRestjson1_deserializeDocumentAssetModelSummaries(&sv.AssetModelSummaries, value); err != nil { + case "aggregatedValues": + if err := awsRestjson1_deserializeDocumentAggregatedValues(&sv.AggregatedValues, value); err != nil { return err } @@ -8044,14 +8471,14 @@ func awsRestjson1_deserializeOpDocumentListAssetModelsOutput(v **ListAssetModels return nil } -type awsRestjson1_deserializeOpListAssetProperties struct { +type awsRestjson1_deserializeOpGetAssetPropertyValue struct { } -func (*awsRestjson1_deserializeOpListAssetProperties) ID() string { +func (*awsRestjson1_deserializeOpGetAssetPropertyValue) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssetProperties) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAssetPropertyValue) 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) @@ -8065,9 +8492,9 @@ func (m *awsRestjson1_deserializeOpListAssetProperties) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssetProperties(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAssetPropertyValue(response, &metadata) } - output := &ListAssetPropertiesOutput{} + output := &GetAssetPropertyValueOutput{} out.Result = output var buff [1024]byte @@ -8088,7 +8515,7 @@ func (m *awsRestjson1_deserializeOpListAssetProperties) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssetPropertiesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAssetPropertyValueOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8101,7 +8528,7 @@ func (m *awsRestjson1_deserializeOpListAssetProperties) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssetProperties(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAssetPropertyValue(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)} @@ -8151,6 +8578,9 @@ func awsRestjson1_deserializeOpErrorListAssetProperties(response *smithyhttp.Res case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -8164,7 +8594,7 @@ func awsRestjson1_deserializeOpErrorListAssetProperties(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListAssetPropertiesOutput(v **ListAssetPropertiesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAssetPropertyValueOutput(v **GetAssetPropertyValueOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8177,29 +8607,20 @@ func awsRestjson1_deserializeOpDocumentListAssetPropertiesOutput(v **ListAssetPr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssetPropertiesOutput + var sv *GetAssetPropertyValueOutput if *v == nil { - sv = &ListAssetPropertiesOutput{} + sv = &GetAssetPropertyValueOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetPropertySummaries": - if err := awsRestjson1_deserializeDocumentAssetPropertySummaries(&sv.AssetPropertySummaries, value); err != nil { + case "propertyValue": + if err := awsRestjson1_deserializeDocumentAssetPropertyValue(&sv.PropertyValue, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -8209,14 +8630,14 @@ func awsRestjson1_deserializeOpDocumentListAssetPropertiesOutput(v **ListAssetPr return nil } -type awsRestjson1_deserializeOpListAssetRelationships struct { +type awsRestjson1_deserializeOpGetAssetPropertyValueHistory struct { } -func (*awsRestjson1_deserializeOpListAssetRelationships) ID() string { +func (*awsRestjson1_deserializeOpGetAssetPropertyValueHistory) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssetRelationships) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAssetPropertyValueHistory) 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) @@ -8230,9 +8651,9 @@ func (m *awsRestjson1_deserializeOpListAssetRelationships) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssetRelationships(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetAssetPropertyValueHistory(response, &metadata) } - output := &ListAssetRelationshipsOutput{} + output := &GetAssetPropertyValueHistoryOutput{} out.Result = output var buff [1024]byte @@ -8253,7 +8674,7 @@ func (m *awsRestjson1_deserializeOpListAssetRelationships) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssetRelationshipsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetAssetPropertyValueHistoryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8266,7 +8687,7 @@ func (m *awsRestjson1_deserializeOpListAssetRelationships) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssetRelationships(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAssetPropertyValueHistory(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)} @@ -8316,6 +8737,9 @@ func awsRestjson1_deserializeOpErrorListAssetRelationships(response *smithyhttp. case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -8329,7 +8753,7 @@ func awsRestjson1_deserializeOpErrorListAssetRelationships(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListAssetRelationshipsOutput(v **ListAssetRelationshipsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetAssetPropertyValueHistoryOutput(v **GetAssetPropertyValueHistoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8342,17 +8766,17 @@ func awsRestjson1_deserializeOpDocumentListAssetRelationshipsOutput(v **ListAsse return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssetRelationshipsOutput + var sv *GetAssetPropertyValueHistoryOutput if *v == nil { - sv = &ListAssetRelationshipsOutput{} + sv = &GetAssetPropertyValueHistoryOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetRelationshipSummaries": - if err := awsRestjson1_deserializeDocumentAssetRelationshipSummaries(&sv.AssetRelationshipSummaries, value); err != nil { + case "assetPropertyValueHistory": + if err := awsRestjson1_deserializeDocumentAssetPropertyValueHistory(&sv.AssetPropertyValueHistory, value); err != nil { return err } @@ -8374,14 +8798,14 @@ func awsRestjson1_deserializeOpDocumentListAssetRelationshipsOutput(v **ListAsse return nil } -type awsRestjson1_deserializeOpListAssets struct { +type awsRestjson1_deserializeOpGetInterpolatedAssetPropertyValues struct { } -func (*awsRestjson1_deserializeOpListAssets) ID() string { +func (*awsRestjson1_deserializeOpGetInterpolatedAssetPropertyValues) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetInterpolatedAssetPropertyValues) 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) @@ -8395,9 +8819,9 @@ func (m *awsRestjson1_deserializeOpListAssets) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssets(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetInterpolatedAssetPropertyValues(response, &metadata) } - output := &ListAssetsOutput{} + output := &GetInterpolatedAssetPropertyValuesOutput{} out.Result = output var buff [1024]byte @@ -8418,7 +8842,7 @@ func (m *awsRestjson1_deserializeOpListAssets) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssetsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetInterpolatedAssetPropertyValuesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8431,7 +8855,7 @@ func (m *awsRestjson1_deserializeOpListAssets) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetInterpolatedAssetPropertyValues(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)} @@ -8481,6 +8905,9 @@ func awsRestjson1_deserializeOpErrorListAssets(response *smithyhttp.Response, me case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -8494,7 +8921,7 @@ func awsRestjson1_deserializeOpErrorListAssets(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListAssetsOutput(v **ListAssetsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetInterpolatedAssetPropertyValuesOutput(v **GetInterpolatedAssetPropertyValuesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8507,17 +8934,17 @@ func awsRestjson1_deserializeOpDocumentListAssetsOutput(v **ListAssetsOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssetsOutput + var sv *GetInterpolatedAssetPropertyValuesOutput if *v == nil { - sv = &ListAssetsOutput{} + sv = &GetInterpolatedAssetPropertyValuesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetSummaries": - if err := awsRestjson1_deserializeDocumentAssetSummaries(&sv.AssetSummaries, value); err != nil { + case "interpolatedAssetPropertyValues": + if err := awsRestjson1_deserializeDocumentInterpolatedAssetPropertyValues(&sv.InterpolatedAssetPropertyValues, value); err != nil { return err } @@ -8539,14 +8966,14 @@ func awsRestjson1_deserializeOpDocumentListAssetsOutput(v **ListAssetsOutput, va return nil } -type awsRestjson1_deserializeOpListAssociatedAssets struct { +type awsRestjson1_deserializeOpListAccessPolicies struct { } -func (*awsRestjson1_deserializeOpListAssociatedAssets) ID() string { +func (*awsRestjson1_deserializeOpListAccessPolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAssociatedAssets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAccessPolicies) 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) @@ -8560,9 +8987,9 @@ func (m *awsRestjson1_deserializeOpListAssociatedAssets) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssociatedAssets(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAccessPolicies(response, &metadata) } - output := &ListAssociatedAssetsOutput{} + output := &ListAccessPoliciesOutput{} out.Result = output var buff [1024]byte @@ -8583,7 +9010,7 @@ func (m *awsRestjson1_deserializeOpListAssociatedAssets) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAssociatedAssetsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAccessPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8596,7 +9023,7 @@ func (m *awsRestjson1_deserializeOpListAssociatedAssets) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAssociatedAssets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAccessPolicies(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)} @@ -8643,9 +9070,6 @@ func awsRestjson1_deserializeOpErrorListAssociatedAssets(response *smithyhttp.Re case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -8659,7 +9083,7 @@ func awsRestjson1_deserializeOpErrorListAssociatedAssets(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListAssociatedAssetsOutput(v **ListAssociatedAssetsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAccessPoliciesOutput(v **ListAccessPoliciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8672,17 +9096,17 @@ func awsRestjson1_deserializeOpDocumentListAssociatedAssetsOutput(v **ListAssoci return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAssociatedAssetsOutput + var sv *ListAccessPoliciesOutput if *v == nil { - sv = &ListAssociatedAssetsOutput{} + sv = &ListAccessPoliciesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetSummaries": - if err := awsRestjson1_deserializeDocumentAssociatedAssetsSummaries(&sv.AssetSummaries, value); err != nil { + case "accessPolicySummaries": + if err := awsRestjson1_deserializeDocumentAccessPolicySummaries(&sv.AccessPolicySummaries, value); err != nil { return err } @@ -8704,14 +9128,14 @@ func awsRestjson1_deserializeOpDocumentListAssociatedAssetsOutput(v **ListAssoci return nil } -type awsRestjson1_deserializeOpListBulkImportJobs struct { +type awsRestjson1_deserializeOpListActions struct { } -func (*awsRestjson1_deserializeOpListBulkImportJobs) ID() string { +func (*awsRestjson1_deserializeOpListActions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListBulkImportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListActions) 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) @@ -8725,9 +9149,9 @@ func (m *awsRestjson1_deserializeOpListBulkImportJobs) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListBulkImportJobs(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListActions(response, &metadata) } - output := &ListBulkImportJobsOutput{} + output := &ListActionsOutput{} out.Result = output var buff [1024]byte @@ -8748,7 +9172,7 @@ func (m *awsRestjson1_deserializeOpListBulkImportJobs) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListBulkImportJobsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8761,7 +9185,7 @@ func (m *awsRestjson1_deserializeOpListBulkImportJobs) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListBulkImportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListActions(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)} @@ -8824,7 +9248,7 @@ func awsRestjson1_deserializeOpErrorListBulkImportJobs(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListBulkImportJobsOutput(v **ListBulkImportJobsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListActionsOutput(v **ListActionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8837,17 +9261,17 @@ func awsRestjson1_deserializeOpDocumentListBulkImportJobsOutput(v **ListBulkImpo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListBulkImportJobsOutput + var sv *ListActionsOutput if *v == nil { - sv = &ListBulkImportJobsOutput{} + sv = &ListActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "jobSummaries": - if err := awsRestjson1_deserializeDocumentJobSummaries(&sv.JobSummaries, value); err != nil { + case "actionSummaries": + if err := awsRestjson1_deserializeDocumentActionSummaries(&sv.ActionSummaries, value); err != nil { return err } @@ -8869,14 +9293,14 @@ func awsRestjson1_deserializeOpDocumentListBulkImportJobsOutput(v **ListBulkImpo return nil } -type awsRestjson1_deserializeOpListDashboards struct { +type awsRestjson1_deserializeOpListAssetModelCompositeModels struct { } -func (*awsRestjson1_deserializeOpListDashboards) ID() string { +func (*awsRestjson1_deserializeOpListAssetModelCompositeModels) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDashboards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssetModelCompositeModels) 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) @@ -8890,9 +9314,9 @@ func (m *awsRestjson1_deserializeOpListDashboards) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDashboards(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssetModelCompositeModels(response, &metadata) } - output := &ListDashboardsOutput{} + output := &ListAssetModelCompositeModelsOutput{} out.Result = output var buff [1024]byte @@ -8913,7 +9337,7 @@ func (m *awsRestjson1_deserializeOpListDashboards) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDashboardsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssetModelCompositeModelsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8926,7 +9350,7 @@ func (m *awsRestjson1_deserializeOpListDashboards) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDashboards(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssetModelCompositeModels(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)} @@ -8973,6 +9397,9 @@ func awsRestjson1_deserializeOpErrorListDashboards(response *smithyhttp.Response case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -8986,7 +9413,7 @@ func awsRestjson1_deserializeOpErrorListDashboards(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListDashboardsOutput(v **ListDashboardsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssetModelCompositeModelsOutput(v **ListAssetModelCompositeModelsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8999,17 +9426,17 @@ func awsRestjson1_deserializeOpDocumentListDashboardsOutput(v **ListDashboardsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDashboardsOutput + var sv *ListAssetModelCompositeModelsOutput if *v == nil { - sv = &ListDashboardsOutput{} + sv = &ListAssetModelCompositeModelsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "dashboardSummaries": - if err := awsRestjson1_deserializeDocumentDashboardSummaries(&sv.DashboardSummaries, value); err != nil { + case "assetModelCompositeModelSummaries": + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModelSummaries(&sv.AssetModelCompositeModelSummaries, value); err != nil { return err } @@ -9031,14 +9458,14 @@ func awsRestjson1_deserializeOpDocumentListDashboardsOutput(v **ListDashboardsOu return nil } -type awsRestjson1_deserializeOpListGateways struct { +type awsRestjson1_deserializeOpListAssetModelProperties struct { } -func (*awsRestjson1_deserializeOpListGateways) ID() string { +func (*awsRestjson1_deserializeOpListAssetModelProperties) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListGateways) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssetModelProperties) 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) @@ -9052,9 +9479,9 @@ func (m *awsRestjson1_deserializeOpListGateways) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListGateways(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssetModelProperties(response, &metadata) } - output := &ListGatewaysOutput{} + output := &ListAssetModelPropertiesOutput{} out.Result = output var buff [1024]byte @@ -9075,7 +9502,7 @@ func (m *awsRestjson1_deserializeOpListGateways) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListGatewaysOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssetModelPropertiesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9088,7 +9515,7 @@ func (m *awsRestjson1_deserializeOpListGateways) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListGateways(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssetModelProperties(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)} @@ -9135,6 +9562,9 @@ func awsRestjson1_deserializeOpErrorListGateways(response *smithyhttp.Response, case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -9148,7 +9578,7 @@ func awsRestjson1_deserializeOpErrorListGateways(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListGatewaysOutput(v **ListGatewaysOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssetModelPropertiesOutput(v **ListAssetModelPropertiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9161,17 +9591,17 @@ func awsRestjson1_deserializeOpDocumentListGatewaysOutput(v **ListGatewaysOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListGatewaysOutput + var sv *ListAssetModelPropertiesOutput if *v == nil { - sv = &ListGatewaysOutput{} + sv = &ListAssetModelPropertiesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "gatewaySummaries": - if err := awsRestjson1_deserializeDocumentGatewaySummaries(&sv.GatewaySummaries, value); err != nil { + case "assetModelPropertySummaries": + if err := awsRestjson1_deserializeDocumentAssetModelPropertySummaries(&sv.AssetModelPropertySummaries, value); err != nil { return err } @@ -9193,14 +9623,14 @@ func awsRestjson1_deserializeOpDocumentListGatewaysOutput(v **ListGatewaysOutput return nil } -type awsRestjson1_deserializeOpListPortals struct { +type awsRestjson1_deserializeOpListAssetModels struct { } -func (*awsRestjson1_deserializeOpListPortals) ID() string { +func (*awsRestjson1_deserializeOpListAssetModels) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPortals) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssetModels) 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) @@ -9214,9 +9644,9 @@ func (m *awsRestjson1_deserializeOpListPortals) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPortals(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssetModels(response, &metadata) } - output := &ListPortalsOutput{} + output := &ListAssetModelsOutput{} out.Result = output var buff [1024]byte @@ -9237,7 +9667,7 @@ func (m *awsRestjson1_deserializeOpListPortals) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPortalsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssetModelsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9250,7 +9680,7 @@ func (m *awsRestjson1_deserializeOpListPortals) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPortals(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssetModels(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)} @@ -9310,7 +9740,7 @@ func awsRestjson1_deserializeOpErrorListPortals(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListPortalsOutput(v **ListPortalsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssetModelsOutput(v **ListAssetModelsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9323,15 +9753,20 @@ func awsRestjson1_deserializeOpDocumentListPortalsOutput(v **ListPortalsOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPortalsOutput + var sv *ListAssetModelsOutput if *v == nil { - sv = &ListPortalsOutput{} + sv = &ListAssetModelsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "assetModelSummaries": + if err := awsRestjson1_deserializeDocumentAssetModelSummaries(&sv.AssetModelSummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -9341,11 +9776,6 @@ func awsRestjson1_deserializeOpDocumentListPortalsOutput(v **ListPortalsOutput, sv.NextToken = ptr.String(jtv) } - case "portalSummaries": - if err := awsRestjson1_deserializeDocumentPortalSummaries(&sv.PortalSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -9355,14 +9785,14 @@ func awsRestjson1_deserializeOpDocumentListPortalsOutput(v **ListPortalsOutput, return nil } -type awsRestjson1_deserializeOpListProjectAssets struct { +type awsRestjson1_deserializeOpListAssetProperties struct { } -func (*awsRestjson1_deserializeOpListProjectAssets) ID() string { +func (*awsRestjson1_deserializeOpListAssetProperties) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListProjectAssets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssetProperties) 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) @@ -9376,9 +9806,9 @@ func (m *awsRestjson1_deserializeOpListProjectAssets) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListProjectAssets(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssetProperties(response, &metadata) } - output := &ListProjectAssetsOutput{} + output := &ListAssetPropertiesOutput{} out.Result = output var buff [1024]byte @@ -9399,7 +9829,7 @@ func (m *awsRestjson1_deserializeOpListProjectAssets) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListProjectAssetsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssetPropertiesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9412,7 +9842,7 @@ func (m *awsRestjson1_deserializeOpListProjectAssets) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListProjectAssets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssetProperties(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)} @@ -9459,6 +9889,9 @@ func awsRestjson1_deserializeOpErrorListProjectAssets(response *smithyhttp.Respo case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -9472,7 +9905,7 @@ func awsRestjson1_deserializeOpErrorListProjectAssets(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListProjectAssetsOutput(v **ListProjectAssetsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssetPropertiesOutput(v **ListAssetPropertiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9485,17 +9918,17 @@ func awsRestjson1_deserializeOpDocumentListProjectAssetsOutput(v **ListProjectAs return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListProjectAssetsOutput + var sv *ListAssetPropertiesOutput if *v == nil { - sv = &ListProjectAssetsOutput{} + sv = &ListAssetPropertiesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetIds": - if err := awsRestjson1_deserializeDocumentAssetIDs(&sv.AssetIds, value); err != nil { + case "assetPropertySummaries": + if err := awsRestjson1_deserializeDocumentAssetPropertySummaries(&sv.AssetPropertySummaries, value); err != nil { return err } @@ -9517,14 +9950,14 @@ func awsRestjson1_deserializeOpDocumentListProjectAssetsOutput(v **ListProjectAs return nil } -type awsRestjson1_deserializeOpListProjects struct { +type awsRestjson1_deserializeOpListAssetRelationships struct { } -func (*awsRestjson1_deserializeOpListProjects) ID() string { +func (*awsRestjson1_deserializeOpListAssetRelationships) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListProjects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssetRelationships) 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) @@ -9538,9 +9971,9 @@ func (m *awsRestjson1_deserializeOpListProjects) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListProjects(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssetRelationships(response, &metadata) } - output := &ListProjectsOutput{} + output := &ListAssetRelationshipsOutput{} out.Result = output var buff [1024]byte @@ -9561,7 +9994,7 @@ func (m *awsRestjson1_deserializeOpListProjects) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListProjectsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssetRelationshipsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9574,7 +10007,7 @@ func (m *awsRestjson1_deserializeOpListProjects) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListProjects(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssetRelationships(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)} @@ -9621,6 +10054,9 @@ func awsRestjson1_deserializeOpErrorListProjects(response *smithyhttp.Response, case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -9634,7 +10070,7 @@ func awsRestjson1_deserializeOpErrorListProjects(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListProjectsOutput(v **ListProjectsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssetRelationshipsOutput(v **ListAssetRelationshipsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9647,15 +10083,20 @@ func awsRestjson1_deserializeOpDocumentListProjectsOutput(v **ListProjectsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListProjectsOutput + var sv *ListAssetRelationshipsOutput if *v == nil { - sv = &ListProjectsOutput{} + sv = &ListAssetRelationshipsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "assetRelationshipSummaries": + if err := awsRestjson1_deserializeDocumentAssetRelationshipSummaries(&sv.AssetRelationshipSummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -9665,11 +10106,6 @@ func awsRestjson1_deserializeOpDocumentListProjectsOutput(v **ListProjectsOutput sv.NextToken = ptr.String(jtv) } - case "projectSummaries": - if err := awsRestjson1_deserializeDocumentProjectSummaries(&sv.ProjectSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -9679,14 +10115,14 @@ func awsRestjson1_deserializeOpDocumentListProjectsOutput(v **ListProjectsOutput return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListAssets struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListAssets) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssets) 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) @@ -9700,9 +10136,9 @@ 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_deserializeOpErrorListAssets(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListAssetsOutput{} out.Result = output var buff [1024]byte @@ -9723,7 +10159,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssetsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9736,7 +10172,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssets(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)} @@ -9777,27 +10213,18 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9808,7 +10235,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssetsOutput(v **ListAssetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9821,20 +10248,29 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListAssetsOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListAssetsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "assetSummaries": + if err := awsRestjson1_deserializeDocumentAssetSummaries(&sv.AssetSummaries, value); err != nil { return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -9844,14 +10280,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpListTimeSeries struct { +type awsRestjson1_deserializeOpListAssociatedAssets struct { } -func (*awsRestjson1_deserializeOpListTimeSeries) ID() string { +func (*awsRestjson1_deserializeOpListAssociatedAssets) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTimeSeries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAssociatedAssets) 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) @@ -9865,9 +10301,9 @@ func (m *awsRestjson1_deserializeOpListTimeSeries) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTimeSeries(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAssociatedAssets(response, &metadata) } - output := &ListTimeSeriesOutput{} + output := &ListAssociatedAssetsOutput{} out.Result = output var buff [1024]byte @@ -9888,7 +10324,7 @@ func (m *awsRestjson1_deserializeOpListTimeSeries) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTimeSeriesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAssociatedAssetsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9901,7 +10337,7 @@ func (m *awsRestjson1_deserializeOpListTimeSeries) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTimeSeries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAssociatedAssets(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)} @@ -9964,7 +10400,7 @@ func awsRestjson1_deserializeOpErrorListTimeSeries(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListTimeSeriesOutput(v **ListTimeSeriesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAssociatedAssetsOutput(v **ListAssociatedAssetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9977,15 +10413,20 @@ func awsRestjson1_deserializeOpDocumentListTimeSeriesOutput(v **ListTimeSeriesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTimeSeriesOutput + var sv *ListAssociatedAssetsOutput if *v == nil { - sv = &ListTimeSeriesOutput{} + sv = &ListAssociatedAssetsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "assetSummaries": + if err := awsRestjson1_deserializeDocumentAssociatedAssetsSummaries(&sv.AssetSummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -9995,11 +10436,6 @@ func awsRestjson1_deserializeOpDocumentListTimeSeriesOutput(v **ListTimeSeriesOu sv.NextToken = ptr.String(jtv) } - case "TimeSeriesSummaries": - if err := awsRestjson1_deserializeDocumentTimeSeriesSummaries(&sv.TimeSeriesSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -10009,14 +10445,14 @@ func awsRestjson1_deserializeOpDocumentListTimeSeriesOutput(v **ListTimeSeriesOu return nil } -type awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration struct { +type awsRestjson1_deserializeOpListBulkImportJobs struct { } -func (*awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration) ID() string { +func (*awsRestjson1_deserializeOpListBulkImportJobs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListBulkImportJobs) 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) @@ -10030,9 +10466,9 @@ func (m *awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutDefaultEncryptionConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListBulkImportJobs(response, &metadata) } - output := &PutDefaultEncryptionConfigurationOutput{} + output := &ListBulkImportJobsOutput{} out.Result = output var buff [1024]byte @@ -10053,7 +10489,7 @@ func (m *awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration) HandleDese return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutDefaultEncryptionConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListBulkImportJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10066,7 +10502,7 @@ func (m *awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration) HandleDese return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutDefaultEncryptionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListBulkImportJobs(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)} @@ -10107,17 +10543,14 @@ func awsRestjson1_deserializeOpErrorPutDefaultEncryptionConfiguration(response * } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -10132,7 +10565,7 @@ func awsRestjson1_deserializeOpErrorPutDefaultEncryptionConfiguration(response * } } -func awsRestjson1_deserializeOpDocumentPutDefaultEncryptionConfigurationOutput(v **PutDefaultEncryptionConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListBulkImportJobsOutput(v **ListBulkImportJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10145,36 +10578,27 @@ func awsRestjson1_deserializeOpDocumentPutDefaultEncryptionConfigurationOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutDefaultEncryptionConfigurationOutput + var sv *ListBulkImportJobsOutput if *v == nil { - sv = &PutDefaultEncryptionConfigurationOutput{} + sv = &ListBulkImportJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "configurationStatus": - if err := awsRestjson1_deserializeDocumentConfigurationStatus(&sv.ConfigurationStatus, value); err != nil { + case "jobSummaries": + if err := awsRestjson1_deserializeDocumentJobSummaries(&sv.JobSummaries, value); err != nil { return err } - case "encryptionType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value) - } - sv.EncryptionType = types.EncryptionType(jtv) - } - - case "kmsKeyArn": + case "nextToken": 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 NextToken to be of type string, got %T instead", value) } - sv.KmsKeyArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -10186,14 +10610,14 @@ func awsRestjson1_deserializeOpDocumentPutDefaultEncryptionConfigurationOutput(v return nil } -type awsRestjson1_deserializeOpPutLoggingOptions struct { +type awsRestjson1_deserializeOpListCompositionRelationships struct { } -func (*awsRestjson1_deserializeOpPutLoggingOptions) ID() string { +func (*awsRestjson1_deserializeOpListCompositionRelationships) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutLoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCompositionRelationships) 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) @@ -10207,17 +10631,45 @@ func (m *awsRestjson1_deserializeOpPutLoggingOptions) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutLoggingOptions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCompositionRelationships(response, &metadata) } - output := &PutLoggingOptionsOutput{} + output := &ListCompositionRelationshipsOutput{} out.Result = output - return out, metadata, err -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -func awsRestjson1_deserializeOpErrorPutLoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + 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_deserializeOpDocumentListCompositionRelationshipsOutput(&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_deserializeOpErrorListCompositionRelationships(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()) @@ -10256,9 +10708,6 @@ func awsRestjson1_deserializeOpErrorPutLoggingOptions(response *smithyhttp.Respo } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -10281,14 +10730,59 @@ func awsRestjson1_deserializeOpErrorPutLoggingOptions(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpPutStorageConfiguration struct { +func awsRestjson1_deserializeOpDocumentListCompositionRelationshipsOutput(v **ListCompositionRelationshipsOutput, 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 *ListCompositionRelationshipsOutput + if *v == nil { + sv = &ListCompositionRelationshipsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "compositionRelationshipSummaries": + if err := awsRestjson1_deserializeDocumentCompositionRelationshipSummaries(&sv.CompositionRelationshipSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpPutStorageConfiguration) ID() string { +type awsRestjson1_deserializeOpListDashboards struct { +} + +func (*awsRestjson1_deserializeOpListDashboards) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutStorageConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDashboards) 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) @@ -10302,9 +10796,9 @@ func (m *awsRestjson1_deserializeOpPutStorageConfiguration) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutStorageConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDashboards(response, &metadata) } - output := &PutStorageConfigurationOutput{} + output := &ListDashboardsOutput{} out.Result = output var buff [1024]byte @@ -10325,7 +10819,7 @@ func (m *awsRestjson1_deserializeOpPutStorageConfiguration) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutStorageConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDashboardsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10338,7 +10832,7 @@ func (m *awsRestjson1_deserializeOpPutStorageConfiguration) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutStorageConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDashboards(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)} @@ -10379,24 +10873,12 @@ func awsRestjson1_deserializeOpErrorPutStorageConfiguration(response *smithyhttp } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceAlreadyExistsException", errorCode): - return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -10410,7 +10892,7 @@ func awsRestjson1_deserializeOpErrorPutStorageConfiguration(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentPutStorageConfigurationOutput(v **PutStorageConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDashboardsOutput(v **ListDashboardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10423,46 +10905,27 @@ func awsRestjson1_deserializeOpDocumentPutStorageConfigurationOutput(v **PutStor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutStorageConfigurationOutput + var sv *ListDashboardsOutput if *v == nil { - sv = &PutStorageConfigurationOutput{} + sv = &ListDashboardsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "configurationStatus": - if err := awsRestjson1_deserializeDocumentConfigurationStatus(&sv.ConfigurationStatus, value); err != nil { - return err - } - - case "disassociatedDataStorage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DisassociatedDataStorageState to be of type string, got %T instead", value) - } - sv.DisassociatedDataStorage = types.DisassociatedDataStorageState(jtv) - } - - case "multiLayerStorage": - if err := awsRestjson1_deserializeDocumentMultiLayerStorage(&sv.MultiLayerStorage, value); err != nil { - return err - } - - case "retentionPeriod": - if err := awsRestjson1_deserializeDocumentRetentionPeriod(&sv.RetentionPeriod, value); err != nil { + case "dashboardSummaries": + if err := awsRestjson1_deserializeDocumentDashboardSummaries(&sv.DashboardSummaries, value); err != nil { return err } - case "storageType": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected StorageType to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.StorageType = types.StorageType(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -10474,14 +10937,14 @@ func awsRestjson1_deserializeOpDocumentPutStorageConfigurationOutput(v **PutStor return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpListGateways struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpListGateways) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListGateways) 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) @@ -10495,15 +10958,43 @@ 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_deserializeOpErrorListGateways(response, &metadata) } - output := &TagResourceOutput{} + output := &ListGatewaysOutput{} 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_deserializeOpDocumentListGatewaysOutput(&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_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListGateways(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)} @@ -10544,30 +11035,15 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("TooManyTagsException", errorCode): - return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10578,14 +11054,59 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentListGatewaysOutput(v **ListGatewaysOutput, 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 *ListGatewaysOutput + if *v == nil { + sv = &ListGatewaysOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "gatewaySummaries": + if err := awsRestjson1_deserializeDocumentGatewaySummaries(&sv.GatewaySummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpListPortals struct { +} + +func (*awsRestjson1_deserializeOpListPortals) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPortals) 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) @@ -10599,23 +11120,51 @@ 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_deserializeOpErrorListPortals(response, &metadata) } - output := &UntagResourceOutput{} + output := &ListPortalsOutput{} out.Result = output - return out, metadata, err -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -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()) + body := io.TeeReader(response.Body, ringBuffer) - errorCode := "UnknownError" - errorMessage := errorCode + 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_deserializeOpDocumentListPortalsOutput(&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_deserializeOpErrorListPortals(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { @@ -10648,27 +11197,15 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10679,14 +11216,59 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateAccessPolicy struct { +func awsRestjson1_deserializeOpDocumentListPortalsOutput(v **ListPortalsOutput, 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 *ListPortalsOutput + if *v == nil { + sv = &ListPortalsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "portalSummaries": + if err := awsRestjson1_deserializeDocumentPortalSummaries(&sv.PortalSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateAccessPolicy) ID() string { +type awsRestjson1_deserializeOpListProjectAssets struct { +} + +func (*awsRestjson1_deserializeOpListProjectAssets) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAccessPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListProjectAssets) 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) @@ -10700,15 +11282,43 @@ func (m *awsRestjson1_deserializeOpUpdateAccessPolicy) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAccessPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListProjectAssets(response, &metadata) } - output := &UpdateAccessPolicyOutput{} + output := &ListProjectAssetsOutput{} 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_deserializeOpDocumentListProjectAssetsOutput(&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_deserializeOpErrorUpdateAccessPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListProjectAssets(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)} @@ -10755,9 +11365,6 @@ func awsRestjson1_deserializeOpErrorUpdateAccessPolicy(response *smithyhttp.Resp case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -10771,14 +11378,59 @@ func awsRestjson1_deserializeOpErrorUpdateAccessPolicy(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpUpdateAsset struct { +func awsRestjson1_deserializeOpDocumentListProjectAssetsOutput(v **ListProjectAssetsOutput, 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 *ListProjectAssetsOutput + if *v == nil { + sv = &ListProjectAssetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assetIds": + if err := awsRestjson1_deserializeDocumentAssetIDs(&sv.AssetIds, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateAsset) ID() string { +type awsRestjson1_deserializeOpListProjects struct { +} + +func (*awsRestjson1_deserializeOpListProjects) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAsset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListProjects) 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) @@ -10792,9 +11444,9 @@ func (m *awsRestjson1_deserializeOpUpdateAsset) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAsset(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListProjects(response, &metadata) } - output := &UpdateAssetOutput{} + output := &ListProjectsOutput{} out.Result = output var buff [1024]byte @@ -10815,7 +11467,7 @@ func (m *awsRestjson1_deserializeOpUpdateAsset) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAssetOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListProjectsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10828,7 +11480,7 @@ func (m *awsRestjson1_deserializeOpUpdateAsset) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAsset(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListProjects(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)} @@ -10869,21 +11521,12 @@ func awsRestjson1_deserializeOpErrorUpdateAsset(response *smithyhttp.Response, m } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceAlreadyExistsException", errorCode): - return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -10897,7 +11540,7 @@ func awsRestjson1_deserializeOpErrorUpdateAsset(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListProjectsOutput(v **ListProjectsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10910,17 +11553,26 @@ func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAssetOutput + var sv *ListProjectsOutput if *v == nil { - sv = &UpdateAssetOutput{} + sv = &ListProjectsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetStatus": - if err := awsRestjson1_deserializeDocumentAssetStatus(&sv.AssetStatus, value); err != nil { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "projectSummaries": + if err := awsRestjson1_deserializeDocumentProjectSummaries(&sv.ProjectSummaries, value); err != nil { return err } @@ -10933,14 +11585,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, return nil } -type awsRestjson1_deserializeOpUpdateAssetModel struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpUpdateAssetModel) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAssetModel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -10954,9 +11606,9 @@ func (m *awsRestjson1_deserializeOpUpdateAssetModel) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAssetModel(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UpdateAssetModelOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -10977,7 +11629,7 @@ func (m *awsRestjson1_deserializeOpUpdateAssetModel) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAssetModelOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10990,7 +11642,7 @@ func (m *awsRestjson1_deserializeOpUpdateAssetModel) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAssetModel(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -11043,15 +11695,15 @@ func awsRestjson1_deserializeOpErrorUpdateAssetModel(response *smithyhttp.Respon case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceAlreadyExistsException", errorCode): - return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -11062,7 +11714,7 @@ func awsRestjson1_deserializeOpErrorUpdateAssetModel(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentUpdateAssetModelOutput(v **UpdateAssetModelOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11075,17 +11727,17 @@ func awsRestjson1_deserializeOpDocumentUpdateAssetModelOutput(v **UpdateAssetMod return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAssetModelOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &UpdateAssetModelOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "assetModelStatus": - if err := awsRestjson1_deserializeDocumentAssetModelStatus(&sv.AssetModelStatus, value); err != nil { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } @@ -11098,14 +11750,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAssetModelOutput(v **UpdateAssetMod return nil } -type awsRestjson1_deserializeOpUpdateAssetProperty struct { +type awsRestjson1_deserializeOpListTimeSeries struct { } -func (*awsRestjson1_deserializeOpUpdateAssetProperty) ID() string { +func (*awsRestjson1_deserializeOpListTimeSeries) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAssetProperty) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTimeSeries) 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) @@ -11119,21 +11771,43 @@ func (m *awsRestjson1_deserializeOpUpdateAssetProperty) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAssetProperty(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTimeSeries(response, &metadata) } - output := &UpdateAssetPropertyOutput{} + output := &ListTimeSeriesOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentListTimeSeriesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAssetProperty(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTimeSeries(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)} @@ -11174,9 +11848,6 @@ func awsRestjson1_deserializeOpErrorUpdateAssetProperty(response *smithyhttp.Res } switch { - case strings.EqualFold("ConflictingOperationException", errorCode): - return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -11199,14 +11870,59 @@ func awsRestjson1_deserializeOpErrorUpdateAssetProperty(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpUpdateDashboard struct { +func awsRestjson1_deserializeOpDocumentListTimeSeriesOutput(v **ListTimeSeriesOutput, 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 *ListTimeSeriesOutput + if *v == nil { + sv = &ListTimeSeriesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "TimeSeriesSummaries": + if err := awsRestjson1_deserializeDocumentTimeSeriesSummaries(&sv.TimeSeriesSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateDashboard) ID() string { +type awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration struct { +} + +func (*awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration) 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) @@ -11220,15 +11936,43 @@ func (m *awsRestjson1_deserializeOpUpdateDashboard) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDashboard(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutDefaultEncryptionConfiguration(response, &metadata) } - output := &UpdateDashboardOutput{} + output := &PutDefaultEncryptionConfigurationOutput{} 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_deserializeOpDocumentPutDefaultEncryptionConfigurationOutput(&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_deserializeOpErrorUpdateDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutDefaultEncryptionConfiguration(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)} @@ -11269,14 +12013,17 @@ func awsRestjson1_deserializeOpErrorUpdateDashboard(response *smithyhttp.Respons } switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -11291,14 +12038,68 @@ func awsRestjson1_deserializeOpErrorUpdateDashboard(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpUpdateGateway struct { +func awsRestjson1_deserializeOpDocumentPutDefaultEncryptionConfigurationOutput(v **PutDefaultEncryptionConfigurationOutput, 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 *PutDefaultEncryptionConfigurationOutput + if *v == nil { + sv = &PutDefaultEncryptionConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configurationStatus": + if err := awsRestjson1_deserializeDocumentConfigurationStatus(&sv.ConfigurationStatus, value); err != nil { + return err + } + + case "encryptionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value) + } + sv.EncryptionType = types.EncryptionType(jtv) + } + + case "kmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateGateway) ID() string { +type awsRestjson1_deserializeOpPutLoggingOptions struct { +} + +func (*awsRestjson1_deserializeOpPutLoggingOptions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateGateway) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutLoggingOptions) 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) @@ -11312,21 +12113,15 @@ func (m *awsRestjson1_deserializeOpUpdateGateway) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateGateway(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutLoggingOptions(response, &metadata) } - output := &UpdateGatewayOutput{} + output := &PutLoggingOptionsOutput{} 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_deserializeOpErrorUpdateGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutLoggingOptions(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)} @@ -11392,14 +12187,14 @@ func awsRestjson1_deserializeOpErrorUpdateGateway(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration struct { +type awsRestjson1_deserializeOpPutStorageConfiguration struct { } -func (*awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration) ID() string { +func (*awsRestjson1_deserializeOpPutStorageConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutStorageConfiguration) 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) @@ -11413,9 +12208,9 @@ func (m *awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateGatewayCapabilityConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutStorageConfiguration(response, &metadata) } - output := &UpdateGatewayCapabilityConfigurationOutput{} + output := &PutStorageConfigurationOutput{} out.Result = output var buff [1024]byte @@ -11436,7 +12231,7 @@ func (m *awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration) HandleD return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateGatewayCapabilityConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentPutStorageConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11449,7 +12244,7 @@ func (m *awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration) HandleD return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateGatewayCapabilityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutStorageConfiguration(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)} @@ -11502,6 +12297,9 @@ func awsRestjson1_deserializeOpErrorUpdateGatewayCapabilityConfiguration(respons case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -11518,7 +12316,7 @@ func awsRestjson1_deserializeOpErrorUpdateGatewayCapabilityConfiguration(respons } } -func awsRestjson1_deserializeOpDocumentUpdateGatewayCapabilityConfigurationOutput(v **UpdateGatewayCapabilityConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentPutStorageConfigurationOutput(v **PutStorageConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11531,50 +12329,79 @@ func awsRestjson1_deserializeOpDocumentUpdateGatewayCapabilityConfigurationOutpu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateGatewayCapabilityConfigurationOutput + var sv *PutStorageConfigurationOutput if *v == nil { - sv = &UpdateGatewayCapabilityConfigurationOutput{} + sv = &PutStorageConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "capabilityNamespace": + case "configurationStatus": + if err := awsRestjson1_deserializeDocumentConfigurationStatus(&sv.ConfigurationStatus, value); err != nil { + return err + } + + case "disassociatedDataStorage": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CapabilityNamespace to be of type string, got %T instead", value) + return fmt.Errorf("expected DisassociatedDataStorageState to be of type string, got %T instead", value) } - sv.CapabilityNamespace = ptr.String(jtv) + sv.DisassociatedDataStorage = types.DisassociatedDataStorageState(jtv) } - case "capabilitySyncStatus": + case "multiLayerStorage": + if err := awsRestjson1_deserializeDocumentMultiLayerStorage(&sv.MultiLayerStorage, value); err != nil { + return err + } + + case "retentionPeriod": + if err := awsRestjson1_deserializeDocumentRetentionPeriod(&sv.RetentionPeriod, value); err != nil { + return err + } + + case "storageType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CapabilitySyncStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected StorageType to be of type string, got %T instead", value) } - sv.CapabilitySyncStatus = types.CapabilitySyncStatus(jtv) + sv.StorageType = types.StorageType(jtv) } - default: - _, _ = key, value - - } - } + case "warmTier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WarmTierState to be of type string, got %T instead", value) + } + sv.WarmTier = types.WarmTierState(jtv) + } + + case "warmTierRetentionPeriod": + if err := awsRestjson1_deserializeDocumentWarmTierRetentionPeriod(&sv.WarmTierRetentionPeriod, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } *v = sv return nil } -type awsRestjson1_deserializeOpUpdatePortal struct { +type awsRestjson1_deserializeOpTagResource struct { } -func (*awsRestjson1_deserializeOpUpdatePortal) ID() string { +func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdatePortal) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -11588,43 +12415,119 @@ func (m *awsRestjson1_deserializeOpUpdatePortal) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdatePortal(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } - output := &UpdatePortalOutput{} + 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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - + body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return out, metadata, err + return err } - err = awsRestjson1_deserializeOpDocumentUpdatePortalOutput(&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(), + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(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_deserializeOpErrorUpdatePortal(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -11674,12 +12577,18 @@ func awsRestjson1_deserializeOpErrorUpdatePortal(response *smithyhttp.Response, case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -11690,50 +12599,14 @@ func awsRestjson1_deserializeOpErrorUpdatePortal(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdatePortalOutput(v **UpdatePortalOutput, 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 *UpdatePortalOutput - if *v == nil { - sv = &UpdatePortalOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "portalStatus": - if err := awsRestjson1_deserializeDocumentPortalStatus(&sv.PortalStatus, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateProject struct { +type awsRestjson1_deserializeOpUpdateAccessPolicy struct { } -func (*awsRestjson1_deserializeOpUpdateProject) ID() string { +func (*awsRestjson1_deserializeOpUpdateAccessPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateAccessPolicy) 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) @@ -11747,15 +12620,15 @@ func (m *awsRestjson1_deserializeOpUpdateProject) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateProject(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAccessPolicy(response, &metadata) } - output := &UpdateProjectOutput{} + output := &UpdateAccessPolicyOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateAccessPolicy(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)} @@ -11818,12 +12691,37 @@ func awsRestjson1_deserializeOpErrorUpdateProject(response *smithyhttp.Response, } } -func awsRestjson1_deserializeErrorConflictingOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictingOperationException{} +type awsRestjson1_deserializeOpUpdateAsset struct { +} + +func (*awsRestjson1_deserializeOpUpdateAsset) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAsset) 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_deserializeOpErrorUpdateAsset(response, &metadata) + } + output := &UpdateAssetOutput{} + 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{} @@ -11834,47 +12732,44 @@ func awsRestjson1_deserializeErrorConflictingOperationException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentConflictingOperationException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentUpdateAssetOutput(&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_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalFailureException{} +func awsRestjson1_deserializeOpErrorUpdateAsset(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - 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_deserializeDocumentInternalFailureException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11886,88 +12781,109 @@ func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output -} + switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) -func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - 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(), + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) +func awsRestjson1_deserializeOpDocumentUpdateAssetOutput(v **UpdateAssetOutput, 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 *UpdateAssetOutput + if *v == nil { + sv = &UpdateAssetOutput{} + } else { + sv = *v + } - return output -} + for key, value := range shape { + switch key { + case "assetStatus": + if err := awsRestjson1_deserializeDocumentAssetStatus(&sv.AssetStatus, value); err != nil { + return err + } -func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.LimitExceededException{} - 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_deserializeDocumentLimitExceededException(&output, shape) +type awsRestjson1_deserializeOpUpdateAssetModel struct { +} +func (*awsRestjson1_deserializeOpUpdateAssetModel) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAssetModel) 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 { - 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 + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAssetModel(response, &metadata) + } + output := &UpdateAssetModelOutput{} + out.Result = output -func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceAlreadyExistsException{} 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{} @@ -11978,83 +12894,44 @@ func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smith Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentResourceAlreadyExistsException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentUpdateAssetModelOutput(&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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - 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 +func awsRestjson1_deserializeOpErrorUpdateAssetModel(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()) - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + errorCode := "UnknownError" + errorMessage := errorCode - 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 + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - 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) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12066,119 +12943,2716 @@ func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyht } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output -} + switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) -func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - 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 strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - 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 - } + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) - errorBody.Seek(0, io.SeekStart) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateAssetModelOutput(v **UpdateAssetModelOutput, 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 *UpdateAssetModelOutput + if *v == nil { + sv = &UpdateAssetModelOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assetModelStatus": + if err := awsRestjson1_deserializeDocumentAssetModelStatus(&sv.AssetModelStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateAssetModelCompositeModel struct { +} + +func (*awsRestjson1_deserializeOpUpdateAssetModelCompositeModel) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAssetModelCompositeModel) 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_deserializeOpErrorUpdateAssetModelCompositeModel(response, &metadata) + } + output := &UpdateAssetModelCompositeModelOutput{} + 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_deserializeOpDocumentUpdateAssetModelCompositeModelOutput(&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_deserializeOpErrorUpdateAssetModelCompositeModel(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateAssetModelCompositeModelOutput(v **UpdateAssetModelCompositeModelOutput, 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 *UpdateAssetModelCompositeModelOutput + if *v == nil { + sv = &UpdateAssetModelCompositeModelOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assetModelCompositeModelPath": + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModelPath(&sv.AssetModelCompositeModelPath, value); err != nil { + return err + } + + case "assetModelStatus": + if err := awsRestjson1_deserializeDocumentAssetModelStatus(&sv.AssetModelStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateAssetProperty struct { +} + +func (*awsRestjson1_deserializeOpUpdateAssetProperty) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAssetProperty) 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_deserializeOpErrorUpdateAssetProperty(response, &metadata) + } + output := &UpdateAssetPropertyOutput{} + 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_deserializeOpErrorUpdateAssetProperty(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateDashboard struct { +} + +func (*awsRestjson1_deserializeOpUpdateDashboard) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateDashboard) 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_deserializeOpErrorUpdateDashboard(response, &metadata) + } + output := &UpdateDashboardOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateGateway struct { +} + +func (*awsRestjson1_deserializeOpUpdateGateway) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateGateway) 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_deserializeOpErrorUpdateGateway(response, &metadata) + } + output := &UpdateGatewayOutput{} + 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_deserializeOpErrorUpdateGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration) 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_deserializeOpErrorUpdateGatewayCapabilityConfiguration(response, &metadata) + } + output := &UpdateGatewayCapabilityConfigurationOutput{} + 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_deserializeOpDocumentUpdateGatewayCapabilityConfigurationOutput(&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_deserializeOpErrorUpdateGatewayCapabilityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateGatewayCapabilityConfigurationOutput(v **UpdateGatewayCapabilityConfigurationOutput, 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 *UpdateGatewayCapabilityConfigurationOutput + if *v == nil { + sv = &UpdateGatewayCapabilityConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "capabilityNamespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CapabilityNamespace to be of type string, got %T instead", value) + } + sv.CapabilityNamespace = ptr.String(jtv) + } + + case "capabilitySyncStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CapabilitySyncStatus to be of type string, got %T instead", value) + } + sv.CapabilitySyncStatus = types.CapabilitySyncStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdatePortal struct { +} + +func (*awsRestjson1_deserializeOpUpdatePortal) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePortal) 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_deserializeOpErrorUpdatePortal(response, &metadata) + } + output := &UpdatePortalOutput{} + 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_deserializeOpDocumentUpdatePortalOutput(&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_deserializeOpErrorUpdatePortal(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictingOperationException", errorCode): + return awsRestjson1_deserializeErrorConflictingOperationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdatePortalOutput(v **UpdatePortalOutput, 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 *UpdatePortalOutput + if *v == nil { + sv = &UpdatePortalOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "portalStatus": + if err := awsRestjson1_deserializeDocumentPortalStatus(&sv.PortalStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateProject struct { +} + +func (*awsRestjson1_deserializeOpUpdateProject) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateProject) 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_deserializeOpErrorUpdateProject(response, &metadata) + } + output := &UpdateProjectOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + 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_deserializeDocumentAccessDeniedException(&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_deserializeErrorConflictingOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictingOperationException{} + 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_deserializeDocumentConflictingOperationException(&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_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalFailureException{} + 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_deserializeDocumentInternalFailureException(&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_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestException{} + 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_deserializeDocumentInvalidRequestException(&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_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.LimitExceededException{} + 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_deserializeDocumentLimitExceededException(&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_deserializeErrorQueryTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.QueryTimeoutException{} + 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_deserializeDocumentQueryTimeoutException(&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_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceAlreadyExistsException{} + 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_deserializeDocumentResourceAlreadyExistsException(&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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + 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_deserializeDocumentResourceNotFoundException(&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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + 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_deserializeDocumentThrottlingException(&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_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTagsException{} + 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_deserializeDocumentTooManyTagsException(&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_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnauthorizedException{} + 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_deserializeDocumentUnauthorizedException(&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_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + 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_deserializeDocumentValidationException(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } 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 awsRestjson1_deserializeDocumentAccessPolicySummaries(v *[]types.AccessPolicySummary, 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.AccessPolicySummary + if *v == nil { + cv = []types.AccessPolicySummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccessPolicySummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccessPolicySummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAccessPolicySummary(v **types.AccessPolicySummary, 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.AccessPolicySummary + if *v == nil { + sv = &types.AccessPolicySummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "identity": + if err := awsRestjson1_deserializeDocumentIdentity(&sv.Identity, value); err != nil { + return err + } + + case "lastUpdateDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "permission": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Permission to be of type string, got %T instead", value) + } + sv.Permission = types.Permission(jtv) + } + + case "resource": + if err := awsRestjson1_deserializeDocumentResource(&sv.Resource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentActionDefinition(v **types.ActionDefinition, 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.ActionDefinition + if *v == nil { + sv = &types.ActionDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.ActionDefinitionId = ptr.String(jtv) + } + + case "actionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.ActionName = ptr.String(jtv) + } + + case "actionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.ActionType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentActionDefinitions(v *[]types.ActionDefinition, 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.ActionDefinition + if *v == nil { + cv = []types.ActionDefinition{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ActionDefinition + destAddr := &col + if err := awsRestjson1_deserializeDocumentActionDefinition(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentActionPayload(v **types.ActionPayload, 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.ActionPayload + if *v == nil { + sv = &types.ActionPayload{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "stringValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionPayloadString to be of type string, got %T instead", value) + } + sv.StringValue = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentActionSummaries(v *[]types.ActionSummary, 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.ActionSummary + if *v == nil { + cv = []types.ActionSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ActionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentActionSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentActionSummary(v **types.ActionSummary, 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.ActionSummary + if *v == nil { + sv = &types.ActionSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.ActionDefinitionId = ptr.String(jtv) + } + + case "actionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.ActionId = ptr.String(jtv) + } + + case "targetResource": + if err := awsRestjson1_deserializeDocumentTargetResource(&sv.TargetResource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAggregatedValue(v **types.AggregatedValue, 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.AggregatedValue + if *v == nil { + sv = &types.AggregatedValue{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "quality": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Quality to be of type string, got %T instead", value) + } + sv.Quality = types.Quality(jtv) + } + + case "timestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "value": + if err := awsRestjson1_deserializeDocumentAggregates(&sv.Value, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAggregatedValues(v *[]types.AggregatedValue, 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.AggregatedValue + if *v == nil { + cv = []types.AggregatedValue{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AggregatedValue + destAddr := &col + if err := awsRestjson1_deserializeDocumentAggregatedValue(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAggregates(v **types.Aggregates, 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.Aggregates + if *v == nil { + sv = &types.Aggregates{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "average": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Average = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Average = ptr.Float64(f64) + + default: + return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) + + } + } + + case "count": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Count = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Count = ptr.Float64(f64) + + default: + return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) + + } + } + + case "maximum": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Maximum = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Maximum = ptr.Float64(f64) + + default: + return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) + + } + } + + case "minimum": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Minimum = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Minimum = ptr.Float64(f64) + + default: + return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) + + } + } + + case "standardDeviation": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StandardDeviation = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.StandardDeviation = ptr.Float64(f64) + + default: + return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) + + } + } + + case "sum": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Sum = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Sum = ptr.Float64(f64) + + default: + return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAlarms(v **types.Alarms, 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.Alarms + if *v == nil { + sv = &types.Alarms{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "alarmRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.AlarmRoleArn = ptr.String(jtv) + } + + case "notificationLambdaArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.NotificationLambdaArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetCompositeModel(v **types.AssetCompositeModel, 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.AssetCompositeModel + if *v == nil { + sv = &types.AssetCompositeModel{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "properties": + if err := awsRestjson1_deserializeDocumentAssetProperties(&sv.Properties, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetCompositeModelPath(v *[]types.AssetCompositeModelPathSegment, 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.AssetCompositeModelPathSegment + if *v == nil { + cv = []types.AssetCompositeModelPathSegment{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetCompositeModelPathSegment + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetCompositeModelPathSegment(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssetCompositeModelPathSegment(v **types.AssetCompositeModelPathSegment, 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.AssetCompositeModelPathSegment + if *v == nil { + sv = &types.AssetCompositeModelPathSegment{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetCompositeModels(v *[]types.AssetCompositeModel, 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.AssetCompositeModel + if *v == nil { + cv = []types.AssetCompositeModel{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetCompositeModel + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetCompositeModel(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssetCompositeModelSummaries(v *[]types.AssetCompositeModelSummary, 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.AssetCompositeModelSummary + if *v == nil { + cv = []types.AssetCompositeModelSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetCompositeModelSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetCompositeModelSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssetCompositeModelSummary(v **types.AssetCompositeModelSummary, 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.AssetCompositeModelSummary + if *v == nil { + sv = &types.AssetCompositeModelSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "path": + if err := awsRestjson1_deserializeDocumentAssetCompositeModelPath(&sv.Path, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetErrorDetails(v **types.AssetErrorDetails, 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.AssetErrorDetails + if *v == nil { + sv = &types.AssetErrorDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.AssetId = ptr.String(jtv) + } + + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.AssetErrorCode(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetHierarchies(v *[]types.AssetHierarchy, 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.AssetHierarchy + if *v == nil { + cv = []types.AssetHierarchy{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetHierarchy + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetHierarchy(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssetHierarchy(v **types.AssetHierarchy, 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.AssetHierarchy + if *v == nil { + sv = &types.AssetHierarchy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } - return output -} + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } -func awsRestjson1_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTagsException{} - 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_deserializeDocumentTooManyTagsException(&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 +func awsRestjson1_deserializeDocumentAssetHierarchyInfo(v **types.AssetHierarchyInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - errorBody.Seek(0, io.SeekStart) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - return output -} + var sv *types.AssetHierarchyInfo + if *v == nil { + sv = &types.AssetHierarchyInfo{} + } else { + sv = *v + } -func awsRestjson1_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.UnauthorizedException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + for key, value := range shape { + switch key { + case "childAssetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.ChildAssetId = 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 "parentAssetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.ParentAssetId = ptr.String(jtv) + } - err := awsRestjson1_deserializeDocumentUnauthorizedException(&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_deserializeDocumentAccessPolicySummaries(v *[]types.AccessPolicySummary, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetIDs(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12191,20 +15665,22 @@ func awsRestjson1_deserializeDocumentAccessPolicySummaries(v *[]types.AccessPoli return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AccessPolicySummary + var cv []string if *v == nil { - cv = []types.AccessPolicySummary{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.AccessPolicySummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentAccessPolicySummary(&destAddr, value); err != nil { - return err + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + col = jtv } - col = *destAddr cv = append(cv, col) } @@ -12212,7 +15688,7 @@ func awsRestjson1_deserializeDocumentAccessPolicySummaries(v *[]types.AccessPoli return nil } -func awsRestjson1_deserializeDocumentAccessPolicySummary(v **types.AccessPolicySummary, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelCompositeModel(v **types.AssetModelCompositeModel, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12225,73 +15701,146 @@ func awsRestjson1_deserializeDocumentAccessPolicySummary(v **types.AccessPolicyS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessPolicySummary + var sv *types.AssetModelCompositeModel if *v == nil { - sv = &types.AccessPolicySummary{} + sv = &types.AssetModelCompositeModel{} } else { sv = *v } for key, value := range shape { switch key { - case "creationDate": + case "description": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } + sv.ExternalId = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected CustomID to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } - case "identity": - if err := awsRestjson1_deserializeDocumentIdentity(&sv.Identity, value); err != nil { + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "properties": + if err := awsRestjson1_deserializeDocumentAssetModelProperties(&sv.Properties, value); err != nil { return err } - case "lastUpdateDate": + case "type": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } + sv.Type = ptr.String(jtv) } - case "permission": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAssetModelCompositeModelPath(v *[]types.AssetModelCompositeModelPathSegment, 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.AssetModelCompositeModelPathSegment + if *v == nil { + cv = []types.AssetModelCompositeModelPathSegment{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetModelCompositeModelPathSegment + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModelPathSegment(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssetModelCompositeModelPathSegment(v **types.AssetModelCompositeModelPathSegment, 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.AssetModelCompositeModelPathSegment + if *v == nil { + sv = &types.AssetModelCompositeModelPathSegment{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Permission to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.Permission = types.Permission(jtv) + sv.Id = ptr.String(jtv) } - case "resource": - if err := awsRestjson1_deserializeDocumentResource(&sv.Resource, value); err != nil { - return err + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) } default: @@ -12303,7 +15852,7 @@ func awsRestjson1_deserializeDocumentAccessPolicySummary(v **types.AccessPolicyS return nil } -func awsRestjson1_deserializeDocumentAggregatedValue(v **types.AggregatedValue, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelCompositeModels(v *[]types.AssetModelCompositeModel, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12311,60 +15860,33 @@ func awsRestjson1_deserializeDocumentAggregatedValue(v **types.AggregatedValue, return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AggregatedValue + var cv []types.AssetModelCompositeModel if *v == nil { - sv = &types.AggregatedValue{} + cv = []types.AssetModelCompositeModel{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "quality": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Quality to be of type string, got %T instead", value) - } - sv.Quality = types.Quality(jtv) - } - - case "timestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "value": - if err := awsRestjson1_deserializeDocumentAggregates(&sv.Value, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.AssetModelCompositeModel + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModel(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAggregatedValues(v *[]types.AggregatedValue, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelCompositeModelSummaries(v *[]types.AssetModelCompositeModelSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12377,17 +15899,17 @@ func awsRestjson1_deserializeDocumentAggregatedValues(v *[]types.AggregatedValue return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AggregatedValue + var cv []types.AssetModelCompositeModelSummary if *v == nil { - cv = []types.AggregatedValue{} + cv = []types.AssetModelCompositeModelSummary{} } else { cv = *v } for _, value := range shape { - var col types.AggregatedValue + var col types.AssetModelCompositeModelSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentAggregatedValue(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModelSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -12398,7 +15920,7 @@ func awsRestjson1_deserializeDocumentAggregatedValues(v *[]types.AggregatedValue return nil } -func awsRestjson1_deserializeDocumentAggregates(v **types.Aggregates, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelCompositeModelSummary(v **types.AssetModelCompositeModelSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12411,217 +15933,63 @@ func awsRestjson1_deserializeDocumentAggregates(v **types.Aggregates, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Aggregates + var sv *types.AssetModelCompositeModelSummary if *v == nil { - sv = &types.Aggregates{} + sv = &types.AssetModelCompositeModelSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "average": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Average = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.Average = ptr.Float64(f64) - - default: - return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) - - } - } - - case "count": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Count = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.Count = ptr.Float64(f64) - - default: - return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) - - } - } - - case "maximum": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Maximum = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.Maximum = ptr.Float64(f64) - - default: - return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) - - } - } - - case "minimum": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Minimum = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.Minimum = ptr.Float64(f64) - - default: - return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) - - } - } - - case "standardDeviation": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.StandardDeviation = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.StandardDeviation = ptr.Float64(f64) - - default: - return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) - - } - } - - case "sum": + case "description": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Sum = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) + } - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } - } - sv.Sum = ptr.Float64(f64) + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } - default: - return fmt.Errorf("expected AggregatedDoubleValue to be a JSON Number, got %T instead", value) + case "path": + if err := awsRestjson1_deserializeDocumentAssetModelCompositeModelPath(&sv.Path, value); err != nil { + return err + } + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } + sv.Type = ptr.String(jtv) } default: @@ -12633,7 +16001,41 @@ func awsRestjson1_deserializeDocumentAggregates(v **types.Aggregates, value inte return nil } -func awsRestjson1_deserializeDocumentAlarms(v **types.Alarms, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelHierarchies(v *[]types.AssetModelHierarchy, 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.AssetModelHierarchy + if *v == nil { + cv = []types.AssetModelHierarchy{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetModelHierarchy + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetModelHierarchy(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssetModelHierarchy(v **types.AssetModelHierarchy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12646,31 +16048,49 @@ func awsRestjson1_deserializeDocumentAlarms(v **types.Alarms, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Alarms + var sv *types.AssetModelHierarchy if *v == nil { - sv = &types.Alarms{} + sv = &types.AssetModelHierarchy{} } else { sv = *v } for key, value := range shape { switch key { - case "alarmRoleArn": + case "childAssetModelId": 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 CustomID to be of type string, got %T instead", value) } - sv.AlarmRoleArn = ptr.String(jtv) + sv.ChildAssetModelId = ptr.String(jtv) } - case "notificationLambdaArn": + case "externalId": 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 ExternalId to be of type string, got %T instead", value) } - sv.NotificationLambdaArn = ptr.String(jtv) + sv.ExternalId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) } default: @@ -12682,7 +16102,41 @@ func awsRestjson1_deserializeDocumentAlarms(v **types.Alarms, value interface{}) return nil } -func awsRestjson1_deserializeDocumentAssetCompositeModel(v **types.AssetCompositeModel, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelProperties(v *[]types.AssetModelProperty, 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.AssetModelProperty + if *v == nil { + cv = []types.AssetModelProperty{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetModelProperty + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetModelProperty(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssetModelProperty(v **types.AssetModelProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12695,29 +16149,47 @@ func awsRestjson1_deserializeDocumentAssetCompositeModel(v **types.AssetComposit return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetCompositeModel + var sv *types.AssetModelProperty if *v == nil { - sv = &types.AssetCompositeModel{} + sv = &types.AssetModelProperty{} } else { sv = *v } for key, value := range shape { switch key { - case "description": + case "dataType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected PropertyDataType to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.DataType = types.PropertyDataType(jtv) + } + + case "dataTypeSpec": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.DataTypeSpec = ptr.String(jtv) + } + + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) } case "id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected CustomID to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -12731,18 +16203,23 @@ func awsRestjson1_deserializeDocumentAssetCompositeModel(v **types.AssetComposit sv.Name = ptr.String(jtv) } - case "properties": - if err := awsRestjson1_deserializeDocumentAssetProperties(&sv.Properties, value); err != nil { + case "path": + if err := awsRestjson1_deserializeDocumentAssetModelPropertyPath(&sv.Path, value); err != nil { return err } case "type": + if err := awsRestjson1_deserializeDocumentPropertyType(&sv.Type, value); err != nil { + return err + } + + case "unit": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected PropertyUnit to be of type string, got %T instead", value) } - sv.Type = ptr.String(jtv) + sv.Unit = ptr.String(jtv) } default: @@ -12754,7 +16231,7 @@ func awsRestjson1_deserializeDocumentAssetCompositeModel(v **types.AssetComposit return nil } -func awsRestjson1_deserializeDocumentAssetCompositeModels(v *[]types.AssetCompositeModel, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelPropertyPath(v *[]types.AssetModelPropertyPathSegment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12767,17 +16244,17 @@ func awsRestjson1_deserializeDocumentAssetCompositeModels(v *[]types.AssetCompos return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetCompositeModel + var cv []types.AssetModelPropertyPathSegment if *v == nil { - cv = []types.AssetCompositeModel{} + cv = []types.AssetModelPropertyPathSegment{} } else { cv = *v } for _, value := range shape { - var col types.AssetCompositeModel + var col types.AssetModelPropertyPathSegment destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetCompositeModel(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetModelPropertyPathSegment(&destAddr, value); err != nil { return err } col = *destAddr @@ -12788,7 +16265,7 @@ func awsRestjson1_deserializeDocumentAssetCompositeModels(v *[]types.AssetCompos return nil } -func awsRestjson1_deserializeDocumentAssetErrorDetails(v **types.AssetErrorDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelPropertyPathSegment(v **types.AssetModelPropertyPathSegment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12801,40 +16278,31 @@ func awsRestjson1_deserializeDocumentAssetErrorDetails(v **types.AssetErrorDetai return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetErrorDetails + var sv *types.AssetModelPropertyPathSegment if *v == nil { - sv = &types.AssetErrorDetails{} + sv = &types.AssetModelPropertyPathSegment{} } else { sv = *v } for key, value := range shape { switch key { - case "assetId": + case "id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.AssetId = ptr.String(jtv) - } - - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AssetErrorCode to be of type string, got %T instead", value) - } - sv.Code = types.AssetErrorCode(jtv) + sv.Id = ptr.String(jtv) } - case "message": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssetErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Name = ptr.String(jtv) } default: @@ -12846,7 +16314,7 @@ func awsRestjson1_deserializeDocumentAssetErrorDetails(v **types.AssetErrorDetai return nil } -func awsRestjson1_deserializeDocumentAssetHierarchies(v *[]types.AssetHierarchy, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelPropertySummaries(v *[]types.AssetModelPropertySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12859,17 +16327,17 @@ func awsRestjson1_deserializeDocumentAssetHierarchies(v *[]types.AssetHierarchy, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetHierarchy + var cv []types.AssetModelPropertySummary if *v == nil { - cv = []types.AssetHierarchy{} + cv = []types.AssetModelPropertySummary{} } else { cv = *v } for _, value := range shape { - var col types.AssetHierarchy + var col types.AssetModelPropertySummary destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetHierarchy(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetModelPropertySummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -12880,7 +16348,7 @@ func awsRestjson1_deserializeDocumentAssetHierarchies(v *[]types.AssetHierarchy, return nil } -func awsRestjson1_deserializeDocumentAssetHierarchy(v **types.AssetHierarchy, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelPropertySummary(v **types.AssetModelPropertySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12893,15 +16361,51 @@ func awsRestjson1_deserializeDocumentAssetHierarchy(v **types.AssetHierarchy, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetHierarchy + var sv *types.AssetModelPropertySummary if *v == nil { - sv = &types.AssetHierarchy{} + sv = &types.AssetModelPropertySummary{} } else { sv = *v } - for key, value := range shape { - switch key { + for key, value := range shape { + switch key { + case "assetModelCompositeModelId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.AssetModelCompositeModelId = ptr.String(jtv) + } + + case "dataType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PropertyDataType to be of type string, got %T instead", value) + } + sv.DataType = types.PropertyDataType(jtv) + } + + case "dataTypeSpec": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.DataTypeSpec = ptr.String(jtv) + } + + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) + } + case "id": if value != nil { jtv, ok := value.(string) @@ -12920,6 +16424,25 @@ func awsRestjson1_deserializeDocumentAssetHierarchy(v **types.AssetHierarchy, va sv.Name = ptr.String(jtv) } + case "path": + if err := awsRestjson1_deserializeDocumentAssetModelPropertyPath(&sv.Path, value); err != nil { + return err + } + + case "type": + if err := awsRestjson1_deserializeDocumentPropertyType(&sv.Type, value); err != nil { + return err + } + + case "unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PropertyUnit to be of type string, got %T instead", value) + } + sv.Unit = ptr.String(jtv) + } + default: _, _ = key, value @@ -12929,7 +16452,7 @@ func awsRestjson1_deserializeDocumentAssetHierarchy(v **types.AssetHierarchy, va return nil } -func awsRestjson1_deserializeDocumentAssetHierarchyInfo(v **types.AssetHierarchyInfo, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelStatus(v **types.AssetModelStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12942,31 +16465,27 @@ func awsRestjson1_deserializeDocumentAssetHierarchyInfo(v **types.AssetHierarchy return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetHierarchyInfo + var sv *types.AssetModelStatus if *v == nil { - sv = &types.AssetHierarchyInfo{} + sv = &types.AssetModelStatus{} } else { sv = *v } for key, value := range shape { switch key { - case "childAssetId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) - } - sv.ChildAssetId = ptr.String(jtv) + case "error": + if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.Error, value); err != nil { + return err } - case "parentAssetId": + case "state": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected AssetModelState to be of type string, got %T instead", value) } - sv.ParentAssetId = ptr.String(jtv) + sv.State = types.AssetModelState(jtv) } default: @@ -12978,7 +16497,7 @@ func awsRestjson1_deserializeDocumentAssetHierarchyInfo(v **types.AssetHierarchy return nil } -func awsRestjson1_deserializeDocumentAssetIDs(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelSummaries(v *[]types.AssetModelSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12991,22 +16510,20 @@ func awsRestjson1_deserializeDocumentAssetIDs(v *[]string, value interface{}) er return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.AssetModelSummary if *v == nil { - cv = []string{} + cv = []types.AssetModelSummary{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) - } - col = jtv + var col types.AssetModelSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetModelSummary(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -13014,7 +16531,7 @@ func awsRestjson1_deserializeDocumentAssetIDs(v *[]string, value interface{}) er return nil } -func awsRestjson1_deserializeDocumentAssetModelCompositeModel(v **types.AssetModelCompositeModel, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetModelSummary(v **types.AssetModelSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13027,15 +16544,49 @@ func awsRestjson1_deserializeDocumentAssetModelCompositeModel(v **types.AssetMod return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetModelCompositeModel + var sv *types.AssetModelSummary if *v == nil { - sv = &types.AssetModelCompositeModel{} + sv = &types.AssetModelSummary{} } 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 "assetModelType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssetModelType to be of type string, got %T instead", value) + } + sv.AssetModelType = types.AssetModelType(jtv) + } + + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "description": if value != nil { jtv, ok := value.(string) @@ -13045,36 +16596,52 @@ func awsRestjson1_deserializeDocumentAssetModelCompositeModel(v **types.AssetMod sv.Description = ptr.String(jtv) } - case "id": + case "externalId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.ExternalId = ptr.String(jtv) } - case "name": + case "id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Id = ptr.String(jtv) } - case "properties": - if err := awsRestjson1_deserializeDocumentAssetModelProperties(&sv.Properties, value); err != nil { - return err + case "lastUpdateDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } } - case "type": + case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.Type = ptr.String(jtv) + sv.Name = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentAssetModelStatus(&sv.Status, value); err != nil { + return err } default: @@ -13086,41 +16653,7 @@ func awsRestjson1_deserializeDocumentAssetModelCompositeModel(v **types.AssetMod return nil } -func awsRestjson1_deserializeDocumentAssetModelCompositeModels(v *[]types.AssetModelCompositeModel, 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.AssetModelCompositeModel - if *v == nil { - cv = []types.AssetModelCompositeModel{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AssetModelCompositeModel - destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetModelCompositeModel(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAssetModelHierarchies(v *[]types.AssetModelHierarchy, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetProperties(v *[]types.AssetProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13133,17 +16666,17 @@ func awsRestjson1_deserializeDocumentAssetModelHierarchies(v *[]types.AssetModel return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetModelHierarchy + var cv []types.AssetProperty if *v == nil { - cv = []types.AssetModelHierarchy{} + cv = []types.AssetProperty{} } else { cv = *v } for _, value := range shape { - var col types.AssetModelHierarchy + var col types.AssetProperty destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetModelHierarchy(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetProperty(&destAddr, value); err != nil { return err } col = *destAddr @@ -13154,7 +16687,7 @@ func awsRestjson1_deserializeDocumentAssetModelHierarchies(v *[]types.AssetModel return nil } -func awsRestjson1_deserializeDocumentAssetModelHierarchy(v **types.AssetModelHierarchy, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetProperty(v **types.AssetProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13167,22 +16700,49 @@ func awsRestjson1_deserializeDocumentAssetModelHierarchy(v **types.AssetModelHie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetModelHierarchy + var sv *types.AssetProperty if *v == nil { - sv = &types.AssetModelHierarchy{} + sv = &types.AssetProperty{} } else { sv = *v } for key, value := range shape { switch key { - case "childAssetModelId": + case "alias": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected PropertyAlias to be of type string, got %T instead", value) } - sv.ChildAssetModelId = ptr.String(jtv) + sv.Alias = ptr.String(jtv) + } + + case "dataType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PropertyDataType to be of type string, got %T instead", value) + } + sv.DataType = types.PropertyDataType(jtv) + } + + case "dataTypeSpec": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.DataTypeSpec = ptr.String(jtv) + } + + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) } case "id": @@ -13203,6 +16763,25 @@ func awsRestjson1_deserializeDocumentAssetModelHierarchy(v **types.AssetModelHie sv.Name = ptr.String(jtv) } + case "notification": + if err := awsRestjson1_deserializeDocumentPropertyNotification(&sv.Notification, value); err != nil { + return err + } + + case "path": + if err := awsRestjson1_deserializeDocumentAssetPropertyPath(&sv.Path, value); err != nil { + return err + } + + case "unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PropertyUnit to be of type string, got %T instead", value) + } + sv.Unit = ptr.String(jtv) + } + default: _, _ = key, value @@ -13212,7 +16791,7 @@ func awsRestjson1_deserializeDocumentAssetModelHierarchy(v **types.AssetModelHie return nil } -func awsRestjson1_deserializeDocumentAssetModelProperties(v *[]types.AssetModelProperty, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetPropertyPath(v *[]types.AssetPropertyPathSegment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13225,17 +16804,17 @@ func awsRestjson1_deserializeDocumentAssetModelProperties(v *[]types.AssetModelP return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetModelProperty + var cv []types.AssetPropertyPathSegment if *v == nil { - cv = []types.AssetModelProperty{} + cv = []types.AssetPropertyPathSegment{} } else { cv = *v } for _, value := range shape { - var col types.AssetModelProperty + var col types.AssetPropertyPathSegment destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetModelProperty(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetPropertyPathSegment(&destAddr, value); err != nil { return err } col = *destAddr @@ -13246,7 +16825,7 @@ func awsRestjson1_deserializeDocumentAssetModelProperties(v *[]types.AssetModelP return nil } -func awsRestjson1_deserializeDocumentAssetModelProperty(v **types.AssetModelProperty, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetPropertyPathSegment(v **types.AssetPropertyPathSegment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13259,33 +16838,15 @@ func awsRestjson1_deserializeDocumentAssetModelProperty(v **types.AssetModelProp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetModelProperty + var sv *types.AssetPropertyPathSegment if *v == nil { - sv = &types.AssetModelProperty{} + sv = &types.AssetPropertyPathSegment{} } else { sv = *v } for key, value := range shape { - switch key { - case "dataType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PropertyDataType to be of type string, got %T instead", value) - } - sv.DataType = types.PropertyDataType(jtv) - } - - case "dataTypeSpec": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.DataTypeSpec = ptr.String(jtv) - } - + switch key { case "id": if value != nil { jtv, ok := value.(string) @@ -13304,20 +16865,6 @@ func awsRestjson1_deserializeDocumentAssetModelProperty(v **types.AssetModelProp sv.Name = ptr.String(jtv) } - case "type": - if err := awsRestjson1_deserializeDocumentPropertyType(&sv.Type, value); err != nil { - return err - } - - case "unit": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PropertyUnit to be of type string, got %T instead", value) - } - sv.Unit = ptr.String(jtv) - } - default: _, _ = key, value @@ -13327,7 +16874,7 @@ func awsRestjson1_deserializeDocumentAssetModelProperty(v **types.AssetModelProp return nil } -func awsRestjson1_deserializeDocumentAssetModelPropertySummaries(v *[]types.AssetModelPropertySummary, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetPropertySummaries(v *[]types.AssetPropertySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13340,17 +16887,17 @@ func awsRestjson1_deserializeDocumentAssetModelPropertySummaries(v *[]types.Asse return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetModelPropertySummary + var cv []types.AssetPropertySummary if *v == nil { - cv = []types.AssetModelPropertySummary{} + cv = []types.AssetPropertySummary{} } else { cv = *v } for _, value := range shape { - var col types.AssetModelPropertySummary + var col types.AssetPropertySummary destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetModelPropertySummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetPropertySummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -13361,7 +16908,7 @@ func awsRestjson1_deserializeDocumentAssetModelPropertySummaries(v *[]types.Asse return nil } -func awsRestjson1_deserializeDocumentAssetModelPropertySummary(v **types.AssetModelPropertySummary, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetPropertySummary(v **types.AssetPropertySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13374,40 +16921,40 @@ func awsRestjson1_deserializeDocumentAssetModelPropertySummary(v **types.AssetMo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetModelPropertySummary + var sv *types.AssetPropertySummary if *v == nil { - sv = &types.AssetModelPropertySummary{} + sv = &types.AssetPropertySummary{} } else { sv = *v } for key, value := range shape { switch key { - case "assetModelCompositeModelId": + case "alias": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected PropertyAlias to be of type string, got %T instead", value) } - sv.AssetModelCompositeModelId = ptr.String(jtv) + sv.Alias = ptr.String(jtv) } - case "dataType": + case "assetCompositeModelId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PropertyDataType to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.DataType = types.PropertyDataType(jtv) + sv.AssetCompositeModelId = ptr.String(jtv) } - case "dataTypeSpec": + case "externalId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } - sv.DataTypeSpec = ptr.String(jtv) + sv.ExternalId = ptr.String(jtv) } case "id": @@ -13419,17 +16966,13 @@ func awsRestjson1_deserializeDocumentAssetModelPropertySummary(v **types.AssetMo sv.Id = ptr.String(jtv) } - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) + case "notification": + if err := awsRestjson1_deserializeDocumentPropertyNotification(&sv.Notification, value); err != nil { + return err } - case "type": - if err := awsRestjson1_deserializeDocumentPropertyType(&sv.Type, value); err != nil { + case "path": + if err := awsRestjson1_deserializeDocumentAssetPropertyPath(&sv.Path, value); err != nil { return err } @@ -13451,7 +16994,7 @@ func awsRestjson1_deserializeDocumentAssetModelPropertySummary(v **types.AssetMo return nil } -func awsRestjson1_deserializeDocumentAssetModelStatus(v **types.AssetModelStatus, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetPropertyValue(v **types.AssetPropertyValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13464,27 +17007,32 @@ func awsRestjson1_deserializeDocumentAssetModelStatus(v **types.AssetModelStatus return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetModelStatus + var sv *types.AssetPropertyValue if *v == nil { - sv = &types.AssetModelStatus{} + sv = &types.AssetPropertyValue{} } else { sv = *v } for key, value := range shape { switch key { - case "error": - if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.Error, value); err != nil { - return err - } - - case "state": + case "quality": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssetModelState to be of type string, got %T instead", value) + return fmt.Errorf("expected Quality to be of type string, got %T instead", value) } - sv.State = types.AssetModelState(jtv) + sv.Quality = types.Quality(jtv) + } + + case "timestamp": + if err := awsRestjson1_deserializeDocumentTimeInNanos(&sv.Timestamp, value); err != nil { + return err + } + + case "value": + if err := awsRestjson1_deserializeDocumentVariant(&sv.Value, value); err != nil { + return err } default: @@ -13496,7 +17044,7 @@ func awsRestjson1_deserializeDocumentAssetModelStatus(v **types.AssetModelStatus return nil } -func awsRestjson1_deserializeDocumentAssetModelSummaries(v *[]types.AssetModelSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetPropertyValueHistory(v *[]types.AssetPropertyValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13509,17 +17057,17 @@ func awsRestjson1_deserializeDocumentAssetModelSummaries(v *[]types.AssetModelSu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetModelSummary + var cv []types.AssetPropertyValue if *v == nil { - cv = []types.AssetModelSummary{} + cv = []types.AssetPropertyValue{} } else { cv = *v } for _, value := range shape { - var col types.AssetModelSummary + var col types.AssetPropertyValue destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetModelSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetPropertyValue(&destAddr, value); err != nil { return err } col = *destAddr @@ -13530,7 +17078,41 @@ func awsRestjson1_deserializeDocumentAssetModelSummaries(v *[]types.AssetModelSu return nil } -func awsRestjson1_deserializeDocumentAssetModelSummary(v **types.AssetModelSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetRelationshipSummaries(v *[]types.AssetRelationshipSummary, 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.AssetRelationshipSummary + if *v == nil { + cv = []types.AssetRelationshipSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AssetRelationshipSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAssetRelationshipSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAssetRelationshipSummary(v **types.AssetRelationshipSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13543,86 +17125,72 @@ func awsRestjson1_deserializeDocumentAssetModelSummary(v **types.AssetModelSumma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetModelSummary + var sv *types.AssetRelationshipSummary if *v == nil { - sv = &types.AssetModelSummary{} + sv = &types.AssetRelationshipSummary{} } 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 "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } + case "hierarchyInfo": + if err := awsRestjson1_deserializeDocumentAssetHierarchyInfo(&sv.HierarchyInfo, value); err != nil { + return err } - case "description": + case "relationshipType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected AssetRelationshipType to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.RelationshipType = types.AssetRelationshipType(jtv) } - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } + default: + _, _ = key, value - case "lastUpdateDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + } + *v = sv + return nil +} - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) +func awsRestjson1_deserializeDocumentAssetStatus(v **types.AssetStatus, 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.AssetStatus + if *v == nil { + sv = &types.AssetStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.Error, value); err != nil { + return err } - case "name": + case "state": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected AssetState to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) - } - - case "status": - if err := awsRestjson1_deserializeDocumentAssetModelStatus(&sv.Status, value); err != nil { - return err + sv.State = types.AssetState(jtv) } default: @@ -13634,7 +17202,7 @@ func awsRestjson1_deserializeDocumentAssetModelSummary(v **types.AssetModelSumma return nil } -func awsRestjson1_deserializeDocumentAssetProperties(v *[]types.AssetProperty, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetSummaries(v *[]types.AssetSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13647,17 +17215,17 @@ func awsRestjson1_deserializeDocumentAssetProperties(v *[]types.AssetProperty, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetProperty + var cv []types.AssetSummary if *v == nil { - cv = []types.AssetProperty{} + cv = []types.AssetSummary{} } else { cv = *v } for _, value := range shape { - var col types.AssetProperty + var col types.AssetSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetProperty(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -13668,7 +17236,7 @@ func awsRestjson1_deserializeDocumentAssetProperties(v *[]types.AssetProperty, v return nil } -func awsRestjson1_deserializeDocumentAssetProperty(v **types.AssetProperty, value interface{}) error { +func awsRestjson1_deserializeDocumentAssetSummary(v **types.AssetSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13681,40 +17249,70 @@ func awsRestjson1_deserializeDocumentAssetProperty(v **types.AssetProperty, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetProperty + var sv *types.AssetSummary if *v == nil { - sv = &types.AssetProperty{} + sv = &types.AssetSummary{} } else { sv = *v } - for key, value := range shape { - switch key { - case "alias": + 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 "assetModelId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PropertyAlias to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.Alias = ptr.String(jtv) + sv.AssetModelId = ptr.String(jtv) } - case "dataType": + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PropertyDataType to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.DataType = types.PropertyDataType(jtv) + sv.Description = ptr.String(jtv) } - case "dataTypeSpec": + case "externalId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } - sv.DataTypeSpec = ptr.String(jtv) + sv.ExternalId = ptr.String(jtv) + } + + case "hierarchies": + if err := awsRestjson1_deserializeDocumentAssetHierarchies(&sv.Hierarchies, value); err != nil { + return err } case "id": @@ -13726,6 +17324,22 @@ func awsRestjson1_deserializeDocumentAssetProperty(v **types.AssetProperty, valu sv.Id = ptr.String(jtv) } + case "lastUpdateDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "name": if value != nil { jtv, ok := value.(string) @@ -13735,20 +17349,11 @@ func awsRestjson1_deserializeDocumentAssetProperty(v **types.AssetProperty, valu sv.Name = ptr.String(jtv) } - case "notification": - if err := awsRestjson1_deserializeDocumentPropertyNotification(&sv.Notification, value); err != nil { + case "status": + if err := awsRestjson1_deserializeDocumentAssetStatus(&sv.Status, value); err != nil { return err } - case "unit": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PropertyUnit to be of type string, got %T instead", value) - } - sv.Unit = ptr.String(jtv) - } - default: _, _ = key, value @@ -13758,7 +17363,7 @@ func awsRestjson1_deserializeDocumentAssetProperty(v **types.AssetProperty, valu return nil } -func awsRestjson1_deserializeDocumentAssetPropertySummaries(v *[]types.AssetPropertySummary, value interface{}) error { +func awsRestjson1_deserializeDocumentAssociatedAssetsSummaries(v *[]types.AssociatedAssetsSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13771,17 +17376,17 @@ func awsRestjson1_deserializeDocumentAssetPropertySummaries(v *[]types.AssetProp return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetPropertySummary + var cv []types.AssociatedAssetsSummary if *v == nil { - cv = []types.AssetPropertySummary{} + cv = []types.AssociatedAssetsSummary{} } else { cv = *v } for _, value := range shape { - var col types.AssetPropertySummary + var col types.AssociatedAssetsSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetPropertySummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssociatedAssetsSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -13792,7 +17397,7 @@ func awsRestjson1_deserializeDocumentAssetPropertySummaries(v *[]types.AssetProp return nil } -func awsRestjson1_deserializeDocumentAssetPropertySummary(v **types.AssetPropertySummary, value interface{}) error { +func awsRestjson1_deserializeDocumentAssociatedAssetsSummary(v **types.AssociatedAssetsSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13805,31 +17410,70 @@ func awsRestjson1_deserializeDocumentAssetPropertySummary(v **types.AssetPropert return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetPropertySummary + var sv *types.AssociatedAssetsSummary if *v == nil { - sv = &types.AssetPropertySummary{} + sv = &types.AssociatedAssetsSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "alias": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PropertyAlias to be of type string, got %T instead", value) + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.Alias = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "assetCompositeModelId": + case "assetModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.AssetCompositeModelId = ptr.String(jtv) + sv.AssetModelId = ptr.String(jtv) + } + + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) + } + + case "hierarchies": + if err := awsRestjson1_deserializeDocumentAssetHierarchies(&sv.Hierarchies, value); err != nil { + return err } case "id": @@ -13841,18 +17485,34 @@ func awsRestjson1_deserializeDocumentAssetPropertySummary(v **types.AssetPropert sv.Id = ptr.String(jtv) } - case "notification": - if err := awsRestjson1_deserializeDocumentPropertyNotification(&sv.Notification, value); err != nil { - return err + case "lastUpdateDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } } - case "unit": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PropertyUnit to be of type string, got %T instead", value) + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.Unit = ptr.String(jtv) + sv.Name = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentAssetStatus(&sv.Status, value); err != nil { + return err } default: @@ -13864,7 +17524,7 @@ func awsRestjson1_deserializeDocumentAssetPropertySummary(v **types.AssetPropert return nil } -func awsRestjson1_deserializeDocumentAssetPropertyValue(v **types.AssetPropertyValue, value interface{}) error { +func awsRestjson1_deserializeDocumentAttribute(v **types.Attribute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13877,32 +17537,22 @@ func awsRestjson1_deserializeDocumentAssetPropertyValue(v **types.AssetPropertyV return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetPropertyValue + var sv *types.Attribute if *v == nil { - sv = &types.AssetPropertyValue{} + sv = &types.Attribute{} } else { sv = *v } for key, value := range shape { switch key { - case "quality": + case "defaultValue": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Quality to be of type string, got %T instead", value) + return fmt.Errorf("expected DefaultValue to be of type string, got %T instead", value) } - sv.Quality = types.Quality(jtv) - } - - case "timestamp": - if err := awsRestjson1_deserializeDocumentTimeInNanos(&sv.Timestamp, value); err != nil { - return err - } - - case "value": - if err := awsRestjson1_deserializeDocumentVariant(&sv.Value, value); err != nil { - return err + sv.DefaultValue = ptr.String(jtv) } default: @@ -13914,7 +17564,7 @@ func awsRestjson1_deserializeDocumentAssetPropertyValue(v **types.AssetPropertyV return nil } -func awsRestjson1_deserializeDocumentAssetPropertyValueHistory(v *[]types.AssetPropertyValue, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchAssociateProjectAssetsErrors(v *[]types.AssetErrorDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13927,17 +17577,17 @@ func awsRestjson1_deserializeDocumentAssetPropertyValueHistory(v *[]types.AssetP return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetPropertyValue + var cv []types.AssetErrorDetails if *v == nil { - cv = []types.AssetPropertyValue{} + cv = []types.AssetErrorDetails{} } else { cv = *v } for _, value := range shape { - var col types.AssetPropertyValue + var col types.AssetErrorDetails destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetPropertyValue(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetErrorDetails(&destAddr, value); err != nil { return err } col = *destAddr @@ -13948,7 +17598,7 @@ func awsRestjson1_deserializeDocumentAssetPropertyValueHistory(v *[]types.AssetP return nil } -func awsRestjson1_deserializeDocumentAssetRelationshipSummaries(v *[]types.AssetRelationshipSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchDisassociateProjectAssetsErrors(v *[]types.AssetErrorDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13961,17 +17611,17 @@ func awsRestjson1_deserializeDocumentAssetRelationshipSummaries(v *[]types.Asset return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetRelationshipSummary + var cv []types.AssetErrorDetails if *v == nil { - cv = []types.AssetRelationshipSummary{} + cv = []types.AssetErrorDetails{} } else { cv = *v } for _, value := range shape { - var col types.AssetRelationshipSummary + var col types.AssetErrorDetails destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetRelationshipSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAssetErrorDetails(&destAddr, value); err != nil { return err } col = *destAddr @@ -13982,7 +17632,41 @@ func awsRestjson1_deserializeDocumentAssetRelationshipSummaries(v *[]types.Asset return nil } -func awsRestjson1_deserializeDocumentAssetRelationshipSummary(v **types.AssetRelationshipSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntries(v *[]types.BatchGetAssetPropertyAggregatesErrorEntry, 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.BatchGetAssetPropertyAggregatesErrorEntry + if *v == nil { + cv = []types.BatchGetAssetPropertyAggregatesErrorEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchGetAssetPropertyAggregatesErrorEntry + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntry(v **types.BatchGetAssetPropertyAggregatesErrorEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13995,27 +17679,40 @@ func awsRestjson1_deserializeDocumentAssetRelationshipSummary(v **types.AssetRel return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetRelationshipSummary + var sv *types.BatchGetAssetPropertyAggregatesErrorEntry if *v == nil { - sv = &types.AssetRelationshipSummary{} + sv = &types.BatchGetAssetPropertyAggregatesErrorEntry{} } else { sv = *v } for key, value := range shape { switch key { - case "hierarchyInfo": - if err := awsRestjson1_deserializeDocumentAssetHierarchyInfo(&sv.HierarchyInfo, value); err != nil { - return err + case "entryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) + } + sv.EntryId = ptr.String(jtv) + } + + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchGetAssetPropertyAggregatesErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.BatchGetAssetPropertyAggregatesErrorCode(jtv) } - case "relationshipType": + case "errorMessage": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssetRelationshipType to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.RelationshipType = types.AssetRelationshipType(jtv) + sv.ErrorMessage = ptr.String(jtv) } default: @@ -14027,7 +17724,7 @@ func awsRestjson1_deserializeDocumentAssetRelationshipSummary(v **types.AssetRel return nil } -func awsRestjson1_deserializeDocumentAssetStatus(v **types.AssetStatus, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorInfo(v **types.BatchGetAssetPropertyAggregatesErrorInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14040,27 +17737,38 @@ func awsRestjson1_deserializeDocumentAssetStatus(v **types.AssetStatus, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetStatus + var sv *types.BatchGetAssetPropertyAggregatesErrorInfo if *v == nil { - sv = &types.AssetStatus{} + sv = &types.BatchGetAssetPropertyAggregatesErrorInfo{} } else { sv = *v } for key, value := range shape { switch key { - case "error": - if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.Error, value); err != nil { - return err - } - - case "state": + case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AssetState to be of type string, got %T instead", value) + return fmt.Errorf("expected BatchGetAssetPropertyAggregatesErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.BatchGetAssetPropertyAggregatesErrorCode(jtv) + } + + case "errorTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ErrorTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.State = types.AssetState(jtv) } default: @@ -14072,7 +17780,7 @@ func awsRestjson1_deserializeDocumentAssetStatus(v **types.AssetStatus, value in return nil } -func awsRestjson1_deserializeDocumentAssetSummaries(v *[]types.AssetSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntries(v *[]types.BatchGetAssetPropertyAggregatesSkippedEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14085,17 +17793,17 @@ func awsRestjson1_deserializeDocumentAssetSummaries(v *[]types.AssetSummary, val return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssetSummary + var cv []types.BatchGetAssetPropertyAggregatesSkippedEntry if *v == nil { - cv = []types.AssetSummary{} + cv = []types.BatchGetAssetPropertyAggregatesSkippedEntry{} } else { cv = *v } for _, value := range shape { - var col types.AssetSummary + var col types.BatchGetAssetPropertyAggregatesSkippedEntry destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -14106,7 +17814,7 @@ func awsRestjson1_deserializeDocumentAssetSummaries(v *[]types.AssetSummary, val return nil } -func awsRestjson1_deserializeDocumentAssetSummary(v **types.AssetSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntry(v **types.BatchGetAssetPropertyAggregatesSkippedEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14119,99 +17827,35 @@ func awsRestjson1_deserializeDocumentAssetSummary(v **types.AssetSummary, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssetSummary + var sv *types.BatchGetAssetPropertyAggregatesSkippedEntry if *v == nil { - sv = &types.AssetSummary{} + sv = &types.BatchGetAssetPropertyAggregatesSkippedEntry{} } 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 "assetModelId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) - } - sv.AssetModelId = ptr.String(jtv) - } - - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "hierarchies": - if err := awsRestjson1_deserializeDocumentAssetHierarchies(&sv.Hierarchies, value); err != nil { - return err - } - - case "id": + case "completionStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "lastUpdateDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + return fmt.Errorf("expected BatchEntryCompletionStatus to be of type string, got %T instead", value) } + sv.CompletionStatus = types.BatchEntryCompletionStatus(jtv) } - case "name": + case "entryId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.EntryId = ptr.String(jtv) } - case "status": - if err := awsRestjson1_deserializeDocumentAssetStatus(&sv.Status, value); err != nil { + case "errorInfo": + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorInfo(&sv.ErrorInfo, value); err != nil { return err } @@ -14224,7 +17868,7 @@ func awsRestjson1_deserializeDocumentAssetSummary(v **types.AssetSummary, value return nil } -func awsRestjson1_deserializeDocumentAssociatedAssetsSummaries(v *[]types.AssociatedAssetsSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntries(v *[]types.BatchGetAssetPropertyAggregatesSuccessEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14237,17 +17881,17 @@ func awsRestjson1_deserializeDocumentAssociatedAssetsSummaries(v *[]types.Associ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AssociatedAssetsSummary + var cv []types.BatchGetAssetPropertyAggregatesSuccessEntry if *v == nil { - cv = []types.AssociatedAssetsSummary{} + cv = []types.BatchGetAssetPropertyAggregatesSuccessEntry{} } else { cv = *v } for _, value := range shape { - var col types.AssociatedAssetsSummary + var col types.BatchGetAssetPropertyAggregatesSuccessEntry destAddr := &col - if err := awsRestjson1_deserializeDocumentAssociatedAssetsSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -14258,7 +17902,7 @@ func awsRestjson1_deserializeDocumentAssociatedAssetsSummaries(v *[]types.Associ return nil } -func awsRestjson1_deserializeDocumentAssociatedAssetsSummary(v **types.AssociatedAssetsSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntry(v **types.BatchGetAssetPropertyAggregatesSuccessEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14271,112 +17915,73 @@ func awsRestjson1_deserializeDocumentAssociatedAssetsSummary(v **types.Associate return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssociatedAssetsSummary + var sv *types.BatchGetAssetPropertyAggregatesSuccessEntry if *v == nil { - sv = &types.AssociatedAssetsSummary{} + sv = &types.BatchGetAssetPropertyAggregatesSuccessEntry{} } 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 "assetModelId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) - } - sv.AssetModelId = ptr.String(jtv) - } - - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "hierarchies": - if err := awsRestjson1_deserializeDocumentAssetHierarchies(&sv.Hierarchies, value); err != nil { + case "aggregatedValues": + if err := awsRestjson1_deserializeDocumentAggregatedValues(&sv.AggregatedValues, value); err != nil { return err } - case "id": + case "entryId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ID to be of type string, got %T instead", value) + return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.EntryId = ptr.String(jtv) } - case "lastUpdateDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + default: + _, _ = key, value - } - } + } + } + *v = sv + return nil +} - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorEntries(v *[]types.BatchGetAssetPropertyValueErrorEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "status": - if err := awsRestjson1_deserializeDocumentAssetStatus(&sv.Status, value); err != nil { - return err - } + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - default: - _, _ = key, value + var cv []types.BatchGetAssetPropertyValueErrorEntry + if *v == nil { + cv = []types.BatchGetAssetPropertyValueErrorEntry{} + } else { + cv = *v + } + for _, value := range shape { + var col types.BatchGetAssetPropertyValueErrorEntry + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorEntry(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAttribute(v **types.Attribute, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorEntry(v **types.BatchGetAssetPropertyValueErrorEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14389,22 +17994,40 @@ func awsRestjson1_deserializeDocumentAttribute(v **types.Attribute, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Attribute + var sv *types.BatchGetAssetPropertyValueErrorEntry if *v == nil { - sv = &types.Attribute{} + sv = &types.BatchGetAssetPropertyValueErrorEntry{} } else { sv = *v } for key, value := range shape { switch key { - case "defaultValue": + case "entryId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DefaultValue to be of type string, got %T instead", value) + return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) } - sv.DefaultValue = ptr.String(jtv) + sv.EntryId = ptr.String(jtv) + } + + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchGetAssetPropertyValueErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.BatchGetAssetPropertyValueErrorCode(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) } default: @@ -14416,7 +18039,7 @@ func awsRestjson1_deserializeDocumentAttribute(v **types.Attribute, value interf return nil } -func awsRestjson1_deserializeDocumentBatchAssociateProjectAssetsErrors(v *[]types.AssetErrorDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorInfo(v **types.BatchGetAssetPropertyValueErrorInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14424,67 +18047,55 @@ func awsRestjson1_deserializeDocumentBatchAssociateProjectAssetsErrors(v *[]type 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.AssetErrorDetails + var sv *types.BatchGetAssetPropertyValueErrorInfo if *v == nil { - cv = []types.AssetErrorDetails{} + sv = &types.BatchGetAssetPropertyValueErrorInfo{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.AssetErrorDetails - destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetErrorDetails(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchGetAssetPropertyValueErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.BatchGetAssetPropertyValueErrorCode(jtv) + } - } - *v = cv - return nil -} + case "errorTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ErrorTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) -func awsRestjson1_deserializeDocumentBatchDisassociateProjectAssetsErrors(v *[]types.AssetErrorDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + } + } - var cv []types.AssetErrorDetails - if *v == nil { - cv = []types.AssetErrorDetails{} - } else { - cv = *v - } + default: + _, _ = key, value - for _, value := range shape { - var col types.AssetErrorDetails - destAddr := &col - if err := awsRestjson1_deserializeDocumentAssetErrorDetails(&destAddr, value); err != nil { - return err } - col = *destAddr - cv = append(cv, col) - } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntries(v *[]types.BatchGetAssetPropertyAggregatesErrorEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntries(v *[]types.BatchGetAssetPropertyValueHistoryErrorEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14497,17 +18108,17 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntries return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchGetAssetPropertyAggregatesErrorEntry + var cv []types.BatchGetAssetPropertyValueHistoryErrorEntry if *v == nil { - cv = []types.BatchGetAssetPropertyAggregatesErrorEntry{} + cv = []types.BatchGetAssetPropertyValueHistoryErrorEntry{} } else { cv = *v } for _, value := range shape { - var col types.BatchGetAssetPropertyAggregatesErrorEntry + var col types.BatchGetAssetPropertyValueHistoryErrorEntry destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntry(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -14518,7 +18129,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntries return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntry(v **types.BatchGetAssetPropertyAggregatesErrorEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntry(v **types.BatchGetAssetPropertyValueHistoryErrorEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14531,9 +18142,9 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntry(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyAggregatesErrorEntry + var sv *types.BatchGetAssetPropertyValueHistoryErrorEntry if *v == nil { - sv = &types.BatchGetAssetPropertyAggregatesErrorEntry{} + sv = &types.BatchGetAssetPropertyValueHistoryErrorEntry{} } else { sv = *v } @@ -14553,9 +18164,9 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntry(v if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BatchGetAssetPropertyAggregatesErrorCode to be of type string, got %T instead", value) + return fmt.Errorf("expected BatchGetAssetPropertyValueHistoryErrorCode to be of type string, got %T instead", value) } - sv.ErrorCode = types.BatchGetAssetPropertyAggregatesErrorCode(jtv) + sv.ErrorCode = types.BatchGetAssetPropertyValueHistoryErrorCode(jtv) } case "errorMessage": @@ -14576,7 +18187,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorEntry(v return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorInfo(v **types.BatchGetAssetPropertyAggregatesErrorInfo, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorInfo(v **types.BatchGetAssetPropertyValueHistoryErrorInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14589,9 +18200,9 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorInfo(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyAggregatesErrorInfo + var sv *types.BatchGetAssetPropertyValueHistoryErrorInfo if *v == nil { - sv = &types.BatchGetAssetPropertyAggregatesErrorInfo{} + sv = &types.BatchGetAssetPropertyValueHistoryErrorInfo{} } else { sv = *v } @@ -14602,9 +18213,9 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorInfo(v if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BatchGetAssetPropertyAggregatesErrorCode to be of type string, got %T instead", value) + return fmt.Errorf("expected BatchGetAssetPropertyValueHistoryErrorCode to be of type string, got %T instead", value) } - sv.ErrorCode = types.BatchGetAssetPropertyAggregatesErrorCode(jtv) + sv.ErrorCode = types.BatchGetAssetPropertyValueHistoryErrorCode(jtv) } case "errorTimestamp": @@ -14632,7 +18243,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorInfo(v return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntries(v *[]types.BatchGetAssetPropertyAggregatesSkippedEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEntries(v *[]types.BatchGetAssetPropertyValueHistorySkippedEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14645,17 +18256,17 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntri return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchGetAssetPropertyAggregatesSkippedEntry + var cv []types.BatchGetAssetPropertyValueHistorySkippedEntry if *v == nil { - cv = []types.BatchGetAssetPropertyAggregatesSkippedEntry{} + cv = []types.BatchGetAssetPropertyValueHistorySkippedEntry{} } else { cv = *v } for _, value := range shape { - var col types.BatchGetAssetPropertyAggregatesSkippedEntry + var col types.BatchGetAssetPropertyValueHistorySkippedEntry destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntry(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -14666,7 +18277,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntri return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntry(v **types.BatchGetAssetPropertyAggregatesSkippedEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEntry(v **types.BatchGetAssetPropertyValueHistorySkippedEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14679,9 +18290,9 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntry return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyAggregatesSkippedEntry + var sv *types.BatchGetAssetPropertyValueHistorySkippedEntry if *v == nil { - sv = &types.BatchGetAssetPropertyAggregatesSkippedEntry{} + sv = &types.BatchGetAssetPropertyValueHistorySkippedEntry{} } else { sv = *v } @@ -14707,7 +18318,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntry } case "errorInfo": - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesErrorInfo(&sv.ErrorInfo, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorInfo(&sv.ErrorInfo, value); err != nil { return err } @@ -14720,7 +18331,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSkippedEntry return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntries(v *[]types.BatchGetAssetPropertyAggregatesSuccessEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEntries(v *[]types.BatchGetAssetPropertyValueHistorySuccessEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14733,17 +18344,17 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntri return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchGetAssetPropertyAggregatesSuccessEntry + var cv []types.BatchGetAssetPropertyValueHistorySuccessEntry if *v == nil { - cv = []types.BatchGetAssetPropertyAggregatesSuccessEntry{} + cv = []types.BatchGetAssetPropertyValueHistorySuccessEntry{} } else { cv = *v } for _, value := range shape { - var col types.BatchGetAssetPropertyAggregatesSuccessEntry + var col types.BatchGetAssetPropertyValueHistorySuccessEntry destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntry(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -14754,7 +18365,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntri return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntry(v **types.BatchGetAssetPropertyAggregatesSuccessEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEntry(v **types.BatchGetAssetPropertyValueHistorySuccessEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14767,17 +18378,17 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntry return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyAggregatesSuccessEntry + var sv *types.BatchGetAssetPropertyValueHistorySuccessEntry if *v == nil { - sv = &types.BatchGetAssetPropertyAggregatesSuccessEntry{} + sv = &types.BatchGetAssetPropertyValueHistorySuccessEntry{} } else { sv = *v } for key, value := range shape { switch key { - case "aggregatedValues": - if err := awsRestjson1_deserializeDocumentAggregatedValues(&sv.AggregatedValues, value); err != nil { + case "assetPropertyValueHistory": + if err := awsRestjson1_deserializeDocumentAssetPropertyValueHistory(&sv.AssetPropertyValueHistory, value); err != nil { return err } @@ -14799,7 +18410,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyAggregatesSuccessEntry return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorEntries(v *[]types.BatchGetAssetPropertyValueErrorEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSkippedEntries(v *[]types.BatchGetAssetPropertyValueSkippedEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14812,86 +18423,28 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorEntries(v *[ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchGetAssetPropertyValueErrorEntry + var cv []types.BatchGetAssetPropertyValueSkippedEntry if *v == nil { - cv = []types.BatchGetAssetPropertyValueErrorEntry{} + cv = []types.BatchGetAssetPropertyValueSkippedEntry{} } else { cv = *v } for _, value := range shape { - var col types.BatchGetAssetPropertyValueErrorEntry + var col types.BatchGetAssetPropertyValueSkippedEntry destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorEntry(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorEntry(v **types.BatchGetAssetPropertyValueErrorEntry, 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.BatchGetAssetPropertyValueErrorEntry - if *v == nil { - sv = &types.BatchGetAssetPropertyValueErrorEntry{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "entryId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) - } - sv.EntryId = ptr.String(jtv) - } - - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BatchGetAssetPropertyValueErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = types.BatchGetAssetPropertyValueErrorCode(jtv) - } - - case "errorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - - default: - _, _ = key, value - + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSkippedEntry(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorInfo(v **types.BatchGetAssetPropertyValueErrorInfo, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSkippedEntry(v **types.BatchGetAssetPropertyValueSkippedEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14904,38 +18457,36 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorInfo(v **typ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyValueErrorInfo + var sv *types.BatchGetAssetPropertyValueSkippedEntry if *v == nil { - sv = &types.BatchGetAssetPropertyValueErrorInfo{} + sv = &types.BatchGetAssetPropertyValueSkippedEntry{} } else { sv = *v } for key, value := range shape { switch key { - case "errorCode": + case "completionStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BatchGetAssetPropertyValueErrorCode to be of type string, got %T instead", value) + return fmt.Errorf("expected BatchEntryCompletionStatus to be of type string, got %T instead", value) } - sv.ErrorCode = types.BatchGetAssetPropertyValueErrorCode(jtv) + sv.CompletionStatus = types.BatchEntryCompletionStatus(jtv) } - case "errorTimestamp": + case "entryId": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ErrorTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) } + sv.EntryId = ptr.String(jtv) + } + + case "errorInfo": + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorInfo(&sv.ErrorInfo, value); err != nil { + return err } default: @@ -14947,7 +18498,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorInfo(v **typ return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntries(v *[]types.BatchGetAssetPropertyValueHistoryErrorEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSuccessEntries(v *[]types.BatchGetAssetPropertyValueSuccessEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14960,17 +18511,17 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntri return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchGetAssetPropertyValueHistoryErrorEntry + var cv []types.BatchGetAssetPropertyValueSuccessEntry if *v == nil { - cv = []types.BatchGetAssetPropertyValueHistoryErrorEntry{} + cv = []types.BatchGetAssetPropertyValueSuccessEntry{} } else { cv = *v } for _, value := range shape { - var col types.BatchGetAssetPropertyValueHistoryErrorEntry + var col types.BatchGetAssetPropertyValueSuccessEntry destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntry(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSuccessEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -14981,7 +18532,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntri return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntry(v **types.BatchGetAssetPropertyValueHistoryErrorEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSuccessEntry(v **types.BatchGetAssetPropertyValueSuccessEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14994,15 +18545,20 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntry return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyValueHistoryErrorEntry + var sv *types.BatchGetAssetPropertyValueSuccessEntry if *v == nil { - sv = &types.BatchGetAssetPropertyValueHistoryErrorEntry{} + sv = &types.BatchGetAssetPropertyValueSuccessEntry{} } else { sv = *v } for key, value := range shape { switch key { + case "assetPropertyValue": + if err := awsRestjson1_deserializeDocumentAssetPropertyValue(&sv.AssetPropertyValue, value); err != nil { + return err + } + case "entryId": if value != nil { jtv, ok := value.(string) @@ -15012,24 +18568,6 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntry sv.EntryId = ptr.String(jtv) } - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BatchGetAssetPropertyValueHistoryErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = types.BatchGetAssetPropertyValueHistoryErrorCode(jtv) - } - - case "errorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - default: _, _ = key, value @@ -15039,7 +18577,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorEntry return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorInfo(v **types.BatchGetAssetPropertyValueHistoryErrorInfo, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchPutAssetPropertyError(v **types.BatchPutAssetPropertyError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15052,9 +18590,9 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorInfo( return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyValueHistoryErrorInfo + var sv *types.BatchPutAssetPropertyError if *v == nil { - sv = &types.BatchGetAssetPropertyValueHistoryErrorInfo{} + sv = &types.BatchPutAssetPropertyError{} } else { sv = *v } @@ -15065,25 +18603,23 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorInfo( if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BatchGetAssetPropertyValueHistoryErrorCode to be of type string, got %T instead", value) + return fmt.Errorf("expected BatchPutAssetPropertyValueErrorCode to be of type string, got %T instead", value) } - sv.ErrorCode = types.BatchGetAssetPropertyValueHistoryErrorCode(jtv) + sv.ErrorCode = types.BatchPutAssetPropertyValueErrorCode(jtv) } - case "errorTimestamp": + case "errorMessage": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ErrorTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } + sv.ErrorMessage = ptr.String(jtv) + } + + case "timestamps": + if err := awsRestjson1_deserializeDocumentTimestamps(&sv.Timestamps, value); err != nil { + return err } default: @@ -15095,7 +18631,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorInfo( return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEntries(v *[]types.BatchGetAssetPropertyValueHistorySkippedEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntries(v *[]types.BatchPutAssetPropertyErrorEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15108,17 +18644,17 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEnt return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchGetAssetPropertyValueHistorySkippedEntry + var cv []types.BatchPutAssetPropertyErrorEntry if *v == nil { - cv = []types.BatchGetAssetPropertyValueHistorySkippedEntry{} + cv = []types.BatchPutAssetPropertyErrorEntry{} } else { cv = *v } for _, value := range shape { - var col types.BatchGetAssetPropertyValueHistorySkippedEntry + var col types.BatchPutAssetPropertyErrorEntry destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEntry(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -15129,7 +18665,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEnt return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEntry(v **types.BatchGetAssetPropertyValueHistorySkippedEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntry(v **types.BatchPutAssetPropertyErrorEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15142,24 +18678,15 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEnt return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyValueHistorySkippedEntry + var sv *types.BatchPutAssetPropertyErrorEntry if *v == nil { - sv = &types.BatchGetAssetPropertyValueHistorySkippedEntry{} + sv = &types.BatchPutAssetPropertyErrorEntry{} } else { sv = *v } for key, value := range shape { switch key { - case "completionStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BatchEntryCompletionStatus to be of type string, got %T instead", value) - } - sv.CompletionStatus = types.BatchEntryCompletionStatus(jtv) - } - case "entryId": if value != nil { jtv, ok := value.(string) @@ -15169,8 +18696,8 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEnt sv.EntryId = ptr.String(jtv) } - case "errorInfo": - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistoryErrorInfo(&sv.ErrorInfo, value); err != nil { + case "errors": + if err := awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrors(&sv.Errors, value); err != nil { return err } @@ -15183,7 +18710,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySkippedEnt return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEntries(v *[]types.BatchGetAssetPropertyValueHistorySuccessEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrors(v *[]types.BatchPutAssetPropertyError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15196,17 +18723,17 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEnt return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchGetAssetPropertyValueHistorySuccessEntry + var cv []types.BatchPutAssetPropertyError if *v == nil { - cv = []types.BatchGetAssetPropertyValueHistorySuccessEntry{} + cv = []types.BatchPutAssetPropertyError{} } else { cv = *v } for _, value := range shape { - var col types.BatchGetAssetPropertyValueHistorySuccessEntry + var col types.BatchPutAssetPropertyError destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEntry(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchPutAssetPropertyError(&destAddr, value); err != nil { return err } col = *destAddr @@ -15217,7 +18744,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEnt return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEntry(v **types.BatchGetAssetPropertyValueHistorySuccessEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentColumnInfo(v **types.ColumnInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15230,27 +18757,27 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEnt return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyValueHistorySuccessEntry + var sv *types.ColumnInfo if *v == nil { - sv = &types.BatchGetAssetPropertyValueHistorySuccessEntry{} + sv = &types.ColumnInfo{} } else { sv = *v } for key, value := range shape { switch key { - case "assetPropertyValueHistory": - if err := awsRestjson1_deserializeDocumentAssetPropertyValueHistory(&sv.AssetPropertyValueHistory, value); err != nil { - return err - } - - case "entryId": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.EntryId = ptr.String(jtv) + sv.Name = ptr.String(jtv) + } + + case "type": + if err := awsRestjson1_deserializeDocumentColumnType(&sv.Type, value); err != nil { + return err } default: @@ -15262,7 +18789,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueHistorySuccessEnt return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSkippedEntries(v *[]types.BatchGetAssetPropertyValueSkippedEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentColumnNames(v *[]types.ColumnName, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15275,20 +18802,22 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSkippedEntries(v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchGetAssetPropertyValueSkippedEntry + var cv []types.ColumnName if *v == nil { - cv = []types.BatchGetAssetPropertyValueSkippedEntry{} + cv = []types.ColumnName{} } else { cv = *v } for _, value := range shape { - var col types.BatchGetAssetPropertyValueSkippedEntry - destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSkippedEntry(&destAddr, value); err != nil { - return err + var col types.ColumnName + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + } + col = types.ColumnName(jtv) } - col = *destAddr cv = append(cv, col) } @@ -15296,7 +18825,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSkippedEntries(v return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSkippedEntry(v **types.BatchGetAssetPropertyValueSkippedEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentColumnsList(v *[]types.ColumnInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15304,53 +18833,33 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSkippedEntry(v ** return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyValueSkippedEntry + var cv []types.ColumnInfo if *v == nil { - sv = &types.BatchGetAssetPropertyValueSkippedEntry{} + cv = []types.ColumnInfo{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "completionStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BatchEntryCompletionStatus to be of type string, got %T instead", value) - } - sv.CompletionStatus = types.BatchEntryCompletionStatus(jtv) - } - - case "entryId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) - } - sv.EntryId = ptr.String(jtv) - } - - case "errorInfo": - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueErrorInfo(&sv.ErrorInfo, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.ColumnInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentColumnInfo(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSuccessEntries(v *[]types.BatchGetAssetPropertyValueSuccessEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentColumnType(v **types.ColumnType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15358,33 +18867,39 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSuccessEntries(v 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.BatchGetAssetPropertyValueSuccessEntry + var sv *types.ColumnType if *v == nil { - cv = []types.BatchGetAssetPropertyValueSuccessEntry{} + sv = &types.ColumnType{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.BatchGetAssetPropertyValueSuccessEntry - destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSuccessEntry(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "scalarType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScalarType to be of type string, got %T instead", value) + } + sv.ScalarType = types.ScalarType(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSuccessEntry(v **types.BatchGetAssetPropertyValueSuccessEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentCompositeModelProperty(v **types.CompositeModelProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15397,27 +18912,54 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSuccessEntry(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchGetAssetPropertyValueSuccessEntry + var sv *types.CompositeModelProperty if *v == nil { - sv = &types.BatchGetAssetPropertyValueSuccessEntry{} + sv = &types.CompositeModelProperty{} } else { sv = *v } for key, value := range shape { switch key { - case "assetPropertyValue": - if err := awsRestjson1_deserializeDocumentAssetPropertyValue(&sv.AssetPropertyValue, value); err != nil { + case "assetProperty": + if err := awsRestjson1_deserializeDocumentProperty(&sv.AssetProperty, value); err != nil { return err } - case "entryId": + case "externalId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) } - sv.EntryId = ptr.String(jtv) + sv.ExternalId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ID to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) } default: @@ -15429,7 +18971,7 @@ func awsRestjson1_deserializeDocumentBatchGetAssetPropertyValueSuccessEntry(v ** return nil } -func awsRestjson1_deserializeDocumentBatchPutAssetPropertyError(v **types.BatchPutAssetPropertyError, value interface{}) error { +func awsRestjson1_deserializeDocumentCompositionDetails(v **types.CompositionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15442,35 +18984,17 @@ func awsRestjson1_deserializeDocumentBatchPutAssetPropertyError(v **types.BatchP return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchPutAssetPropertyError + var sv *types.CompositionDetails if *v == nil { - sv = &types.BatchPutAssetPropertyError{} + sv = &types.CompositionDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BatchPutAssetPropertyValueErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = types.BatchPutAssetPropertyValueErrorCode(jtv) - } - - case "errorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - - case "timestamps": - if err := awsRestjson1_deserializeDocumentTimestamps(&sv.Timestamps, value); err != nil { + case "compositionRelationship": + if err := awsRestjson1_deserializeDocumentCompositionRelationship(&sv.CompositionRelationship, value); err != nil { return err } @@ -15483,7 +19007,7 @@ func awsRestjson1_deserializeDocumentBatchPutAssetPropertyError(v **types.BatchP return nil } -func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntries(v *[]types.BatchPutAssetPropertyErrorEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentCompositionRelationship(v *[]types.CompositionRelationshipItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15496,17 +19020,17 @@ func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntries(v *[]type return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchPutAssetPropertyErrorEntry + var cv []types.CompositionRelationshipItem if *v == nil { - cv = []types.BatchPutAssetPropertyErrorEntry{} + cv = []types.CompositionRelationshipItem{} } else { cv = *v } for _, value := range shape { - var col types.BatchPutAssetPropertyErrorEntry + var col types.CompositionRelationshipItem destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntry(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentCompositionRelationshipItem(&destAddr, value); err != nil { return err } col = *destAddr @@ -15517,7 +19041,7 @@ func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntries(v *[]type return nil } -func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntry(v **types.BatchPutAssetPropertyErrorEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentCompositionRelationshipItem(v **types.CompositionRelationshipItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15530,27 +19054,22 @@ func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntry(v **types.B return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchPutAssetPropertyErrorEntry + var sv *types.CompositionRelationshipItem if *v == nil { - sv = &types.BatchPutAssetPropertyErrorEntry{} + sv = &types.CompositionRelationshipItem{} } else { sv = *v } for key, value := range shape { switch key { - case "entryId": + case "id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EntryId to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.EntryId = ptr.String(jtv) - } - - case "errors": - if err := awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrors(&sv.Errors, value); err != nil { - return err + sv.Id = ptr.String(jtv) } default: @@ -15562,7 +19081,7 @@ func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrorEntry(v **types.B return nil } -func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrors(v *[]types.BatchPutAssetPropertyError, value interface{}) error { +func awsRestjson1_deserializeDocumentCompositionRelationshipSummaries(v *[]types.CompositionRelationshipSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15575,17 +19094,17 @@ func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrors(v *[]types.Batc return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchPutAssetPropertyError + var cv []types.CompositionRelationshipSummary if *v == nil { - cv = []types.BatchPutAssetPropertyError{} + cv = []types.CompositionRelationshipSummary{} } else { cv = *v } for _, value := range shape { - var col types.BatchPutAssetPropertyError + var col types.CompositionRelationshipSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchPutAssetPropertyError(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentCompositionRelationshipSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -15596,43 +19115,7 @@ func awsRestjson1_deserializeDocumentBatchPutAssetPropertyErrors(v *[]types.Batc return nil } -func awsRestjson1_deserializeDocumentColumnNames(v *[]types.ColumnName, 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.ColumnName - if *v == nil { - cv = []types.ColumnName{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ColumnName - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) - } - col = types.ColumnName(jtv) - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentCompositeModelProperty(v **types.CompositeModelProperty, value interface{}) error { +func awsRestjson1_deserializeDocumentCompositionRelationshipSummary(v **types.CompositionRelationshipSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15645,45 +19128,40 @@ func awsRestjson1_deserializeDocumentCompositeModelProperty(v **types.CompositeM return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CompositeModelProperty + var sv *types.CompositionRelationshipSummary if *v == nil { - sv = &types.CompositeModelProperty{} + sv = &types.CompositionRelationshipSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "assetProperty": - if err := awsRestjson1_deserializeDocumentProperty(&sv.AssetProperty, value); err != nil { - return err - } - - case "id": + case "assetModelCompositeModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.AssetModelCompositeModelId = ptr.String(jtv) } - case "name": + case "assetModelCompositeModelType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.AssetModelCompositeModelType = ptr.String(jtv) } - case "type": + case "assetModelId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected ID to be of type string, got %T instead", value) } - sv.Type = ptr.String(jtv) + sv.AssetModelId = ptr.String(jtv) } default: @@ -16056,6 +19534,99 @@ func awsRestjson1_deserializeDocumentDashboardSummary(v **types.DashboardSummary return nil } +func awsRestjson1_deserializeDocumentDatum(v **types.Datum, 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.Datum + if *v == nil { + sv = &types.Datum{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arrayValue": + if err := awsRestjson1_deserializeDocumentDatumList(&sv.ArrayValue, value); err != nil { + return err + } + + case "nullValue": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.NullValue = ptr.Bool(jtv) + } + + case "rowValue": + if err := awsRestjson1_deserializeDocumentRow(&sv.RowValue, value); err != nil { + return err + } + + case "scalarValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScalarValue to be of type string, got %T instead", value) + } + sv.ScalarValue = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDatumList(v *[]types.Datum, 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.Datum + if *v == nil { + cv = []types.Datum{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Datum + destAddr := &col + if err := awsRestjson1_deserializeDocumentDatum(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentDetailedError(v **types.DetailedError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16406,6 +19977,11 @@ func awsRestjson1_deserializeDocumentFileFormat(v **types.FileFormat, value inte return err } + case "parquet": + if err := awsRestjson1_deserializeDocumentParquet(&sv.Parquet, value); err != nil { + return err + } + default: _, _ = key, value @@ -17635,13 +21211,49 @@ func awsRestjson1_deserializeDocumentMonitorErrorDetails(v **types.MonitorErrorD sv.Code = types.MonitorErrorCode(jtv) } - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MonitorErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MonitorErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMultiLayerStorage(v **types.MultiLayerStorage, 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.MultiLayerStorage + if *v == nil { + sv = &types.MultiLayerStorage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "customerManagedS3Storage": + if err := awsRestjson1_deserializeDocumentCustomerManagedS3Storage(&sv.CustomerManagedS3Storage, value); err != nil { + return err } default: @@ -17653,7 +21265,7 @@ func awsRestjson1_deserializeDocumentMonitorErrorDetails(v **types.MonitorErrorD return nil } -func awsRestjson1_deserializeDocumentMultiLayerStorage(v **types.MultiLayerStorage, value interface{}) error { +func awsRestjson1_deserializeDocumentParquet(v **types.Parquet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -17666,20 +21278,15 @@ func awsRestjson1_deserializeDocumentMultiLayerStorage(v **types.MultiLayerStora return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MultiLayerStorage + var sv *types.Parquet if *v == nil { - sv = &types.MultiLayerStorage{} + sv = &types.Parquet{} } else { sv = *v } for key, value := range shape { switch key { - case "customerManagedS3Storage": - if err := awsRestjson1_deserializeDocumentCustomerManagedS3Storage(&sv.CustomerManagedS3Storage, value); err != nil { - return err - } - default: _, _ = key, value @@ -18125,6 +21732,15 @@ func awsRestjson1_deserializeDocumentProperty(v **types.Property, value interfac sv.DataType = types.PropertyDataType(jtv) } + case "externalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value) + } + sv.ExternalId = ptr.String(jtv) + } + case "id": if value != nil { jtv, ok := value.(string) @@ -18148,6 +21764,11 @@ func awsRestjson1_deserializeDocumentProperty(v **types.Property, value interfac return err } + case "path": + if err := awsRestjson1_deserializeDocumentAssetPropertyPath(&sv.Path, value); err != nil { + return err + } + case "type": if err := awsRestjson1_deserializeDocumentPropertyType(&sv.Type, value); err != nil { return err @@ -18271,6 +21892,46 @@ func awsRestjson1_deserializeDocumentPropertyType(v **types.PropertyType, value return nil } +func awsRestjson1_deserializeDocumentQueryTimeoutException(v **types.QueryTimeoutException, 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.QueryTimeoutException + if *v == nil { + sv = &types.QueryTimeoutException{} + } 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 awsRestjson1_deserializeDocumentResource(v **types.Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18463,6 +22124,76 @@ func awsRestjson1_deserializeDocumentRetentionPeriod(v **types.RetentionPeriod, return nil } +func awsRestjson1_deserializeDocumentRow(v **types.Row, 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.Row + if *v == nil { + sv = &types.Row{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "data": + if err := awsRestjson1_deserializeDocumentDatumList(&sv.Data, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRows(v *[]types.Row, 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.Row + if *v == nil { + cv = []types.Row{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Row + destAddr := &col + if err := awsRestjson1_deserializeDocumentRow(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18539,6 +22270,46 @@ func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interfac return nil } +func awsRestjson1_deserializeDocumentTargetResource(v **types.TargetResource, 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.TargetResource + if *v == nil { + sv = &types.TargetResource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "assetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomID to be of type string, got %T instead", value) + } + sv.AssetId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19103,6 +22874,46 @@ func awsRestjson1_deserializeDocumentUserIdentity(v **types.UserIdentity, value return nil } +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, 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.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } 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 awsRestjson1_deserializeDocumentVariableValue(v **types.VariableValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19143,6 +22954,11 @@ func awsRestjson1_deserializeDocumentVariableValue(v **types.VariableValue, valu sv.PropertyId = ptr.String(jtv) } + case "propertyPath": + if err := awsRestjson1_deserializeDocumentAssetModelPropertyPath(&sv.PropertyPath, value); err != nil { + return err + } + default: _, _ = key, value @@ -19247,3 +23063,56 @@ func awsRestjson1_deserializeDocumentVariant(v **types.Variant, value interface{ *v = sv return nil } + +func awsRestjson1_deserializeDocumentWarmTierRetentionPeriod(v **types.WarmTierRetentionPeriod, 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.WarmTierRetentionPeriod + if *v == nil { + sv = &types.WarmTierRetentionPeriod{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "numberOfDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NumberOfDays to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfDays = ptr.Int32(int32(i64)) + } + + case "unlimited": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Unlimited to be of type *bool, got %T instead", value) + } + sv.Unlimited = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/iotsitewise/endpoints.go b/service/iotsitewise/endpoints.go index 3f52ddde3dc..ef281df7d4c 100644 --- a/service/iotsitewise/endpoints.go +++ b/service/iotsitewise/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://iotsitewise-fips.") diff --git a/service/iotsitewise/generated.json b/service/iotsitewise/generated.json index 35c7f18a0b8..6b1de3493d1 100644 --- a/service/iotsitewise/generated.json +++ b/service/iotsitewise/generated.json @@ -21,6 +21,7 @@ "api_op_CreateAccessPolicy.go", "api_op_CreateAsset.go", "api_op_CreateAssetModel.go", + "api_op_CreateAssetModelCompositeModel.go", "api_op_CreateBulkImportJob.go", "api_op_CreateDashboard.go", "api_op_CreateGateway.go", @@ -29,14 +30,18 @@ "api_op_DeleteAccessPolicy.go", "api_op_DeleteAsset.go", "api_op_DeleteAssetModel.go", + "api_op_DeleteAssetModelCompositeModel.go", "api_op_DeleteDashboard.go", "api_op_DeleteGateway.go", "api_op_DeletePortal.go", "api_op_DeleteProject.go", "api_op_DeleteTimeSeries.go", "api_op_DescribeAccessPolicy.go", + "api_op_DescribeAction.go", "api_op_DescribeAsset.go", + "api_op_DescribeAssetCompositeModel.go", "api_op_DescribeAssetModel.go", + "api_op_DescribeAssetModelCompositeModel.go", "api_op_DescribeAssetProperty.go", "api_op_DescribeBulkImportJob.go", "api_op_DescribeDashboard.go", @@ -50,11 +55,15 @@ "api_op_DescribeTimeSeries.go", "api_op_DisassociateAssets.go", "api_op_DisassociateTimeSeriesFromAssetProperty.go", + "api_op_ExecuteAction.go", + "api_op_ExecuteQuery.go", "api_op_GetAssetPropertyAggregates.go", "api_op_GetAssetPropertyValue.go", "api_op_GetAssetPropertyValueHistory.go", "api_op_GetInterpolatedAssetPropertyValues.go", "api_op_ListAccessPolicies.go", + "api_op_ListActions.go", + "api_op_ListAssetModelCompositeModels.go", "api_op_ListAssetModelProperties.go", "api_op_ListAssetModels.go", "api_op_ListAssetProperties.go", @@ -62,6 +71,7 @@ "api_op_ListAssets.go", "api_op_ListAssociatedAssets.go", "api_op_ListBulkImportJobs.go", + "api_op_ListCompositionRelationships.go", "api_op_ListDashboards.go", "api_op_ListGateways.go", "api_op_ListPortals.go", @@ -77,6 +87,7 @@ "api_op_UpdateAccessPolicy.go", "api_op_UpdateAsset.go", "api_op_UpdateAssetModel.go", + "api_op_UpdateAssetModelCompositeModel.go", "api_op_UpdateAssetProperty.go", "api_op_UpdateDashboard.go", "api_op_UpdateGateway.go", diff --git a/service/iotsitewise/serializers.go b/service/iotsitewise/serializers.go index 36ac754b738..b4645a65405 100644 --- a/service/iotsitewise/serializers.go +++ b/service/iotsitewise/serializers.go @@ -901,6 +901,16 @@ func awsRestjson1_serializeOpDocumentCreateAssetInput(v *CreateAssetInput, value ok.String(*v.AssetDescription) } + if v.AssetExternalId != nil { + ok := object.Key("assetExternalId") + ok.String(*v.AssetExternalId) + } + + if v.AssetId != nil { + ok := object.Key("assetId") + ok.String(*v.AssetId) + } + if v.AssetModelId != nil { ok := object.Key("assetModelId") ok.String(*v.AssetModelId) @@ -1005,6 +1015,11 @@ func awsRestjson1_serializeOpDocumentCreateAssetModelInput(v *CreateAssetModelIn ok.String(*v.AssetModelDescription) } + if v.AssetModelExternalId != nil { + ok := object.Key("assetModelExternalId") + ok.String(*v.AssetModelExternalId) + } + if v.AssetModelHierarchies != nil { ok := object.Key("assetModelHierarchies") if err := awsRestjson1_serializeDocumentAssetModelHierarchyDefinitions(v.AssetModelHierarchies, ok); err != nil { @@ -1012,6 +1027,11 @@ func awsRestjson1_serializeOpDocumentCreateAssetModelInput(v *CreateAssetModelIn } } + if v.AssetModelId != nil { + ok := object.Key("assetModelId") + ok.String(*v.AssetModelId) + } + if v.AssetModelName != nil { ok := object.Key("assetModelName") ok.String(*v.AssetModelName) @@ -1024,6 +1044,11 @@ func awsRestjson1_serializeOpDocumentCreateAssetModelInput(v *CreateAssetModelIn } } + if len(v.AssetModelType) > 0 { + ok := object.Key("assetModelType") + ok.String(string(v.AssetModelType)) + } + if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) @@ -1039,6 +1064,136 @@ func awsRestjson1_serializeOpDocumentCreateAssetModelInput(v *CreateAssetModelIn return nil } +type awsRestjson1_serializeOpCreateAssetModelCompositeModel struct { +} + +func (*awsRestjson1_serializeOpCreateAssetModelCompositeModel) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateAssetModelCompositeModel) 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.(*CreateAssetModelCompositeModelInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateAssetModelCompositeModelInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateAssetModelCompositeModelInput(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_serializeOpHttpBindingsCreateAssetModelCompositeModelInput(v *CreateAssetModelCompositeModelInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} + } + if v.AssetModelId != nil { + if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateAssetModelCompositeModelInput(v *CreateAssetModelCompositeModelInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssetModelCompositeModelDescription != nil { + ok := object.Key("assetModelCompositeModelDescription") + ok.String(*v.AssetModelCompositeModelDescription) + } + + if v.AssetModelCompositeModelExternalId != nil { + ok := object.Key("assetModelCompositeModelExternalId") + ok.String(*v.AssetModelCompositeModelExternalId) + } + + if v.AssetModelCompositeModelId != nil { + ok := object.Key("assetModelCompositeModelId") + ok.String(*v.AssetModelCompositeModelId) + } + + if v.AssetModelCompositeModelName != nil { + ok := object.Key("assetModelCompositeModelName") + ok.String(*v.AssetModelCompositeModelName) + } + + if v.AssetModelCompositeModelProperties != nil { + ok := object.Key("assetModelCompositeModelProperties") + if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v.AssetModelCompositeModelProperties, ok); err != nil { + return err + } + } + + if v.AssetModelCompositeModelType != nil { + ok := object.Key("assetModelCompositeModelType") + ok.String(*v.AssetModelCompositeModelType) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.ComposedAssetModelId != nil { + ok := object.Key("composedAssetModelId") + ok.String(*v.ComposedAssetModelId) + } + + if v.ParentAssetModelCompositeModelId != nil { + ok := object.Key("parentAssetModelCompositeModelId") + ok.String(*v.ParentAssetModelCompositeModelId) + } + + return nil +} + type awsRestjson1_serializeOpCreateBulkImportJob struct { } @@ -1106,6 +1261,16 @@ func awsRestjson1_serializeOpDocumentCreateBulkImportJobInput(v *CreateBulkImpor object := value.Object() defer object.Close() + if v.AdaptiveIngestion != nil { + ok := object.Key("adaptiveIngestion") + ok.Boolean(*v.AdaptiveIngestion) + } + + if v.DeleteFilesAfterImport != nil { + ok := object.Key("deleteFilesAfterImport") + ok.Boolean(*v.DeleteFilesAfterImport) + } + if v.ErrorReportLocation != nil { ok := object.Key("errorReportLocation") if err := awsRestjson1_serializeDocumentErrorReportLocation(v.ErrorReportLocation, ok); err != nil { @@ -1761,6 +1926,84 @@ func awsRestjson1_serializeOpHttpBindingsDeleteAssetModelInput(v *DeleteAssetMod return nil } +type awsRestjson1_serializeOpDeleteAssetModelCompositeModel struct { +} + +func (*awsRestjson1_serializeOpDeleteAssetModelCompositeModel) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAssetModelCompositeModel) 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.(*DeleteAssetModelCompositeModelInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models/{assetModelCompositeModelId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteAssetModelCompositeModelInput(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_serializeOpHttpBindingsDeleteAssetModelCompositeModelInput(v *DeleteAssetModelCompositeModelInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssetModelCompositeModelId == nil || len(*v.AssetModelCompositeModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelCompositeModelId must not be empty")} + } + if v.AssetModelCompositeModelId != nil { + if err := encoder.SetURI("assetModelCompositeModelId").String(*v.AssetModelCompositeModelId); err != nil { + return err + } + } + + if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} + } + if v.AssetModelId != nil { + if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { + return err + } + } + + if v.ClientToken != nil { + encoder.SetQuery("clientToken").String(*v.ClientToken) + } + + return nil +} + type awsRestjson1_serializeOpDeleteDashboard struct { } @@ -2189,14 +2432,14 @@ func awsRestjson1_serializeOpHttpBindingsDescribeAccessPolicyInput(v *DescribeAc return nil } -type awsRestjson1_serializeOpDescribeAsset struct { +type awsRestjson1_serializeOpDescribeAction struct { } -func (*awsRestjson1_serializeOpDescribeAsset) ID() string { +func (*awsRestjson1_serializeOpDescribeAction) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2204,13 +2447,13 @@ func (m *awsRestjson1_serializeOpDescribeAsset) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeAssetInput) + input, ok := in.Parameters.(*DescribeActionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}") + opPath, opQuery := httpbinding.SplitURI("/actions/{actionId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2226,7 +2469,7 @@ func (m *awsRestjson1_serializeOpDescribeAsset) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDescribeActionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2237,35 +2480,31 @@ func (m *awsRestjson1_serializeOpDescribeAsset) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeAssetInput(v *DescribeAssetInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeActionInput(v *DescribeActionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssetId == nil || len(*v.AssetId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} + if v.ActionId == nil || len(*v.ActionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member actionId must not be empty")} } - if v.AssetId != nil { - if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { + if v.ActionId != nil { + if err := encoder.SetURI("actionId").String(*v.ActionId); err != nil { return err } } - if v.ExcludeProperties { - encoder.SetQuery("excludeProperties").Boolean(v.ExcludeProperties) - } - return nil } -type awsRestjson1_serializeOpDescribeAssetModel struct { +type awsRestjson1_serializeOpDescribeAsset struct { } -func (*awsRestjson1_serializeOpDescribeAssetModel) ID() string { +func (*awsRestjson1_serializeOpDescribeAsset) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2273,13 +2512,13 @@ func (m *awsRestjson1_serializeOpDescribeAssetModel) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeAssetModelInput) + input, ok := in.Parameters.(*DescribeAssetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}") + opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2295,7 +2534,7 @@ func (m *awsRestjson1_serializeOpDescribeAssetModel) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetModelInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2306,16 +2545,16 @@ func (m *awsRestjson1_serializeOpDescribeAssetModel) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeAssetModelInput(v *DescribeAssetModelInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAssetInput(v *DescribeAssetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} + if v.AssetId == nil || len(*v.AssetId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} } - if v.AssetModelId != nil { - if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { + if v.AssetId != nil { + if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { return err } } @@ -2327,14 +2566,14 @@ func awsRestjson1_serializeOpHttpBindingsDescribeAssetModelInput(v *DescribeAsse return nil } -type awsRestjson1_serializeOpDescribeAssetProperty struct { +type awsRestjson1_serializeOpDescribeAssetCompositeModel struct { } -func (*awsRestjson1_serializeOpDescribeAssetProperty) ID() string { +func (*awsRestjson1_serializeOpDescribeAssetCompositeModel) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeAssetProperty) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAssetCompositeModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2342,13 +2581,13 @@ func (m *awsRestjson1_serializeOpDescribeAssetProperty) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeAssetPropertyInput) + input, ok := in.Parameters.(*DescribeAssetCompositeModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties/{propertyId}") + opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/composite-models/{assetCompositeModelId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2364,7 +2603,7 @@ func (m *awsRestjson1_serializeOpDescribeAssetProperty) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetPropertyInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetCompositeModelInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2375,25 +2614,25 @@ func (m *awsRestjson1_serializeOpDescribeAssetProperty) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeAssetPropertyInput(v *DescribeAssetPropertyInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAssetCompositeModelInput(v *DescribeAssetCompositeModelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssetId == nil || len(*v.AssetId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} + if v.AssetCompositeModelId == nil || len(*v.AssetCompositeModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetCompositeModelId must not be empty")} } - if v.AssetId != nil { - if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { + if v.AssetCompositeModelId != nil { + if err := encoder.SetURI("assetCompositeModelId").String(*v.AssetCompositeModelId); err != nil { return err } } - if v.PropertyId == nil || len(*v.PropertyId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member propertyId must not be empty")} + if v.AssetId == nil || len(*v.AssetId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} } - if v.PropertyId != nil { - if err := encoder.SetURI("propertyId").String(*v.PropertyId); err != nil { + if v.AssetId != nil { + if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { return err } } @@ -2401,14 +2640,14 @@ func awsRestjson1_serializeOpHttpBindingsDescribeAssetPropertyInput(v *DescribeA return nil } -type awsRestjson1_serializeOpDescribeBulkImportJob struct { +type awsRestjson1_serializeOpDescribeAssetModel struct { } -func (*awsRestjson1_serializeOpDescribeBulkImportJob) ID() string { +func (*awsRestjson1_serializeOpDescribeAssetModel) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeBulkImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribeAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2416,13 +2655,13 @@ func (m *awsRestjson1_serializeOpDescribeBulkImportJob) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeBulkImportJobInput) + input, ok := in.Parameters.(*DescribeAssetModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/jobs/{jobId}") + opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2438,7 +2677,7 @@ func (m *awsRestjson1_serializeOpDescribeBulkImportJob) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDescribeBulkImportJobInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetModelInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2449,13 +2688,230 @@ func (m *awsRestjson1_serializeOpDescribeBulkImportJob) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribeBulkImportJobInput(v *DescribeBulkImportJobInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribeAssetModelInput(v *DescribeAssetModelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.JobId == nil || len(*v.JobId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")} + if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} + } + if v.AssetModelId != nil { + if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { + return err + } + } + + if v.ExcludeProperties { + encoder.SetQuery("excludeProperties").Boolean(v.ExcludeProperties) + } + + return nil +} + +type awsRestjson1_serializeOpDescribeAssetModelCompositeModel struct { +} + +func (*awsRestjson1_serializeOpDescribeAssetModelCompositeModel) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeAssetModelCompositeModel) 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.(*DescribeAssetModelCompositeModelInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models/{assetModelCompositeModelId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetModelCompositeModelInput(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_serializeOpHttpBindingsDescribeAssetModelCompositeModelInput(v *DescribeAssetModelCompositeModelInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssetModelCompositeModelId == nil || len(*v.AssetModelCompositeModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelCompositeModelId must not be empty")} + } + if v.AssetModelCompositeModelId != nil { + if err := encoder.SetURI("assetModelCompositeModelId").String(*v.AssetModelCompositeModelId); err != nil { + return err + } + } + + if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} + } + if v.AssetModelId != nil { + if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDescribeAssetProperty struct { +} + +func (*awsRestjson1_serializeOpDescribeAssetProperty) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeAssetProperty) 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.(*DescribeAssetPropertyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties/{propertyId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetPropertyInput(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_serializeOpHttpBindingsDescribeAssetPropertyInput(v *DescribeAssetPropertyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssetId == nil || len(*v.AssetId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} + } + if v.AssetId != nil { + if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { + return err + } + } + + if v.PropertyId == nil || len(*v.PropertyId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member propertyId must not be empty")} + } + if v.PropertyId != nil { + if err := encoder.SetURI("propertyId").String(*v.PropertyId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDescribeBulkImportJob struct { +} + +func (*awsRestjson1_serializeOpDescribeBulkImportJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeBulkImportJob) 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.(*DescribeBulkImportJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/jobs/{jobId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribeBulkImportJobInput(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_serializeOpHttpBindingsDescribeBulkImportJobInput(v *DescribeBulkImportJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.JobId == nil || len(*v.JobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")} } if v.JobId != nil { if err := encoder.SetURI("jobId").String(*v.JobId); err != nil { @@ -3114,22 +3570,207 @@ func awsRestjson1_serializeOpDocumentDisassociateAssetsInput(v *DisassociateAsse ok.String(*v.ClientToken) } - if v.HierarchyId != nil { - ok := object.Key("hierarchyId") - ok.String(*v.HierarchyId) + if v.HierarchyId != nil { + ok := object.Key("hierarchyId") + ok.String(*v.HierarchyId) + } + + return nil +} + +type awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty struct { +} + +func (*awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) 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.(*DisassociateTimeSeriesFromAssetPropertyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/timeseries/disassociate") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDisassociateTimeSeriesFromAssetPropertyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDisassociateTimeSeriesFromAssetPropertyInput(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_serializeOpHttpBindingsDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeSeriesFromAssetPropertyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Alias != nil { + encoder.SetQuery("alias").String(*v.Alias) + } + + if v.AssetId != nil { + encoder.SetQuery("assetId").String(*v.AssetId) + } + + if v.PropertyId != nil { + encoder.SetQuery("propertyId").String(*v.PropertyId) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeSeriesFromAssetPropertyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + return nil +} + +type awsRestjson1_serializeOpExecuteAction struct { +} + +func (*awsRestjson1_serializeOpExecuteAction) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpExecuteAction) 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.(*ExecuteActionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/actions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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_serializeOpDocumentExecuteActionInput(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_serializeOpHttpBindingsExecuteActionInput(v *ExecuteActionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentExecuteActionInput(v *ExecuteActionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActionDefinitionId != nil { + ok := object.Key("actionDefinitionId") + ok.String(*v.ActionDefinitionId) + } + + if v.ActionPayload != nil { + ok := object.Key("actionPayload") + if err := awsRestjson1_serializeDocumentActionPayload(v.ActionPayload, ok); err != nil { + return err + } + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.TargetResource != nil { + ok := object.Key("targetResource") + if err := awsRestjson1_serializeDocumentTargetResource(v.TargetResource, ok); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty struct { +type awsRestjson1_serializeOpExecuteQuery struct { } -func (*awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) ID() string { +func (*awsRestjson1_serializeOpExecuteQuery) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpExecuteQuery) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3137,13 +3778,13 @@ func (m *awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) Handle return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DisassociateTimeSeriesFromAssetPropertyInput) + input, ok := in.Parameters.(*ExecuteQueryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/timeseries/disassociate") + opPath, opQuery := httpbinding.SplitURI("/queries/execution") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -3159,14 +3800,10 @@ func (m *awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) Handle return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDisassociateTimeSeriesFromAssetPropertyInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDisassociateTimeSeriesFromAssetPropertyInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentExecuteQueryInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3181,33 +3818,31 @@ func (m *awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) Handle return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeSeriesFromAssetPropertyInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsExecuteQueryInput(v *ExecuteQueryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.Alias != nil { - encoder.SetQuery("alias").String(*v.Alias) - } - - if v.AssetId != nil { - encoder.SetQuery("assetId").String(*v.AssetId) - } - - if v.PropertyId != nil { - encoder.SetQuery("propertyId").String(*v.PropertyId) - } - return nil } -func awsRestjson1_serializeOpDocumentDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeSeriesFromAssetPropertyInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentExecuteQueryInput(v *ExecuteQueryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.ClientToken != nil { - ok := object.Key("clientToken") - ok.String(*v.ClientToken) + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.QueryStatement != nil { + ok := object.Key("queryStatement") + ok.String(*v.QueryStatement) } return nil @@ -3671,6 +4306,151 @@ func awsRestjson1_serializeOpHttpBindingsListAccessPoliciesInput(v *ListAccessPo return nil } +type awsRestjson1_serializeOpListActions struct { +} + +func (*awsRestjson1_serializeOpListActions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListActions) 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.(*ListActionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/actions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListActionsInput(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_serializeOpHttpBindingsListActionsInput(v *ListActionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.TargetResourceId != nil { + encoder.SetQuery("targetResourceId").String(*v.TargetResourceId) + } + + if len(v.TargetResourceType) > 0 { + encoder.SetQuery("targetResourceType").String(string(v.TargetResourceType)) + } + + return nil +} + +type awsRestjson1_serializeOpListAssetModelCompositeModels struct { +} + +func (*awsRestjson1_serializeOpListAssetModelCompositeModels) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAssetModelCompositeModels) 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.(*ListAssetModelCompositeModelsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListAssetModelCompositeModelsInput(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_serializeOpHttpBindingsListAssetModelCompositeModelsInput(v *ListAssetModelCompositeModelsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} + } + if v.AssetModelId != nil { + if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListAssetModelProperties struct { } @@ -3801,6 +4581,12 @@ func awsRestjson1_serializeOpHttpBindingsListAssetModelsInput(v *ListAssetModels return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.AssetModelTypes != nil { + for i := range v.AssetModelTypes { + encoder.AddQuery("assetModelTypes").String(string(v.AssetModelTypes[i])) + } + } + if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } @@ -4053,13 +4839,94 @@ func (m *awsRestjson1_serializeOpListAssociatedAssets) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAssociatedAssetsInput) + input, ok := in.Parameters.(*ListAssociatedAssetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/hierarchies") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListAssociatedAssetsInput(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_serializeOpHttpBindingsListAssociatedAssetsInput(v *ListAssociatedAssetsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssetId == nil || len(*v.AssetId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} + } + if v.AssetId != nil { + if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { + return err + } + } + + if v.HierarchyId != nil { + encoder.SetQuery("hierarchyId").String(*v.HierarchyId) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.TraversalDirection) > 0 { + encoder.SetQuery("traversalDirection").String(string(v.TraversalDirection)) + } + + return nil +} + +type awsRestjson1_serializeOpListBulkImportJobs struct { +} + +func (*awsRestjson1_serializeOpListBulkImportJobs) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListBulkImportJobs) 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.(*ListBulkImportJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/hierarchies") + opPath, opQuery := httpbinding.SplitURI("/jobs") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -4075,7 +4942,7 @@ func (m *awsRestjson1_serializeOpListAssociatedAssets) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListAssociatedAssetsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListBulkImportJobsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -4086,22 +4953,13 @@ func (m *awsRestjson1_serializeOpListAssociatedAssets) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListAssociatedAssetsInput(v *ListAssociatedAssetsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListBulkImportJobsInput(v *ListBulkImportJobsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AssetId == nil || len(*v.AssetId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} - } - if v.AssetId != nil { - if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { - return err - } - } - - if v.HierarchyId != nil { - encoder.SetQuery("hierarchyId").String(*v.HierarchyId) + if len(v.Filter) > 0 { + encoder.SetQuery("filter").String(string(v.Filter)) } if v.MaxResults != nil { @@ -4112,21 +4970,17 @@ func awsRestjson1_serializeOpHttpBindingsListAssociatedAssetsInput(v *ListAssoci encoder.SetQuery("nextToken").String(*v.NextToken) } - if len(v.TraversalDirection) > 0 { - encoder.SetQuery("traversalDirection").String(string(v.TraversalDirection)) - } - return nil } -type awsRestjson1_serializeOpListBulkImportJobs struct { +type awsRestjson1_serializeOpListCompositionRelationships struct { } -func (*awsRestjson1_serializeOpListBulkImportJobs) ID() string { +func (*awsRestjson1_serializeOpListCompositionRelationships) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListBulkImportJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListCompositionRelationships) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -4134,13 +4988,13 @@ func (m *awsRestjson1_serializeOpListBulkImportJobs) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListBulkImportJobsInput) + input, ok := in.Parameters.(*ListCompositionRelationshipsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/jobs") + opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composition-relationships") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -4156,7 +5010,7 @@ func (m *awsRestjson1_serializeOpListBulkImportJobs) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListBulkImportJobsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListCompositionRelationshipsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -4167,13 +5021,18 @@ func (m *awsRestjson1_serializeOpListBulkImportJobs) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListBulkImportJobsInput(v *ListBulkImportJobsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListCompositionRelationshipsInput(v *ListCompositionRelationshipsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if len(v.Filter) > 0 { - encoder.SetQuery("filter").String(string(v.Filter)) + if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} + } + if v.AssetModelId != nil { + if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { + return err + } } if v.MaxResults != nil { @@ -4908,6 +5767,18 @@ func awsRestjson1_serializeOpDocumentPutStorageConfigurationInput(v *PutStorageC ok.String(string(v.StorageType)) } + if len(v.WarmTier) > 0 { + ok := object.Key("warmTier") + ok.String(string(v.WarmTier)) + } + + if v.WarmTierRetentionPeriod != nil { + ok := object.Key("warmTierRetentionPeriod") + if err := awsRestjson1_serializeDocumentWarmTierRetentionPeriod(v.WarmTierRetentionPeriod, ok); err != nil { + return err + } + } + return nil } @@ -5254,6 +6125,11 @@ func awsRestjson1_serializeOpDocumentUpdateAssetInput(v *UpdateAssetInput, value ok.String(*v.AssetDescription) } + if v.AssetExternalId != nil { + ok := object.Key("assetExternalId") + ok.String(*v.AssetExternalId) + } + if v.AssetName != nil { ok := object.Key("assetName") ok.String(*v.AssetName) @@ -5359,6 +6235,11 @@ func awsRestjson1_serializeOpDocumentUpdateAssetModelInput(v *UpdateAssetModelIn ok.String(*v.AssetModelDescription) } + if v.AssetModelExternalId != nil { + ok := object.Key("assetModelExternalId") + ok.String(*v.AssetModelExternalId) + } + if v.AssetModelHierarchies != nil { ok := object.Key("assetModelHierarchies") if err := awsRestjson1_serializeDocumentAssetModelHierarchies(v.AssetModelHierarchies, ok); err != nil { @@ -5386,6 +6267,125 @@ func awsRestjson1_serializeOpDocumentUpdateAssetModelInput(v *UpdateAssetModelIn return nil } +type awsRestjson1_serializeOpUpdateAssetModelCompositeModel struct { +} + +func (*awsRestjson1_serializeOpUpdateAssetModelCompositeModel) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateAssetModelCompositeModel) 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.(*UpdateAssetModelCompositeModelInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models/{assetModelCompositeModelId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateAssetModelCompositeModelInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAssetModelCompositeModelInput(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_serializeOpHttpBindingsUpdateAssetModelCompositeModelInput(v *UpdateAssetModelCompositeModelInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AssetModelCompositeModelId == nil || len(*v.AssetModelCompositeModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelCompositeModelId must not be empty")} + } + if v.AssetModelCompositeModelId != nil { + if err := encoder.SetURI("assetModelCompositeModelId").String(*v.AssetModelCompositeModelId); err != nil { + return err + } + } + + if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} + } + if v.AssetModelId != nil { + if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAssetModelCompositeModelInput(v *UpdateAssetModelCompositeModelInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssetModelCompositeModelDescription != nil { + ok := object.Key("assetModelCompositeModelDescription") + ok.String(*v.AssetModelCompositeModelDescription) + } + + if v.AssetModelCompositeModelExternalId != nil { + ok := object.Key("assetModelCompositeModelExternalId") + ok.String(*v.AssetModelCompositeModelExternalId) + } + + if v.AssetModelCompositeModelName != nil { + ok := object.Key("assetModelCompositeModelName") + ok.String(*v.AssetModelCompositeModelName) + } + + if v.AssetModelCompositeModelProperties != nil { + ok := object.Key("assetModelCompositeModelProperties") + if err := awsRestjson1_serializeDocumentAssetModelProperties(v.AssetModelCompositeModelProperties, ok); err != nil { + return err + } + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + return nil +} + type awsRestjson1_serializeOpUpdateAssetProperty struct { } @@ -6007,6 +7007,18 @@ func awsRestjson1_serializeOpDocumentUpdateProjectInput(v *UpdateProjectInput, v return nil } +func awsRestjson1_serializeDocumentActionPayload(v *types.ActionPayload, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StringValue != nil { + ok := object.Key("stringValue") + ok.String(*v.StringValue) + } + + return nil +} + func awsRestjson1_serializeDocumentAggregateTypes(v []types.AggregateType, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -6044,6 +7056,11 @@ func awsRestjson1_serializeDocumentAssetModelCompositeModel(v *types.AssetModelC ok.String(*v.Description) } + if v.ExternalId != nil { + ok := object.Key("externalId") + ok.String(*v.ExternalId) + } + if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) @@ -6078,6 +7095,16 @@ func awsRestjson1_serializeDocumentAssetModelCompositeModelDefinition(v *types.A ok.String(*v.Description) } + if v.ExternalId != nil { + ok := object.Key("externalId") + ok.String(*v.ExternalId) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) @@ -6146,6 +7173,11 @@ func awsRestjson1_serializeDocumentAssetModelHierarchy(v *types.AssetModelHierar ok.String(*v.ChildAssetModelId) } + if v.ExternalId != nil { + ok := object.Key("externalId") + ok.String(*v.ExternalId) + } + if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) @@ -6168,6 +7200,16 @@ func awsRestjson1_serializeDocumentAssetModelHierarchyDefinition(v *types.AssetM ok.String(*v.ChildAssetModelId) } + if v.ExternalId != nil { + ok := object.Key("externalId") + ok.String(*v.ExternalId) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) @@ -6216,6 +7258,11 @@ func awsRestjson1_serializeDocumentAssetModelProperty(v *types.AssetModelPropert ok.String(*v.DataTypeSpec) } + if v.ExternalId != nil { + ok := object.Key("externalId") + ok.String(*v.ExternalId) + } + if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) @@ -6226,6 +7273,13 @@ func awsRestjson1_serializeDocumentAssetModelProperty(v *types.AssetModelPropert ok.String(*v.Name) } + if v.Path != nil { + ok := object.Key("path") + if err := awsRestjson1_serializeDocumentAssetModelPropertyPath(v.Path, ok); err != nil { + return err + } + } + if v.Type != nil { ok := object.Key("type") if err := awsRestjson1_serializeDocumentPropertyType(v.Type, ok); err != nil { @@ -6255,6 +7309,16 @@ func awsRestjson1_serializeDocumentAssetModelPropertyDefinition(v *types.AssetMo ok.String(*v.DataTypeSpec) } + if v.ExternalId != nil { + ok := object.Key("externalId") + ok.String(*v.ExternalId) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) @@ -6288,6 +7352,36 @@ func awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v []types.Asset return nil } +func awsRestjson1_serializeDocumentAssetModelPropertyPath(v []types.AssetModelPropertyPathSegment, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAssetModelPropertyPathSegment(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAssetModelPropertyPathSegment(v *types.AssetModelPropertyPathSegment, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + func awsRestjson1_serializeDocumentAssetPropertyValue(v *types.AssetPropertyValue, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6639,6 +7733,13 @@ func awsRestjson1_serializeDocumentFileFormat(v *types.FileFormat, value smithyj } } + if v.Parquet != nil { + ok := object.Key("parquet") + if err := awsRestjson1_serializeDocumentParquet(v.Parquet, ok); err != nil { + return err + } + } + return nil } @@ -6957,6 +8058,13 @@ func awsRestjson1_serializeDocumentMultiLayerStorage(v *types.MultiLayerStorage, return nil } +func awsRestjson1_serializeDocumentParquet(v *types.Parquet, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + func awsRestjson1_serializeDocumentPortalResource(v *types.PortalResource, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7123,6 +8231,18 @@ func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson. return nil } +func awsRestjson1_serializeDocumentTargetResource(v *types.TargetResource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssetId != nil { + ok := object.Key("assetId") + ok.String(*v.AssetId) + } + + return nil +} + func awsRestjson1_serializeDocumentTimeInNanos(v *types.TimeInNanos, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7228,6 +8348,13 @@ func awsRestjson1_serializeDocumentVariableValue(v *types.VariableValue, value s ok.String(*v.PropertyId) } + if v.PropertyPath != nil { + ok := object.Key("propertyPath") + if err := awsRestjson1_serializeDocumentAssetModelPropertyPath(v.PropertyPath, ok); err != nil { + return err + } + } + return nil } @@ -7270,3 +8397,20 @@ func awsRestjson1_serializeDocumentVariant(v *types.Variant, value smithyjson.Va return nil } + +func awsRestjson1_serializeDocumentWarmTierRetentionPeriod(v *types.WarmTierRetentionPeriod, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NumberOfDays != nil { + ok := object.Key("numberOfDays") + ok.Integer(*v.NumberOfDays) + } + + if v.Unlimited != nil { + ok := object.Key("unlimited") + ok.Boolean(*v.Unlimited) + } + + return nil +} diff --git a/service/iotsitewise/types/enums.go b/service/iotsitewise/types/enums.go index de9c21a8f9d..4c3b6693bc0 100644 --- a/service/iotsitewise/types/enums.go +++ b/service/iotsitewise/types/enums.go @@ -70,6 +70,24 @@ func (AssetModelState) Values() []AssetModelState { } } +type AssetModelType string + +// Enum values for AssetModelType +const ( + AssetModelTypeAssetModel AssetModelType = "ASSET_MODEL" + AssetModelTypeComponentModel AssetModelType = "COMPONENT_MODEL" +) + +// Values returns all known values for AssetModelType. 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 (AssetModelType) Values() []AssetModelType { + return []AssetModelType{ + "ASSET_MODEL", + "COMPONENT_MODEL", + } +} + type AssetRelationshipType string // Enum values for AssetRelationshipType @@ -748,6 +766,30 @@ func (ResourceType) Values() []ResourceType { } } +type ScalarType string + +// Enum values for ScalarType +const ( + ScalarTypeBoolean ScalarType = "BOOLEAN" + ScalarTypeInt ScalarType = "INT" + ScalarTypeDouble ScalarType = "DOUBLE" + ScalarTypeTimestamp ScalarType = "TIMESTAMP" + ScalarTypeString ScalarType = "STRING" +) + +// Values returns all known values for ScalarType. 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 (ScalarType) Values() []ScalarType { + return []ScalarType{ + "BOOLEAN", + "INT", + "DOUBLE", + "TIMESTAMP", + "STRING", + } +} + type StorageType string // Enum values for StorageType @@ -766,6 +808,22 @@ func (StorageType) Values() []StorageType { } } +type TargetResourceType string + +// Enum values for TargetResourceType +const ( + TargetResourceTypeAsset TargetResourceType = "ASSET" +) + +// Values returns all known values for TargetResourceType. 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 (TargetResourceType) Values() []TargetResourceType { + return []TargetResourceType{ + "ASSET", + } +} + type TimeOrdering string // Enum values for TimeOrdering @@ -817,3 +875,21 @@ func (TraversalType) Values() []TraversalType { "PATH_TO_ROOT", } } + +type WarmTierState string + +// Enum values for WarmTierState +const ( + WarmTierStateEnabled WarmTierState = "ENABLED" + WarmTierStateDisabled WarmTierState = "DISABLED" +) + +// Values returns all known values for WarmTierState. 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 (WarmTierState) Values() []WarmTierState { + return []WarmTierState{ + "ENABLED", + "DISABLED", + } +} diff --git a/service/iotsitewise/types/errors.go b/service/iotsitewise/types/errors.go index dfd4b0157bc..04171021f1d 100644 --- a/service/iotsitewise/types/errors.go +++ b/service/iotsitewise/types/errors.go @@ -7,6 +7,32 @@ import ( smithy "github.com/aws/smithy-go" ) +// Access is denied. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Your request has conflicting operations. This can occur if you're trying to // perform more than one operation on the same resource at the same time. type ConflictingOperationException struct { @@ -120,6 +146,32 @@ func (e *LimitExceededException) ErrorCode() string { } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The query timed out. +type QueryTimeoutException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *QueryTimeoutException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *QueryTimeoutException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *QueryTimeoutException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "QueryTimeoutException" + } + return *e.ErrorCodeOverride +} +func (e *QueryTimeoutException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The resource already exists. type ResourceAlreadyExistsException struct { Message *string @@ -285,3 +337,29 @@ func (e *UnauthorizedException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The validation failed for this query. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/iotsitewise/types/types.go b/service/iotsitewise/types/types.go index 8202469b93c..6ae10ab4c79 100644 --- a/service/iotsitewise/types/types.go +++ b/service/iotsitewise/types/types.go @@ -42,6 +42,53 @@ type AccessPolicySummary struct { noSmithyDocumentSerde } +// Contains a definition for an action. +type ActionDefinition struct { + + // The ID of the action definition. + // + // This member is required. + ActionDefinitionId *string + + // The name of the action definition. + // + // This member is required. + ActionName *string + + // The type of the action definition. + // + // This member is required. + ActionType *string + + noSmithyDocumentSerde +} + +// The JSON payload of the action. +type ActionPayload struct { + + // The payload of the action in a JSON string. + // + // This member is required. + StringValue *string + + noSmithyDocumentSerde +} + +// Contains the summary of the actions. +type ActionSummary struct { + + // The ID of the action definition. + ActionDefinitionId *string + + // The ID of the action. + ActionId *string + + // The resource the action will be taken on. + TargetResource *TargetResource + + noSmithyDocumentSerde +} + // Contains aggregated asset property values (for example, average, minimum, and // maximum). type AggregatedValue struct { @@ -132,16 +179,75 @@ type AssetCompositeModel struct { // The description of the composite model. Description *string + // The external ID of the asset composite model. For more information, see Using + // external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + // The ID of the asset composite model. Id *string noSmithyDocumentSerde } +// Represents one level between a composite model and the root of the asset. +type AssetCompositeModelPathSegment struct { + + // The ID of the path segment. + Id *string + + // The name of the path segment. + Name *string + + noSmithyDocumentSerde +} + +// Contains a summary of the composite model for a specific asset. +type AssetCompositeModelSummary struct { + + // A description of the composite model that this summary describes. + // + // This member is required. + Description *string + + // The ID of the composite model that this summary describes. + // + // This member is required. + Id *string + + // The name of the composite model that this summary describes. + // + // This member is required. + Name *string + + // The path that includes all the components of the asset model for the asset. + // + // This member is required. + Path []AssetCompositeModelPathSegment + + // The type of asset model. + // - ASSET_MODEL – (default) An asset model that you can use to create assets. + // Can't be included as a component in another asset model. + // - COMPONENT_MODEL – A reusable component that you can include in the + // composite models of other asset models. You can't create assets directly from + // this type of asset model. + // + // This member is required. + Type *string + + // An external ID to assign to the asset model. If the composite model is a + // derived composite model, or one nested inside a component model, you can only + // set the external ID using UpdateAssetModelCompositeModel and specifying the + // derived ID of the model or property from the created model it's a part of. + ExternalId *string + + noSmithyDocumentSerde +} + // Contains error details for the requested associate project asset action. type AssetErrorDetails struct { - // The ID of the asset. + // The ID of the asset, in UUID format. // // This member is required. AssetId *string @@ -169,6 +275,13 @@ type AssetHierarchy struct { // This member is required. Name *string + // The external ID of the hierarchy, if it has one. When you update an asset + // hierarchy, you may assign an external ID if it doesn't already have one. You + // can't change the external ID of an asset hierarchy that already has one. For + // more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + // The ID of the hierarchy. This ID is a hierarchyId . Id *string @@ -206,6 +319,11 @@ type AssetModelCompositeModel struct { // The description of the composite model. Description *string + // The external ID of the asset model composite model. For more information, see + // Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + // The ID of the asset model composite model. Id *string @@ -233,18 +351,84 @@ type AssetModelCompositeModelDefinition struct { // The description of the composite model. Description *string + // An external ID to assign to the composite model. The external ID must be unique + // among composite models within this asset model. For more information, see Using + // external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + + // The ID to assign to the composite model, if desired. IoT SiteWise automatically + // generates a unique ID for you, so this parameter is never required. However, if + // you prefer to supply your own ID instead, you can specify it here in UUID + // format. If you specify your own ID, it must be globally unique. + Id *string + // The asset property definitions for this composite model. Properties []AssetModelPropertyDefinition noSmithyDocumentSerde } +// Represents one level between a composite model and the root of the asset model. +type AssetModelCompositeModelPathSegment struct { + + // The ID of the path segment. + Id *string + + // The name of the path segment. + Name *string + + noSmithyDocumentSerde +} + +// Contains a summary of the composite model. +type AssetModelCompositeModelSummary struct { + + // The ID of the the composite model that this summary describes.. + // + // This member is required. + Id *string + + // The name of the the composite model that this summary describes.. + // + // This member is required. + Name *string + + // The type of asset model. + // - ASSET_MODEL – (default) An asset model that you can use to create assets. + // Can't be included as a component in another asset model. + // - COMPONENT_MODEL – A reusable component that you can include in the + // composite models of other asset models. You can't create assets directly from + // this type of asset model. + // + // This member is required. + Type *string + + // The description of the the composite model that this summary describes.. + Description *string + + // The external ID of a composite model on this asset model. For more information, + // see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + + // The path that includes all the pieces that make up the composite model. + Path []AssetModelCompositeModelPathSegment + + noSmithyDocumentSerde +} + // Describes an asset hierarchy that contains a hierarchy's name, ID, and child // asset model ID that specifies the type of asset that can be in this hierarchy. type AssetModelHierarchy struct { - // The ID of the asset model. All assets in this hierarchy must be instances of - // the childAssetModelId asset model. + // The ID of the asset model, in UUID format. All assets in this hierarchy must be + // instances of the childAssetModelId asset model. IoT SiteWise will always return + // the actual asset model ID for this value. However, when you are specifying this + // value as part of a call to UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html) + // , you may provide either the asset model ID or else externalId: followed by the + // asset model's external ID. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. // // This member is required. ChildAssetModelId *string @@ -257,7 +441,26 @@ type AssetModelHierarchy struct { // This member is required. Name *string + // The external ID (if any) provided in the CreateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModel.html) + // or UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html) + // operation. You can assign an external ID by specifying this value as part of a + // call to UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html) + // . However, you can't change the external ID if one is already assigned. For more + // information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + // The ID of the asset model hierarchy. This ID is a hierarchyId . + // - If you are callling UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html) + // to create a new hierarchy: You can specify its ID here, if desired. IoT SiteWise + // automatically generates a unique ID for you, so this parameter is never + // required. However, if you prefer to supply your own ID instead, you can specify + // it here in UUID format. If you specify your own ID, it must be globally unique. + // - If you are calling UpdateAssetModel to modify an existing hierarchy: This + // can be either the actual ID in UUID format, or else externalId: followed by + // the external ID, if it has one. For more information, see Referencing objects + // with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. Id *string noSmithyDocumentSerde @@ -267,7 +470,10 @@ type AssetModelHierarchy struct { // hierarchy determines the kind (or type) of asset that can belong to a hierarchy. type AssetModelHierarchyDefinition struct { - // The ID of an asset model for this hierarchy. + // The ID of an asset model for this hierarchy. This can be either the actual ID + // in UUID format, or else externalId: followed by the external ID, if it has one. + // For more information, see Referencing objects with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. // // This member is required. ChildAssetModelId *string @@ -280,6 +486,18 @@ type AssetModelHierarchyDefinition struct { // This member is required. Name *string + // An external ID to assign to the asset model hierarchy. The external ID must be + // unique among asset model hierarchies within this asset model. For more + // information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + + // The ID to assign to the asset model hierarchy, if desired. IoT SiteWise + // automatically generates a unique ID for you, so this parameter is never + // required. However, if you prefer to supply your own ID instead, you can specify + // it here in UUID format. If you specify your own ID, it must be globally unique. + Id *string + noSmithyDocumentSerde } @@ -305,9 +523,31 @@ type AssetModelProperty struct { // properties that have the STRUCT data type. DataTypeSpec *string + // The external ID (if any) provided in the CreateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModel.html) + // or UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html) + // operation. You can assign an external ID by specifying this value as part of a + // call to UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html) + // . However, you can't change the external ID if one is already assigned. For more + // information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + // The ID of the asset model property. + // - If you are callling UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html) + // to create a new property: You can specify its ID here, if desired. IoT SiteWise + // automatically generates a unique ID for you, so this parameter is never + // required. However, if you prefer to supply your own ID instead, you can specify + // it here in UUID format. If you specify your own ID, it must be globally unique. + // - If you are calling UpdateAssetModel to modify an existing property: This + // can be either the actual ID in UUID format, or else externalId: followed by + // the external ID, if it has one. For more information, see Referencing objects + // with external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references) + // in the IoT SiteWise User Guide. Id *string + // The structured path to the property from the root of the asset model. + Path []AssetModelPropertyPathSegment + // The unit of the asset model property, such as Newtons or RPM . Unit *string @@ -341,12 +581,36 @@ type AssetModelPropertyDefinition struct { // AWS/ALARM_STATE for alarm state in alarm composite models. DataTypeSpec *string + // An external ID to assign to the property definition. The external ID must be + // unique among property definitions within this asset model. For more information, + // see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + + // The ID to assign to the asset model property, if desired. IoT SiteWise + // automatically generates a unique ID for you, so this parameter is never + // required. However, if you prefer to supply your own ID instead, you can specify + // it here in UUID format. If you specify your own ID, it must be globally unique. + Id *string + // The unit of the property definition, such as Newtons or RPM . Unit *string noSmithyDocumentSerde } +// Represents one level between a property and the root of the asset model. +type AssetModelPropertyPathSegment struct { + + // The ID of the path segment. + Id *string + + // The name of the path segment. + Name *string + + noSmithyDocumentSerde +} + // Contains a summary of a property associated with a model. type AssetModelPropertySummary struct { @@ -373,9 +637,16 @@ type AssetModelPropertySummary struct { // properties that have the STRUCT data type. DataTypeSpec *string + // The external ID of the property. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + // The ID of the property. Id *string + // The structured path to the property from the root of the asset model. + Path []AssetModelPropertyPathSegment + // The unit (such as Newtons or RPM ) of the property. Unit *string @@ -418,7 +689,7 @@ type AssetModelSummary struct { // This member is required. Description *string - // The ID of the asset model (used with IoT SiteWise APIs). + // The ID of the asset model (used with IoT SiteWise API operations). // // This member is required. Id *string @@ -438,6 +709,18 @@ type AssetModelSummary struct { // This member is required. Status *AssetModelStatus + // The type of asset model. + // - ASSET_MODEL – (default) An asset model that you can use to create assets. + // Can't be included as a component in another asset model. + // - COMPONENT_MODEL – A reusable component that you can include in the + // composite models of other asset models. You can't create assets directly from + // this type of asset model. + AssetModelType AssetModelType + + // The external ID of the asset model. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + noSmithyDocumentSerde } @@ -469,20 +752,45 @@ type AssetProperty struct { // properties that have the STRUCT data type. DataTypeSpec *string + // The external ID of the asset property. For more information, see Using external + // IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + // The asset property's notification topic and state. For more information, see // UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html) // . Notification *PropertyNotification + // The structured path to the property from the root of the asset. + Path []AssetPropertyPathSegment + // The unit (such as Newtons or RPM ) of the asset property. Unit *string noSmithyDocumentSerde } +// Represents one level between a property and the root of the asset. +type AssetPropertyPathSegment struct { + + // The ID of the path segment. + Id *string + + // The name of the path segment. + Name *string + + noSmithyDocumentSerde +} + // Contains a summary of a property associated with an asset. type AssetPropertySummary struct { + // The ID of the property. + // + // This member is required. + Id *string + // The alias that identifies the property, such as an OPC-UA server data stream // path (for example, /company/windfarm/3/turbine/7/temperature ). For more // information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html) @@ -492,8 +800,9 @@ type AssetPropertySummary struct { // The ID of the composite model that contains the asset property. AssetCompositeModelId *string - // The ID of the property. - Id *string + // The external ID of the property. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string // Contains asset property value notification information. When the notification // state is enabled, IoT SiteWise publishes property value updates to a unique MQTT @@ -501,6 +810,9 @@ type AssetPropertySummary struct { // in the IoT SiteWise User Guide. Notification *PropertyNotification + // The structured path to the property from the root of the asset. + Path []AssetPropertyPathSegment + // The unit of measure (such as Newtons or RPM) of the asset property. Unit *string @@ -587,7 +899,7 @@ type AssetSummary struct { // This member is required. Hierarchies []AssetHierarchy - // The ID of the asset. + // The ID of the asset, in UUID format. // // This member is required. Id *string @@ -610,6 +922,10 @@ type AssetSummary struct { // A description for the asset. Description *string + // The external ID of the asset. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + noSmithyDocumentSerde } @@ -639,7 +955,7 @@ type AssociatedAssetsSummary struct { // This member is required. Hierarchies []AssetHierarchy - // The ID of the asset. + // The ID of the asset, in UUID format. // // This member is required. Id *string @@ -662,6 +978,10 @@ type AssociatedAssetsSummary struct { // A description for the asset. Description *string + // The external ID of the asset. For more information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + noSmithyDocumentSerde } @@ -725,7 +1045,7 @@ type BatchGetAssetPropertyAggregatesEntry struct { // in the IoT SiteWise User Guide. PropertyAlias *string - // The ID of the asset property. + // The ID of the asset property, in UUID format. PropertyId *string // The quality by which to filter asset data. @@ -844,7 +1164,7 @@ type BatchGetAssetPropertyValueEntry struct { // in the IoT SiteWise User Guide. PropertyAlias *string - // The ID of the asset property. + // The ID of the asset property, in UUID format. PropertyId *string noSmithyDocumentSerde @@ -917,7 +1237,7 @@ type BatchGetAssetPropertyValueHistoryEntry struct { // in the IoT SiteWise User Guide. PropertyAlias *string - // The ID of the asset property. + // The ID of the asset property, in UUID format. PropertyId *string // The quality by which to filter asset data. @@ -1090,6 +1410,27 @@ type BatchPutAssetPropertyErrorEntry struct { noSmithyDocumentSerde } +// A description of the column in the query results. +type ColumnInfo struct { + + // The name of the column description. + Name *string + + // The type of the column description. + Type *ColumnType + + noSmithyDocumentSerde +} + +// The data type of the column. +type ColumnType struct { + + // The allowed data types that the column has as it's value. + ScalarType ScalarType + + noSmithyDocumentSerde +} + // Contains information about a composite model property on an asset. type CompositeModelProperty struct { @@ -1108,12 +1449,60 @@ type CompositeModelProperty struct { // This member is required. Type *string + // The external ID of the composite model that contains the property. For more + // information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + // The ID of the composite model that contains the property. Id *string noSmithyDocumentSerde } +// Metadata for the composition relationship established by using +// composedAssetModelId in CreateAssetModelCompositeModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModelCompositeModel.html) +// . +type CompositionDetails struct { + + // An array detailing the composition relationship for this composite model. + CompositionRelationship []CompositionRelationshipItem + + noSmithyDocumentSerde +} + +// Represents a composite model that composed an asset model of type +// COMPONENT_MODEL . +type CompositionRelationshipItem struct { + + // The ID of the component. + Id *string + + noSmithyDocumentSerde +} + +// Contains a summary of the components of the composite model. +type CompositionRelationshipSummary struct { + + // The ID of a composite model on this asset model. + // + // This member is required. + AssetModelCompositeModelId *string + + // The composite model type. Valid values are AWS/ALARM , CUSTOM , or + // AWS/L4E_ANOMALY . + // + // This member is required. + AssetModelCompositeModelType *string + + // The ID of the asset model, in UUID format. + // + // This member is required. + AssetModelId *string + + noSmithyDocumentSerde +} + // Contains the details of an IoT SiteWise configuration error. type ConfigurationErrorDetails struct { @@ -1144,10 +1533,12 @@ type ConfigurationStatus struct { noSmithyDocumentSerde } -// A .csv file. +// A .CSV file. type Csv struct { // The column names specified in the .csv file. + // + // This member is required. ColumnNames []ColumnName noSmithyDocumentSerde @@ -1199,6 +1590,25 @@ type DashboardSummary struct { noSmithyDocumentSerde } +// Represents a single data point in a query result. +type Datum struct { + + // Indicates if the data point is an array. + ArrayValue []Datum + + // Indicates if the data point is null. + NullValue *bool + + // Indicates if the data point is a row. + RowValue *Row + + // Indicates if the data point is a scalar value such as integer, string, double, + // or Boolean. + ScalarValue *string + + noSmithyDocumentSerde +} + // Contains detailed error information. type DetailedError struct { @@ -1293,12 +1703,15 @@ type File struct { noSmithyDocumentSerde } -// The file format of the data. +// The file format of the data in S3. type FileFormat struct { - // The .csv file format. + // The file is in .CSV format. Csv *Csv + // The file is in parquet format. + Parquet *Parquet + noSmithyDocumentSerde } @@ -1460,9 +1873,9 @@ type IAMUserIdentity struct { } // Contains an identity that can access an IoT SiteWise Monitor resource. -// Currently, you can't use Amazon Web Services APIs to retrieve IAM Identity -// Center identity IDs. You can find the IAM Identity Center identity IDs in the -// URL of user and group pages in the IAM Identity Center console (https://console.aws.amazon.com/singlesignon) +// Currently, you can't use Amazon Web Services API operations to retrieve IAM +// Identity Center identity IDs. You can find the IAM Identity Center identity IDs +// in the URL of user and group pages in the IAM Identity Center console (https://console.aws.amazon.com/singlesignon) // . type Identity struct { @@ -1549,7 +1962,7 @@ type InterpolatedAssetPropertyValue struct { // to save data in Amazon S3. type JobConfiguration struct { - // The file format of the data in Amazon S3. + // The file format of the data in S3. // // This member is required. FileFormat *FileFormat @@ -1557,7 +1970,7 @@ type JobConfiguration struct { noSmithyDocumentSerde } -// Contains a job summary information. +// Contains the job summary information. type JobSummary struct { // The ID of the job. @@ -1570,7 +1983,7 @@ type JobSummary struct { // This member is required. Name *string - // The status of the bulk import job can be one of following values. + // The status of the bulk import job can be one of following values: // - PENDING – IoT SiteWise is waiting for the current bulk import job to finish. // - CANCELLED – The bulk import job has been canceled. // - RUNNING – IoT SiteWise is processing your request to import your data from @@ -1710,6 +2123,11 @@ type MultiLayerStorage struct { noSmithyDocumentSerde } +// A parquet file. +type Parquet struct { + noSmithyDocumentSerde +} + // Identifies an IoT SiteWise Monitor portal. type PortalResource struct { @@ -1840,11 +2258,19 @@ type Property struct { // in the IoT SiteWise User Guide. Alias *string + // The external ID of the asset property. For more information, see Using external + // IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + ExternalId *string + // The asset property's notification topic and state. For more information, see // UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html) // . Notification *PropertyNotification + // The structured path to the property from the root of the asset. + Path []AssetPropertyPathSegment + // The property type (see PropertyType ). A property contains one type. Type *PropertyType @@ -1946,8 +2372,8 @@ type Resource struct { noSmithyDocumentSerde } -// How many days your data is kept in the hot tier. By default, your data is kept -// indefinitely in the hot tier. +// The number of days your data is kept in the hot tier. By default, your data is +// kept indefinitely in the hot tier. type RetentionPeriod struct { // The number of days that your data is kept. If you specified a value for this @@ -1961,6 +2387,28 @@ type RetentionPeriod struct { noSmithyDocumentSerde } +// Represents a single row in the query results. +type Row struct { + + // List of data points in a single row of the result set. + // + // This member is required. + Data []Datum + + noSmithyDocumentSerde +} + +// The resource the action will be taken on. +type TargetResource struct { + + // The ID of the asset, in UUID format. + // + // This member is required. + AssetId *string + + noSmithyDocumentSerde +} + // Contains a timestamp with optional nanosecond granularity. type TimeInNanos struct { @@ -2020,7 +2468,7 @@ type TimeSeriesSummary struct { // alarm state in alarm composite models. DataTypeSpec *string - // The ID of the asset property. + // The ID of the asset property, in UUID format. PropertyId *string noSmithyDocumentSerde @@ -2138,21 +2586,27 @@ type UserIdentity struct { // Identifies a property value used in an expression. type VariableValue struct { - // The ID of the property to use as the variable. You can use the property name if - // it's from the same asset model. - // - // This member is required. - PropertyId *string - // The ID of the hierarchy to query for the property ID. You can use the - // hierarchy's name instead of the hierarchy's ID. You use a hierarchy ID instead - // of a model ID because you can have several hierarchies using the same model and - // therefore the same propertyId . For example, you might have separately grouped - // assets that come from the same asset model. For more information, see Asset - // hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html) + // hierarchy's name instead of the hierarchy's ID. If the hierarchy has an external + // ID, you can specify externalId: followed by the external ID. For more + // information, see Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. You use a hierarchy ID instead of a model ID + // because you can have several hierarchies using the same model and therefore the + // same propertyId . For example, you might have separately grouped assets that + // come from the same asset model. For more information, see Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html) // in the IoT SiteWise User Guide. HierarchyId *string + // The ID of the property to use as the variable. You can use the property name if + // it's from the same asset model. If the property has an external ID, you can + // specify externalId: followed by the external ID. For more information, see + // Using external IDs (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids) + // in the IoT SiteWise User Guide. + PropertyId *string + + // The path of the property. + PropertyPath []AssetModelPropertyPathSegment + noSmithyDocumentSerde } @@ -2165,7 +2619,8 @@ type Variant struct { // Asset property data of type double (floating point number). DoubleValue *float64 - // Asset property data of type integer (whole number). + // Asset property data of type integer (number that's greater than or equal to + // zero). IntegerValue *int32 // Asset property data of type string (sequence of characters). @@ -2174,4 +2629,17 @@ type Variant struct { noSmithyDocumentSerde } +// Set this period to specify how long your data is stored in the warm tier before +// it is deleted. You can set this only if cold tier is enabled. +type WarmTierRetentionPeriod struct { + + // The number of days the data is stored in the warm tier. + NumberOfDays *int32 + + // If set to true, the data is stored indefinitely in the warm tier. + Unlimited *bool + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/iotsitewise/validators.go b/service/iotsitewise/validators.go index 041c36c8258..e986ccdc9e7 100644 --- a/service/iotsitewise/validators.go +++ b/service/iotsitewise/validators.go @@ -210,6 +210,26 @@ func (m *validateOpCreateAsset) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpCreateAssetModelCompositeModel struct { +} + +func (*validateOpCreateAssetModelCompositeModel) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAssetModelCompositeModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAssetModelCompositeModelInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAssetModelCompositeModelInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateAssetModel struct { } @@ -370,6 +390,26 @@ func (m *validateOpDeleteAsset) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpDeleteAssetModelCompositeModel struct { +} + +func (*validateOpDeleteAssetModelCompositeModel) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAssetModelCompositeModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAssetModelCompositeModelInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAssetModelCompositeModelInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteAssetModel struct { } @@ -490,6 +530,46 @@ func (m *validateOpDescribeAccessPolicy) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpDescribeAction struct { +} + +func (*validateOpDescribeAction) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeActionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeActionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeAssetCompositeModel struct { +} + +func (*validateOpDescribeAssetCompositeModel) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeAssetCompositeModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeAssetCompositeModelInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeAssetCompositeModelInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeAsset struct { } @@ -510,6 +590,26 @@ func (m *validateOpDescribeAsset) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDescribeAssetModelCompositeModel struct { +} + +func (*validateOpDescribeAssetModelCompositeModel) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeAssetModelCompositeModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeAssetModelCompositeModelInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeAssetModelCompositeModelInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeAssetModel struct { } @@ -710,6 +810,46 @@ func (m *validateOpDisassociateTimeSeriesFromAssetProperty) HandleInitialize(ctx return next.HandleInitialize(ctx, in) } +type validateOpExecuteAction struct { +} + +func (*validateOpExecuteAction) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpExecuteAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ExecuteActionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpExecuteActionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpExecuteQuery struct { +} + +func (*validateOpExecuteQuery) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpExecuteQuery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ExecuteQueryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpExecuteQueryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetAssetPropertyAggregates struct { } @@ -750,6 +890,46 @@ func (m *validateOpGetInterpolatedAssetPropertyValues) HandleInitialize(ctx cont return next.HandleInitialize(ctx, in) } +type validateOpListActions struct { +} + +func (*validateOpListActions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListActions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListActionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListActionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAssetModelCompositeModels struct { +} + +func (*validateOpListAssetModelCompositeModels) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAssetModelCompositeModels) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAssetModelCompositeModelsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAssetModelCompositeModelsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAssetModelProperties struct { } @@ -830,6 +1010,26 @@ func (m *validateOpListAssociatedAssets) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpListCompositionRelationships struct { +} + +func (*validateOpListCompositionRelationships) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCompositionRelationships) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCompositionRelationshipsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCompositionRelationshipsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListDashboards struct { } @@ -1050,6 +1250,26 @@ func (m *validateOpUpdateAsset) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpUpdateAssetModelCompositeModel struct { +} + +func (*validateOpUpdateAssetModelCompositeModel) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAssetModelCompositeModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAssetModelCompositeModelInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAssetModelCompositeModelInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateAssetModel struct { } @@ -1230,6 +1450,10 @@ func addOpCreateAssetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAsset{}, middleware.After) } +func addOpCreateAssetModelCompositeModelValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAssetModelCompositeModel{}, middleware.After) +} + func addOpCreateAssetModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAssetModel{}, middleware.After) } @@ -1262,6 +1486,10 @@ func addOpDeleteAssetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAsset{}, middleware.After) } +func addOpDeleteAssetModelCompositeModelValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAssetModelCompositeModel{}, middleware.After) +} + func addOpDeleteAssetModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAssetModel{}, middleware.After) } @@ -1286,10 +1514,22 @@ func addOpDescribeAccessPolicyValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpDescribeAccessPolicy{}, middleware.After) } +func addOpDescribeActionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeAction{}, middleware.After) +} + +func addOpDescribeAssetCompositeModelValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeAssetCompositeModel{}, middleware.After) +} + func addOpDescribeAssetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeAsset{}, middleware.After) } +func addOpDescribeAssetModelCompositeModelValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeAssetModelCompositeModel{}, middleware.After) +} + func addOpDescribeAssetModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeAssetModel{}, middleware.After) } @@ -1330,6 +1570,14 @@ func addOpDisassociateTimeSeriesFromAssetPropertyValidationMiddleware(stack *mid return stack.Initialize.Add(&validateOpDisassociateTimeSeriesFromAssetProperty{}, middleware.After) } +func addOpExecuteActionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpExecuteAction{}, middleware.After) +} + +func addOpExecuteQueryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpExecuteQuery{}, middleware.After) +} + func addOpGetAssetPropertyAggregatesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAssetPropertyAggregates{}, middleware.After) } @@ -1338,6 +1586,14 @@ func addOpGetInterpolatedAssetPropertyValuesValidationMiddleware(stack *middlewa return stack.Initialize.Add(&validateOpGetInterpolatedAssetPropertyValues{}, middleware.After) } +func addOpListActionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListActions{}, middleware.After) +} + +func addOpListAssetModelCompositeModelsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAssetModelCompositeModels{}, middleware.After) +} + func addOpListAssetModelPropertiesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAssetModelProperties{}, middleware.After) } @@ -1354,6 +1610,10 @@ func addOpListAssociatedAssetsValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpListAssociatedAssets{}, middleware.After) } +func addOpListCompositionRelationshipsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCompositionRelationships{}, middleware.After) +} + func addOpListDashboardsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDashboards{}, middleware.After) } @@ -1398,6 +1658,10 @@ func addOpUpdateAssetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAsset{}, middleware.After) } +func addOpUpdateAssetModelCompositeModelValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAssetModelCompositeModel{}, middleware.After) +} + func addOpUpdateAssetModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAssetModel{}, middleware.After) } @@ -1426,6 +1690,21 @@ func addOpUpdateProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateProject{}, middleware.After) } +func validateActionPayload(v *types.ActionPayload) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ActionPayload"} + if v.StringValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("StringValue")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAlarms(v *types.Alarms) error { if v == nil { return nil @@ -1822,6 +2101,21 @@ func validateBatchGetAssetPropertyValueHistoryEntry(v *types.BatchGetAssetProper } } +func validateCsv(v *types.Csv) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Csv"} + if v.ColumnNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("ColumnNames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCustomerManagedS3Storage(v *types.CustomerManagedS3Storage) error { if v == nil { return nil @@ -1868,10 +2162,6 @@ func validateExpressionVariable(v *types.ExpressionVariable) error { } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) - } else if v.Value != nil { - if err := validateVariableValue(v.Value); err != nil { - invalidParams.AddNested("Value", err.(smithy.InvalidParamsError)) - } } if invalidParams.Len() > 0 { return invalidParams @@ -1915,6 +2205,23 @@ func validateFile(v *types.File) error { } } +func validateFileFormat(v *types.FileFormat) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FileFormat"} + if v.Csv != nil { + if err := validateCsv(v.Csv); err != nil { + invalidParams.AddNested("Csv", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateFiles(v []types.File) error { if v == nil { return nil @@ -2118,6 +2425,10 @@ func validateJobConfiguration(v *types.JobConfiguration) error { invalidParams := smithy.InvalidParamsError{Context: "JobConfiguration"} if v.FileFormat == nil { invalidParams.Add(smithy.NewErrParamRequired("FileFormat")) + } else if v.FileFormat != nil { + if err := validateFileFormat(v.FileFormat); err != nil { + invalidParams.AddNested("FileFormat", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -2380,6 +2691,21 @@ func validateResource(v *types.Resource) error { } } +func validateTargetResource(v *types.TargetResource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TargetResource"} + if v.AssetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTimeInNanos(v *types.TimeInNanos) error { if v == nil { return nil @@ -2472,21 +2798,6 @@ func validateUserIdentity(v *types.UserIdentity) error { } } -func validateVariableValue(v *types.VariableValue) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "VariableValue"} - if v.PropertyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PropertyId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpAssociateAssetsInput(v *AssociateAssetsInput) error { if v == nil { return nil @@ -2688,6 +2999,32 @@ func validateOpCreateAssetInput(v *CreateAssetInput) error { } } +func validateOpCreateAssetModelCompositeModelInput(v *CreateAssetModelCompositeModelInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAssetModelCompositeModelInput"} + if v.AssetModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelId")) + } + if v.AssetModelCompositeModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelCompositeModelName")) + } + if v.AssetModelCompositeModelType == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelCompositeModelType")) + } + if v.AssetModelCompositeModelProperties != nil { + if err := validateAssetModelPropertyDefinitions(v.AssetModelCompositeModelProperties); err != nil { + invalidParams.AddNested("AssetModelCompositeModelProperties", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateAssetModelInput(v *CreateAssetModelInput) error { if v == nil { return nil @@ -2879,6 +3216,24 @@ func validateOpDeleteAssetInput(v *DeleteAssetInput) error { } } +func validateOpDeleteAssetModelCompositeModelInput(v *DeleteAssetModelCompositeModelInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAssetModelCompositeModelInput"} + if v.AssetModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelId")) + } + if v.AssetModelCompositeModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelCompositeModelId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteAssetModelInput(v *DeleteAssetModelInput) error { if v == nil { return nil @@ -2969,6 +3324,39 @@ func validateOpDescribeAccessPolicyInput(v *DescribeAccessPolicyInput) error { } } +func validateOpDescribeActionInput(v *DescribeActionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeActionInput"} + if v.ActionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeAssetCompositeModelInput(v *DescribeAssetCompositeModelInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeAssetCompositeModelInput"} + if v.AssetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetId")) + } + if v.AssetCompositeModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetCompositeModelId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeAssetInput(v *DescribeAssetInput) error { if v == nil { return nil @@ -2984,6 +3372,24 @@ func validateOpDescribeAssetInput(v *DescribeAssetInput) error { } } +func validateOpDescribeAssetModelCompositeModelInput(v *DescribeAssetModelCompositeModelInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeAssetModelCompositeModelInput"} + if v.AssetModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelId")) + } + if v.AssetModelCompositeModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelCompositeModelId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeAssetModelInput(v *DescribeAssetModelInput) error { if v == nil { return nil @@ -3152,6 +3558,50 @@ func validateOpDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeS } } +func validateOpExecuteActionInput(v *ExecuteActionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExecuteActionInput"} + if v.TargetResource == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetResource")) + } else if v.TargetResource != nil { + if err := validateTargetResource(v.TargetResource); err != nil { + invalidParams.AddNested("TargetResource", err.(smithy.InvalidParamsError)) + } + } + if v.ActionDefinitionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionDefinitionId")) + } + if v.ActionPayload == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionPayload")) + } else if v.ActionPayload != nil { + if err := validateActionPayload(v.ActionPayload); err != nil { + invalidParams.AddNested("ActionPayload", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpExecuteQueryInput(v *ExecuteQueryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExecuteQueryInput"} + if v.QueryStatement == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryStatement")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetAssetPropertyAggregatesInput(v *GetAssetPropertyAggregatesInput) error { if v == nil { return nil @@ -3203,6 +3653,39 @@ func validateOpGetInterpolatedAssetPropertyValuesInput(v *GetInterpolatedAssetPr } } +func validateOpListActionsInput(v *ListActionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListActionsInput"} + if len(v.TargetResourceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("TargetResourceType")) + } + if v.TargetResourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetResourceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAssetModelCompositeModelsInput(v *ListAssetModelCompositeModelsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAssetModelCompositeModelsInput"} + if v.AssetModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAssetModelPropertiesInput(v *ListAssetModelPropertiesInput) error { if v == nil { return nil @@ -3266,6 +3749,21 @@ func validateOpListAssociatedAssetsInput(v *ListAssociatedAssetsInput) error { } } +func validateOpListCompositionRelationshipsInput(v *ListCompositionRelationshipsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCompositionRelationshipsInput"} + if v.AssetModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListDashboardsInput(v *ListDashboardsInput) error { if v == nil { return nil @@ -3466,6 +3964,32 @@ func validateOpUpdateAssetInput(v *UpdateAssetInput) error { } } +func validateOpUpdateAssetModelCompositeModelInput(v *UpdateAssetModelCompositeModelInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAssetModelCompositeModelInput"} + if v.AssetModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelId")) + } + if v.AssetModelCompositeModelId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelCompositeModelId")) + } + if v.AssetModelCompositeModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssetModelCompositeModelName")) + } + if v.AssetModelCompositeModelProperties != nil { + if err := validateAssetModelProperties(v.AssetModelCompositeModelProperties); err != nil { + invalidParams.AddNested("AssetModelCompositeModelProperties", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateAssetModelInput(v *UpdateAssetModelInput) error { if v == nil { return nil diff --git a/service/iottwinmaker/api_op_CancelMetadataTransferJob.go b/service/iottwinmaker/api_op_CancelMetadataTransferJob.go new file mode 100644 index 00000000000..25f2e88be94 --- /dev/null +++ b/service/iottwinmaker/api_op_CancelMetadataTransferJob.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iottwinmaker + +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/iottwinmaker/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Cancels the metadata transfer job. +func (c *Client) CancelMetadataTransferJob(ctx context.Context, params *CancelMetadataTransferJobInput, optFns ...func(*Options)) (*CancelMetadataTransferJobOutput, error) { + if params == nil { + params = &CancelMetadataTransferJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CancelMetadataTransferJob", params, optFns, c.addOperationCancelMetadataTransferJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CancelMetadataTransferJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CancelMetadataTransferJobInput struct { + + // The metadata transfer job Id. + // + // This member is required. + MetadataTransferJobId *string + + noSmithyDocumentSerde +} + +type CancelMetadataTransferJobOutput struct { + + // The metadata transfer job ARN. + // + // This member is required. + Arn *string + + // The metadata transfer job Id. + // + // This member is required. + MetadataTransferJobId *string + + // The metadata transfer job's status. + // + // This member is required. + Status *types.MetadataTransferJobStatus + + // Used to update the DateTime property. + // + // This member is required. + UpdateDateTime *time.Time + + // The metadata transfer job's progress. + Progress *types.MetadataTransferJobProgress + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCancelMetadataTransferJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelMetadataTransferJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelMetadataTransferJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CancelMetadataTransferJob"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opCancelMetadataTransferJobMiddleware(stack); err != nil { + return err + } + if err = addOpCancelMetadataTransferJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelMetadataTransferJob(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opCancelMetadataTransferJobMiddleware struct { +} + +func (*endpointPrefix_opCancelMetadataTransferJobMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCancelMetadataTransferJobMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opCancelMetadataTransferJobMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opCancelMetadataTransferJobMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opCancelMetadataTransferJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CancelMetadataTransferJob", + } +} diff --git a/service/iottwinmaker/api_op_CreateComponentType.go b/service/iottwinmaker/api_op_CreateComponentType.go index 3a8373af127..5d1ddb958bf 100644 --- a/service/iottwinmaker/api_op_CreateComponentType.go +++ b/service/iottwinmaker/api_op_CreateComponentType.go @@ -44,6 +44,10 @@ type CreateComponentTypeInput struct { // A friendly name for the component type. ComponentTypeName *string + // This is an object that maps strings to compositeComponentTypes of the + // componentType . CompositeComponentType is referenced by componentTypeId . + CompositeComponentTypes map[string]types.CompositeComponentTypeRequest + // The description of the component type. Description *string diff --git a/service/iottwinmaker/api_op_CreateEntity.go b/service/iottwinmaker/api_op_CreateEntity.go index 4c1cef4e457..4492fd8f9bb 100644 --- a/service/iottwinmaker/api_op_CreateEntity.go +++ b/service/iottwinmaker/api_op_CreateEntity.go @@ -45,6 +45,11 @@ type CreateEntityInput struct { // mapping must be unique to this object. Components map[string]types.ComponentRequest + // This is an object that maps strings to compositeComponent updates in the + // request. Each key of the map represents the componentPath of the + // compositeComponent . + CompositeComponents map[string]types.CompositeComponentRequest + // The description of the entity. Description *string diff --git a/service/iottwinmaker/api_op_CreateMetadataTransferJob.go b/service/iottwinmaker/api_op_CreateMetadataTransferJob.go new file mode 100644 index 00000000000..a725d54f48b --- /dev/null +++ b/service/iottwinmaker/api_op_CreateMetadataTransferJob.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iottwinmaker + +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/iottwinmaker/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a new metadata transfer job. +func (c *Client) CreateMetadataTransferJob(ctx context.Context, params *CreateMetadataTransferJobInput, optFns ...func(*Options)) (*CreateMetadataTransferJobOutput, error) { + if params == nil { + params = &CreateMetadataTransferJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateMetadataTransferJob", params, optFns, c.addOperationCreateMetadataTransferJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateMetadataTransferJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateMetadataTransferJobInput struct { + + // The metadata transfer job destination. + // + // This member is required. + Destination *types.DestinationConfiguration + + // The metadata transfer job sources. + // + // This member is required. + Sources []types.SourceConfiguration + + // The metadata transfer job description. + Description *string + + // The metadata transfer job Id. + MetadataTransferJobId *string + + noSmithyDocumentSerde +} + +type CreateMetadataTransferJobOutput struct { + + // The metadata transfer job ARN. + // + // This member is required. + Arn *string + + // The The metadata transfer job creation DateTime property. + // + // This member is required. + CreationDateTime *time.Time + + // The metadata transfer job Id. + // + // This member is required. + MetadataTransferJobId *string + + // The metadata transfer job response status. + // + // This member is required. + Status *types.MetadataTransferJobStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateMetadataTransferJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateMetadataTransferJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateMetadataTransferJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateMetadataTransferJob"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opCreateMetadataTransferJobMiddleware(stack); err != nil { + return err + } + if err = addOpCreateMetadataTransferJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMetadataTransferJob(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opCreateMetadataTransferJobMiddleware struct { +} + +func (*endpointPrefix_opCreateMetadataTransferJobMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opCreateMetadataTransferJobMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opCreateMetadataTransferJobMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opCreateMetadataTransferJobMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opCreateMetadataTransferJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateMetadataTransferJob", + } +} diff --git a/service/iottwinmaker/api_op_CreateWorkspace.go b/service/iottwinmaker/api_op_CreateWorkspace.go index 75181ece4f7..b971d82d9e1 100644 --- a/service/iottwinmaker/api_op_CreateWorkspace.go +++ b/service/iottwinmaker/api_op_CreateWorkspace.go @@ -30,17 +30,6 @@ func (c *Client) CreateWorkspace(ctx context.Context, params *CreateWorkspaceInp type CreateWorkspaceInput struct { - // The ARN of the execution role associated with the workspace. - // - // This member is required. - Role *string - - // The ARN of the S3 bucket where resources associated with the workspace are - // stored. - // - // This member is required. - S3Location *string - // The ID of the workspace. // // This member is required. @@ -49,6 +38,13 @@ type CreateWorkspaceInput struct { // The description of the workspace. Description *string + // The ARN of the execution role associated with the workspace. + Role *string + + // The ARN of the S3 bucket where resources associated with the workspace are + // stored. + S3Location *string + // Metadata that you can use to manage the workspace Tags map[string]string diff --git a/service/iottwinmaker/api_op_DeleteWorkspace.go b/service/iottwinmaker/api_op_DeleteWorkspace.go index c9ecaee7c9d..b3ff80b7c67 100644 --- a/service/iottwinmaker/api_op_DeleteWorkspace.go +++ b/service/iottwinmaker/api_op_DeleteWorkspace.go @@ -38,6 +38,10 @@ type DeleteWorkspaceInput struct { } type DeleteWorkspaceOutput struct { + + // The string that specifies the delete result for the workspace. + Message *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/iottwinmaker/api_op_ExecuteQuery.go b/service/iottwinmaker/api_op_ExecuteQuery.go index a0ccdbd4bc4..4cc3bb1f670 100644 --- a/service/iottwinmaker/api_op_ExecuteQuery.go +++ b/service/iottwinmaker/api_op_ExecuteQuery.go @@ -13,7 +13,10 @@ import ( ) // Run queries to access information from your knowledge graph of entities within -// individual workspaces. +// individual workspaces. The ExecuteQuery action only works with Amazon Web +// Services Java SDK2 (https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/home.html) +// . ExecuteQuery will not work with any Amazon Web Services Java SDK version < +// 2.x. func (c *Client) ExecuteQuery(ctx context.Context, params *ExecuteQueryInput, optFns ...func(*Options)) (*ExecuteQueryOutput, error) { if params == nil { params = &ExecuteQueryInput{} @@ -41,8 +44,7 @@ type ExecuteQueryInput struct { // This member is required. WorkspaceId *string - // The maximum number of results to return at one time. The default is 25. Valid - // Range: Minimum value of 1. Maximum value of 250. + // The maximum number of results to return at one time. The default is 50. MaxResults *int32 // The string that specifies the next page of results. @@ -186,8 +188,7 @@ var _ ExecuteQueryAPIClient = (*Client)(nil) // ExecuteQueryPaginatorOptions is the paginator options for ExecuteQuery type ExecuteQueryPaginatorOptions struct { - // The maximum number of results to return at one time. The default is 25. Valid - // Range: Minimum value of 1. Maximum value of 250. + // The maximum number of results to return at one time. The default is 50. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iottwinmaker/api_op_GetComponentType.go b/service/iottwinmaker/api_op_GetComponentType.go index 25086e1268b..8b6500c6489 100644 --- a/service/iottwinmaker/api_op_GetComponentType.go +++ b/service/iottwinmaker/api_op_GetComponentType.go @@ -74,6 +74,10 @@ type GetComponentTypeOutput struct { // The component type name. ComponentTypeName *string + // This is an object that maps strings to compositeComponentTypes of the + // componentType . CompositeComponentType is referenced by componentTypeId . + CompositeComponentTypes map[string]types.CompositeComponentTypeResponse + // The description of the component type. Description *string diff --git a/service/iottwinmaker/api_op_GetEntity.go b/service/iottwinmaker/api_op_GetEntity.go index f28084525b6..235979742c8 100644 --- a/service/iottwinmaker/api_op_GetEntity.go +++ b/service/iottwinmaker/api_op_GetEntity.go @@ -91,6 +91,10 @@ type GetEntityOutput struct { // This member is required. WorkspaceId *string + // This flag notes whether all components are returned in the API response. The + // maximum number of components returned is 30. + AreAllComponentsReturned *bool + // An object that maps strings to the components in the entity. Each string in the // mapping must be unique to this object. Components map[string]types.ComponentResponse diff --git a/service/iottwinmaker/api_op_GetMetadataTransferJob.go b/service/iottwinmaker/api_op_GetMetadataTransferJob.go new file mode 100644 index 00000000000..2835acb1172 --- /dev/null +++ b/service/iottwinmaker/api_op_GetMetadataTransferJob.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iottwinmaker + +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/iottwinmaker/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets a nmetadata transfer job. +func (c *Client) GetMetadataTransferJob(ctx context.Context, params *GetMetadataTransferJobInput, optFns ...func(*Options)) (*GetMetadataTransferJobOutput, error) { + if params == nil { + params = &GetMetadataTransferJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetMetadataTransferJob", params, optFns, c.addOperationGetMetadataTransferJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetMetadataTransferJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetMetadataTransferJobInput struct { + + // The metadata transfer job Id. + // + // This member is required. + MetadataTransferJobId *string + + noSmithyDocumentSerde +} + +type GetMetadataTransferJobOutput struct { + + // The metadata transfer job ARN. + // + // This member is required. + Arn *string + + // The metadata transfer job's creation DateTime property. + // + // This member is required. + CreationDateTime *time.Time + + // The metadata transfer job's destination. + // + // This member is required. + Destination *types.DestinationConfiguration + + // The metadata transfer job Id. + // + // This member is required. + MetadataTransferJobId *string + + // The metadata transfer job's role. + // + // This member is required. + MetadataTransferJobRole *string + + // The metadata transfer job's sources. + // + // This member is required. + Sources []types.SourceConfiguration + + // The metadata transfer job's status. + // + // This member is required. + Status *types.MetadataTransferJobStatus + + // The metadata transfer job's update DateTime property. + // + // This member is required. + UpdateDateTime *time.Time + + // The metadata transfer job description. + Description *string + + // The metadata transfer job's progress. + Progress *types.MetadataTransferJobProgress + + // The metadata transfer job's report URL. + ReportUrl *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetMetadataTransferJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMetadataTransferJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMetadataTransferJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetMetadataTransferJob"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opGetMetadataTransferJobMiddleware(stack); err != nil { + return err + } + if err = addOpGetMetadataTransferJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMetadataTransferJob(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opGetMetadataTransferJobMiddleware struct { +} + +func (*endpointPrefix_opGetMetadataTransferJobMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opGetMetadataTransferJobMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opGetMetadataTransferJobMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opGetMetadataTransferJobMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +func newServiceMetadataMiddleware_opGetMetadataTransferJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetMetadataTransferJob", + } +} diff --git a/service/iottwinmaker/api_op_GetPropertyValue.go b/service/iottwinmaker/api_op_GetPropertyValue.go index 51b24b9369e..57e722c3f83 100644 --- a/service/iottwinmaker/api_op_GetPropertyValue.go +++ b/service/iottwinmaker/api_op_GetPropertyValue.go @@ -45,6 +45,10 @@ type GetPropertyValueInput struct { // The name of the component whose property values the operation returns. ComponentName *string + // This string specifies the path to the composite component, starting from the + // top-level component. + ComponentPath *string + // The ID of the component type whose property values the operation returns. ComponentTypeId *string diff --git a/service/iottwinmaker/api_op_GetPropertyValueHistory.go b/service/iottwinmaker/api_op_GetPropertyValueHistory.go index ee99357ae82..1506378ca54 100644 --- a/service/iottwinmaker/api_op_GetPropertyValueHistory.go +++ b/service/iottwinmaker/api_op_GetPropertyValueHistory.go @@ -47,6 +47,10 @@ type GetPropertyValueHistoryInput struct { // The name of the component. ComponentName *string + // This string specifies the path to the composite component, starting from the + // top-level component. + ComponentPath *string + // The ID of the component type. ComponentTypeId *string diff --git a/service/iottwinmaker/api_op_GetWorkspace.go b/service/iottwinmaker/api_op_GetWorkspace.go index a6c4e56fb89..07f3909fd70 100644 --- a/service/iottwinmaker/api_op_GetWorkspace.go +++ b/service/iottwinmaker/api_op_GetWorkspace.go @@ -50,17 +50,6 @@ type GetWorkspaceOutput struct { // This member is required. CreationDateTime *time.Time - // The ARN of the execution role associated with the workspace. - // - // This member is required. - Role *string - - // The ARN of the S3 bucket where resources associated with the workspace are - // stored. - // - // This member is required. - S3Location *string - // The date and time when the workspace was last updated. // // This member is required. @@ -74,6 +63,16 @@ type GetWorkspaceOutput struct { // The description of the workspace. Description *string + // A list of services that are linked to the workspace. + LinkedServices []string + + // The ARN of the execution role associated with the workspace. + Role *string + + // The ARN of the S3 bucket where resources associated with the workspace are + // stored. + S3Location *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/iottwinmaker/api_op_ListComponents.go b/service/iottwinmaker/api_op_ListComponents.go new file mode 100644 index 00000000000..6b4fb3d4326 --- /dev/null +++ b/service/iottwinmaker/api_op_ListComponents.go @@ -0,0 +1,278 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iottwinmaker + +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/iottwinmaker/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API lists the components of an entity. +func (c *Client) ListComponents(ctx context.Context, params *ListComponentsInput, optFns ...func(*Options)) (*ListComponentsOutput, error) { + if params == nil { + params = &ListComponentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListComponents", params, optFns, c.addOperationListComponentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListComponentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListComponentsInput struct { + + // The ID for the entity whose metadata (component/properties) is returned by the + // operation. + // + // This member is required. + EntityId *string + + // The workspace ID. + // + // This member is required. + WorkspaceId *string + + // This string specifies the path to the composite component, starting from the + // top-level component. + ComponentPath *string + + // The maximum number of results returned at one time. The default is 25. + MaxResults *int32 + + // The string that specifies the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListComponentsOutput struct { + + // A list of objects that contain information about the components. + // + // This member is required. + ComponentSummaries []types.ComponentSummary + + // The string that specifies the next page of component results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListComponentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListComponents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListComponents{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListComponents"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListComponentsMiddleware(stack); err != nil { + return err + } + if err = addOpListComponentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListComponents(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opListComponentsMiddleware struct { +} + +func (*endpointPrefix_opListComponentsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListComponentsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListComponentsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListComponentsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListComponentsAPIClient is a client that implements the ListComponents +// operation. +type ListComponentsAPIClient interface { + ListComponents(context.Context, *ListComponentsInput, ...func(*Options)) (*ListComponentsOutput, error) +} + +var _ ListComponentsAPIClient = (*Client)(nil) + +// ListComponentsPaginatorOptions is the paginator options for ListComponents +type ListComponentsPaginatorOptions struct { + // The maximum number of results returned at one time. The default is 25. + 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 +} + +// ListComponentsPaginator is a paginator for ListComponents +type ListComponentsPaginator struct { + options ListComponentsPaginatorOptions + client ListComponentsAPIClient + params *ListComponentsInput + nextToken *string + firstPage bool +} + +// NewListComponentsPaginator returns a new ListComponentsPaginator +func NewListComponentsPaginator(client ListComponentsAPIClient, params *ListComponentsInput, optFns ...func(*ListComponentsPaginatorOptions)) *ListComponentsPaginator { + if params == nil { + params = &ListComponentsInput{} + } + + options := ListComponentsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComponentsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListComponents page. +func (p *ListComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComponentsOutput, 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.ListComponents(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_opListComponents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListComponents", + } +} diff --git a/service/iottwinmaker/api_op_ListMetadataTransferJobs.go b/service/iottwinmaker/api_op_ListMetadataTransferJobs.go new file mode 100644 index 00000000000..b55d1a2ca14 --- /dev/null +++ b/service/iottwinmaker/api_op_ListMetadataTransferJobs.go @@ -0,0 +1,278 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iottwinmaker + +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/iottwinmaker/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the metadata transfer jobs. +func (c *Client) ListMetadataTransferJobs(ctx context.Context, params *ListMetadataTransferJobsInput, optFns ...func(*Options)) (*ListMetadataTransferJobsOutput, error) { + if params == nil { + params = &ListMetadataTransferJobsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListMetadataTransferJobs", params, optFns, c.addOperationListMetadataTransferJobsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListMetadataTransferJobsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListMetadataTransferJobsInput struct { + + // The metadata transfer job's destination type. + // + // This member is required. + DestinationType types.DestinationType + + // The metadata transfer job's source type. + // + // This member is required. + SourceType types.SourceType + + // An object that filters metadata transfer jobs. + Filters []types.ListMetadataTransferJobsFilter + + // The maximum number of results to return at one time. + MaxResults *int32 + + // The string that specifies the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListMetadataTransferJobsOutput struct { + + // The metadata transfer job summaries. + // + // This member is required. + MetadataTransferJobSummaries []types.MetadataTransferJobSummary + + // The string that specifies the next page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListMetadataTransferJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListMetadataTransferJobs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListMetadataTransferJobs{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListMetadataTransferJobs"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListMetadataTransferJobsMiddleware(stack); err != nil { + return err + } + if err = addOpListMetadataTransferJobsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMetadataTransferJobs(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opListMetadataTransferJobsMiddleware struct { +} + +func (*endpointPrefix_opListMetadataTransferJobsMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListMetadataTransferJobsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListMetadataTransferJobsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListMetadataTransferJobsMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListMetadataTransferJobsAPIClient is a client that implements the +// ListMetadataTransferJobs operation. +type ListMetadataTransferJobsAPIClient interface { + ListMetadataTransferJobs(context.Context, *ListMetadataTransferJobsInput, ...func(*Options)) (*ListMetadataTransferJobsOutput, error) +} + +var _ ListMetadataTransferJobsAPIClient = (*Client)(nil) + +// ListMetadataTransferJobsPaginatorOptions is the paginator options for +// ListMetadataTransferJobs +type ListMetadataTransferJobsPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListMetadataTransferJobsPaginator is a paginator for ListMetadataTransferJobs +type ListMetadataTransferJobsPaginator struct { + options ListMetadataTransferJobsPaginatorOptions + client ListMetadataTransferJobsAPIClient + params *ListMetadataTransferJobsInput + nextToken *string + firstPage bool +} + +// NewListMetadataTransferJobsPaginator returns a new +// ListMetadataTransferJobsPaginator +func NewListMetadataTransferJobsPaginator(client ListMetadataTransferJobsAPIClient, params *ListMetadataTransferJobsInput, optFns ...func(*ListMetadataTransferJobsPaginatorOptions)) *ListMetadataTransferJobsPaginator { + if params == nil { + params = &ListMetadataTransferJobsInput{} + } + + options := ListMetadataTransferJobsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListMetadataTransferJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMetadataTransferJobsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListMetadataTransferJobs page. +func (p *ListMetadataTransferJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMetadataTransferJobsOutput, 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.ListMetadataTransferJobs(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_opListMetadataTransferJobs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListMetadataTransferJobs", + } +} diff --git a/service/iottwinmaker/api_op_ListProperties.go b/service/iottwinmaker/api_op_ListProperties.go new file mode 100644 index 00000000000..69d0bfaf2e2 --- /dev/null +++ b/service/iottwinmaker/api_op_ListProperties.go @@ -0,0 +1,281 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iottwinmaker + +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/iottwinmaker/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API lists the properties of a component. +func (c *Client) ListProperties(ctx context.Context, params *ListPropertiesInput, optFns ...func(*Options)) (*ListPropertiesOutput, error) { + if params == nil { + params = &ListPropertiesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProperties", params, optFns, c.addOperationListPropertiesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPropertiesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPropertiesInput struct { + + // The ID for the entity whose metadata (component/properties) is returned by the + // operation. + // + // This member is required. + EntityId *string + + // The workspace ID. + // + // This member is required. + WorkspaceId *string + + // The name of the component whose properties are returned by the operation. + ComponentName *string + + // This string specifies the path to the composite component, starting from the + // top-level component. + ComponentPath *string + + // The maximum number of results returned at one time. The default is 25. + MaxResults *int32 + + // The string that specifies the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListPropertiesOutput struct { + + // A list of objects that contain information about the properties. + // + // This member is required. + PropertySummaries []types.PropertySummary + + // The string that specifies the next page of property results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPropertiesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProperties{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProperties{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListProperties"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addEndpointPrefix_opListPropertiesMiddleware(stack); err != nil { + return err + } + if err = addOpListPropertiesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProperties(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type endpointPrefix_opListPropertiesMiddleware struct { +} + +func (*endpointPrefix_opListPropertiesMiddleware) ID() string { + return "EndpointHostPrefix" +} + +func (m *endpointPrefix_opListPropertiesMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + req.URL.Host = "api." + req.URL.Host + + return next.HandleFinalize(ctx, in) +} +func addEndpointPrefix_opListPropertiesMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&endpointPrefix_opListPropertiesMiddleware{}, "ResolveEndpointV2", middleware.After) +} + +// ListPropertiesAPIClient is a client that implements the ListProperties +// operation. +type ListPropertiesAPIClient interface { + ListProperties(context.Context, *ListPropertiesInput, ...func(*Options)) (*ListPropertiesOutput, error) +} + +var _ ListPropertiesAPIClient = (*Client)(nil) + +// ListPropertiesPaginatorOptions is the paginator options for ListProperties +type ListPropertiesPaginatorOptions struct { + // The maximum number of results returned at one time. The default is 25. + 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 +} + +// ListPropertiesPaginator is a paginator for ListProperties +type ListPropertiesPaginator struct { + options ListPropertiesPaginatorOptions + client ListPropertiesAPIClient + params *ListPropertiesInput + nextToken *string + firstPage bool +} + +// NewListPropertiesPaginator returns a new ListPropertiesPaginator +func NewListPropertiesPaginator(client ListPropertiesAPIClient, params *ListPropertiesInput, optFns ...func(*ListPropertiesPaginatorOptions)) *ListPropertiesPaginator { + if params == nil { + params = &ListPropertiesInput{} + } + + options := ListPropertiesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPropertiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPropertiesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListProperties page. +func (p *ListPropertiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPropertiesOutput, 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.ListProperties(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_opListProperties(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListProperties", + } +} diff --git a/service/iottwinmaker/api_op_UpdateComponentType.go b/service/iottwinmaker/api_op_UpdateComponentType.go index a91f6bb5ad4..5d9ff23304f 100644 --- a/service/iottwinmaker/api_op_UpdateComponentType.go +++ b/service/iottwinmaker/api_op_UpdateComponentType.go @@ -43,6 +43,10 @@ type UpdateComponentTypeInput struct { // The component type name. ComponentTypeName *string + // This is an object that maps strings to compositeComponentTypes of the + // componentType . CompositeComponentType is referenced by componentTypeId . + CompositeComponentTypes map[string]types.CompositeComponentTypeRequest + // The description of the component type. Description *string diff --git a/service/iottwinmaker/api_op_UpdateEntity.go b/service/iottwinmaker/api_op_UpdateEntity.go index 474f94c093b..91ed6c2cd26 100644 --- a/service/iottwinmaker/api_op_UpdateEntity.go +++ b/service/iottwinmaker/api_op_UpdateEntity.go @@ -45,6 +45,11 @@ type UpdateEntityInput struct { // string in the mapping must be unique to this object. ComponentUpdates map[string]types.ComponentUpdateRequest + // This is an object that maps strings to compositeComponent updates in the + // request. Each key of the map represents the componentPath of the + // compositeComponent . + CompositeComponentUpdates map[string]types.CompositeComponentUpdateRequest + // The description of the entity. Description *string diff --git a/service/iottwinmaker/api_op_UpdateWorkspace.go b/service/iottwinmaker/api_op_UpdateWorkspace.go index c017fb748d1..7c144a11410 100644 --- a/service/iottwinmaker/api_op_UpdateWorkspace.go +++ b/service/iottwinmaker/api_op_UpdateWorkspace.go @@ -41,6 +41,10 @@ type UpdateWorkspaceInput struct { // The ARN of the execution role associated with the workspace. Role *string + // The ARN of the S3 bucket where resources associated with the workspace are + // stored. + S3Location *string + noSmithyDocumentSerde } diff --git a/service/iottwinmaker/deserializers.go b/service/iottwinmaker/deserializers.go index 14525cec782..80c7a09824d 100644 --- a/service/iottwinmaker/deserializers.go +++ b/service/iottwinmaker/deserializers.go @@ -178,14 +178,14 @@ func awsRestjson1_deserializeOpDocumentBatchPutPropertyValuesOutput(v **BatchPut return nil } -type awsRestjson1_deserializeOpCreateComponentType struct { +type awsRestjson1_deserializeOpCancelMetadataTransferJob struct { } -func (*awsRestjson1_deserializeOpCreateComponentType) ID() string { +func (*awsRestjson1_deserializeOpCancelMetadataTransferJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateComponentType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCancelMetadataTransferJob) 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) @@ -199,9 +199,9 @@ func (m *awsRestjson1_deserializeOpCreateComponentType) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateComponentType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCancelMetadataTransferJob(response, &metadata) } - output := &CreateComponentTypeOutput{} + output := &CancelMetadataTransferJobOutput{} out.Result = output var buff [1024]byte @@ -222,7 +222,7 @@ func (m *awsRestjson1_deserializeOpCreateComponentType) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateComponentTypeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCancelMetadataTransferJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -235,7 +235,7 @@ func (m *awsRestjson1_deserializeOpCreateComponentType) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateComponentType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCancelMetadataTransferJob(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)} @@ -285,8 +285,8 @@ func awsRestjson1_deserializeOpErrorCreateComponentType(response *smithyhttp.Res case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -304,7 +304,7 @@ func awsRestjson1_deserializeOpErrorCreateComponentType(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentCreateComponentTypeOutput(v **CreateComponentTypeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCancelMetadataTransferJobOutput(v **CancelMetadataTransferJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -317,9 +317,9 @@ func awsRestjson1_deserializeOpDocumentCreateComponentTypeOutput(v **CreateCompo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateComponentTypeOutput + var sv *CancelMetadataTransferJobOutput if *v == nil { - sv = &CreateComponentTypeOutput{} + sv = &CancelMetadataTransferJobOutput{} } else { sv = *v } @@ -335,7 +335,26 @@ func awsRestjson1_deserializeOpDocumentCreateComponentTypeOutput(v **CreateCompo sv.Arn = ptr.String(jtv) } - case "creationDateTime": + case "metadataTransferJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.MetadataTransferJobId = ptr.String(jtv) + } + + case "progress": + if err := awsRestjson1_deserializeDocumentMetadataTransferJobProgress(&sv.Progress, value); err != nil { + return err + } + + case "status": + if err := awsRestjson1_deserializeDocumentMetadataTransferJobStatus(&sv.Status, value); err != nil { + return err + } + + case "updateDateTime": if value != nil { switch jtv := value.(type) { case json.Number: @@ -343,7 +362,7 @@ func awsRestjson1_deserializeOpDocumentCreateComponentTypeOutput(v **CreateCompo if err != nil { return err } - sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -351,15 +370,6 @@ func awsRestjson1_deserializeOpDocumentCreateComponentTypeOutput(v **CreateCompo } } - case "state": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected State to be of type string, got %T instead", value) - } - sv.State = types.State(jtv) - } - default: _, _ = key, value @@ -369,14 +379,14 @@ func awsRestjson1_deserializeOpDocumentCreateComponentTypeOutput(v **CreateCompo return nil } -type awsRestjson1_deserializeOpCreateEntity struct { +type awsRestjson1_deserializeOpCreateComponentType struct { } -func (*awsRestjson1_deserializeOpCreateEntity) ID() string { +func (*awsRestjson1_deserializeOpCreateComponentType) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateEntity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateComponentType) 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) @@ -390,9 +400,9 @@ func (m *awsRestjson1_deserializeOpCreateEntity) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateEntity(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateComponentType(response, &metadata) } - output := &CreateEntityOutput{} + output := &CreateComponentTypeOutput{} out.Result = output var buff [1024]byte @@ -413,7 +423,7 @@ func (m *awsRestjson1_deserializeOpCreateEntity) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateEntityOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateComponentTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -426,7 +436,7 @@ func (m *awsRestjson1_deserializeOpCreateEntity) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateEntity(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateComponentType(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)} @@ -495,7 +505,7 @@ func awsRestjson1_deserializeOpErrorCreateEntity(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreateEntityOutput(v **CreateEntityOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateComponentTypeOutput(v **CreateComponentTypeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -508,9 +518,9 @@ func awsRestjson1_deserializeOpDocumentCreateEntityOutput(v **CreateEntityOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateEntityOutput + var sv *CreateComponentTypeOutput if *v == nil { - sv = &CreateEntityOutput{} + sv = &CreateComponentTypeOutput{} } else { sv = *v } @@ -542,15 +552,6 @@ func awsRestjson1_deserializeOpDocumentCreateEntityOutput(v **CreateEntityOutput } } - case "entityId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) - } - sv.EntityId = ptr.String(jtv) - } - case "state": if value != nil { jtv, ok := value.(string) @@ -569,14 +570,14 @@ func awsRestjson1_deserializeOpDocumentCreateEntityOutput(v **CreateEntityOutput return nil } -type awsRestjson1_deserializeOpCreateScene struct { +type awsRestjson1_deserializeOpCreateEntity struct { } -func (*awsRestjson1_deserializeOpCreateScene) ID() string { +func (*awsRestjson1_deserializeOpCreateEntity) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateScene) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateEntity) 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) @@ -590,9 +591,9 @@ func (m *awsRestjson1_deserializeOpCreateScene) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateScene(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateEntity(response, &metadata) } - output := &CreateSceneOutput{} + output := &CreateEntityOutput{} out.Result = output var buff [1024]byte @@ -613,7 +614,7 @@ func (m *awsRestjson1_deserializeOpCreateScene) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateSceneOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateEntityOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -626,7 +627,7 @@ func (m *awsRestjson1_deserializeOpCreateScene) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateScene(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateEntity(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)} @@ -695,7 +696,7 @@ func awsRestjson1_deserializeOpErrorCreateScene(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentCreateSceneOutput(v **CreateSceneOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateEntityOutput(v **CreateEntityOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -708,9 +709,9 @@ func awsRestjson1_deserializeOpDocumentCreateSceneOutput(v **CreateSceneOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateSceneOutput + var sv *CreateEntityOutput if *v == nil { - sv = &CreateSceneOutput{} + sv = &CreateEntityOutput{} } else { sv = *v } @@ -742,6 +743,24 @@ func awsRestjson1_deserializeOpDocumentCreateSceneOutput(v **CreateSceneOutput, } } + case "entityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) + } + sv.EntityId = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected State to be of type string, got %T instead", value) + } + sv.State = types.State(jtv) + } + default: _, _ = key, value @@ -751,14 +770,14 @@ func awsRestjson1_deserializeOpDocumentCreateSceneOutput(v **CreateSceneOutput, return nil } -type awsRestjson1_deserializeOpCreateSyncJob struct { +type awsRestjson1_deserializeOpCreateMetadataTransferJob struct { } -func (*awsRestjson1_deserializeOpCreateSyncJob) ID() string { +func (*awsRestjson1_deserializeOpCreateMetadataTransferJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateSyncJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateMetadataTransferJob) 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) @@ -772,9 +791,9 @@ func (m *awsRestjson1_deserializeOpCreateSyncJob) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateSyncJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateMetadataTransferJob(response, &metadata) } - output := &CreateSyncJobOutput{} + output := &CreateMetadataTransferJobOutput{} out.Result = output var buff [1024]byte @@ -795,7 +814,7 @@ func (m *awsRestjson1_deserializeOpCreateSyncJob) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateSyncJobOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateMetadataTransferJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -808,7 +827,7 @@ func (m *awsRestjson1_deserializeOpCreateSyncJob) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateSyncJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateMetadataTransferJob(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)} @@ -858,6 +877,9 @@ func awsRestjson1_deserializeOpErrorCreateSyncJob(response *smithyhttp.Response, case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) @@ -877,7 +899,7 @@ func awsRestjson1_deserializeOpErrorCreateSyncJob(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreateSyncJobOutput(v **CreateSyncJobOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateMetadataTransferJobOutput(v **CreateMetadataTransferJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -890,9 +912,9 @@ func awsRestjson1_deserializeOpDocumentCreateSyncJobOutput(v **CreateSyncJobOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateSyncJobOutput + var sv *CreateMetadataTransferJobOutput if *v == nil { - sv = &CreateSyncJobOutput{} + sv = &CreateMetadataTransferJobOutput{} } else { sv = *v } @@ -924,13 +946,18 @@ func awsRestjson1_deserializeOpDocumentCreateSyncJobOutput(v **CreateSyncJobOutp } } - case "state": + case "metadataTransferJobId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SyncJobState to be of type string, got %T instead", value) + return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - sv.State = types.SyncJobState(jtv) + sv.MetadataTransferJobId = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentMetadataTransferJobStatus(&sv.Status, value); err != nil { + return err } default: @@ -942,14 +969,14 @@ func awsRestjson1_deserializeOpDocumentCreateSyncJobOutput(v **CreateSyncJobOutp return nil } -type awsRestjson1_deserializeOpCreateWorkspace struct { +type awsRestjson1_deserializeOpCreateScene struct { } -func (*awsRestjson1_deserializeOpCreateWorkspace) ID() string { +func (*awsRestjson1_deserializeOpCreateScene) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateScene) 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) @@ -963,9 +990,9 @@ func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateScene(response, &metadata) } - output := &CreateWorkspaceOutput{} + output := &CreateSceneOutput{} out.Result = output var buff [1024]byte @@ -986,7 +1013,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateSceneOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -999,7 +1026,7 @@ func (m *awsRestjson1_deserializeOpCreateWorkspace) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateScene(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)} @@ -1068,7 +1095,7 @@ func awsRestjson1_deserializeOpErrorCreateWorkspace(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspaceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateSceneOutput(v **CreateSceneOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1081,9 +1108,9 @@ func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspace return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateWorkspaceOutput + var sv *CreateSceneOutput if *v == nil { - sv = &CreateWorkspaceOutput{} + sv = &CreateSceneOutput{} } else { sv = *v } @@ -1124,14 +1151,14 @@ func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspace return nil } -type awsRestjson1_deserializeOpDeleteComponentType struct { +type awsRestjson1_deserializeOpCreateSyncJob struct { } -func (*awsRestjson1_deserializeOpDeleteComponentType) ID() string { +func (*awsRestjson1_deserializeOpCreateSyncJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteComponentType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateSyncJob) 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) @@ -1145,9 +1172,9 @@ func (m *awsRestjson1_deserializeOpDeleteComponentType) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteComponentType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateSyncJob(response, &metadata) } - output := &DeleteComponentTypeOutput{} + output := &CreateSyncJobOutput{} out.Result = output var buff [1024]byte @@ -1168,7 +1195,7 @@ func (m *awsRestjson1_deserializeOpDeleteComponentType) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteComponentTypeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateSyncJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1181,7 +1208,7 @@ func (m *awsRestjson1_deserializeOpDeleteComponentType) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteComponentType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateSyncJob(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)} @@ -1225,11 +1252,14 @@ func awsRestjson1_deserializeOpErrorDeleteComponentType(response *smithyhttp.Res case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -1247,7 +1277,7 @@ func awsRestjson1_deserializeOpErrorDeleteComponentType(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentDeleteComponentTypeOutput(v **DeleteComponentTypeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateSyncJobOutput(v **CreateSyncJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1260,22 +1290,47 @@ func awsRestjson1_deserializeOpDocumentDeleteComponentTypeOutput(v **DeleteCompo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteComponentTypeOutput + var sv *CreateSyncJobOutput if *v == nil { - sv = &DeleteComponentTypeOutput{} + sv = &CreateSyncJobOutput{} } 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 TwinMakerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "state": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected State to be of type string, got %T instead", value) + return fmt.Errorf("expected SyncJobState to be of type string, got %T instead", value) } - sv.State = types.State(jtv) + sv.State = types.SyncJobState(jtv) } default: @@ -1287,14 +1342,14 @@ func awsRestjson1_deserializeOpDocumentDeleteComponentTypeOutput(v **DeleteCompo return nil } -type awsRestjson1_deserializeOpDeleteEntity struct { +type awsRestjson1_deserializeOpCreateWorkspace struct { } -func (*awsRestjson1_deserializeOpDeleteEntity) ID() string { +func (*awsRestjson1_deserializeOpCreateWorkspace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteEntity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateWorkspace) 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) @@ -1308,9 +1363,9 @@ func (m *awsRestjson1_deserializeOpDeleteEntity) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteEntity(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkspace(response, &metadata) } - output := &DeleteEntityOutput{} + output := &CreateWorkspaceOutput{} out.Result = output var buff [1024]byte @@ -1331,7 +1386,7 @@ func (m *awsRestjson1_deserializeOpDeleteEntity) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteEntityOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1344,7 +1399,7 @@ func (m *awsRestjson1_deserializeOpDeleteEntity) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteEntity(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateWorkspace(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)} @@ -1385,12 +1440,15 @@ func awsRestjson1_deserializeOpErrorDeleteEntity(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) @@ -1410,7 +1468,7 @@ func awsRestjson1_deserializeOpErrorDeleteEntity(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDeleteEntityOutput(v **DeleteEntityOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1423,22 +1481,38 @@ func awsRestjson1_deserializeOpDocumentDeleteEntityOutput(v **DeleteEntityOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteEntityOutput + var sv *CreateWorkspaceOutput if *v == nil { - sv = &DeleteEntityOutput{} + sv = &CreateWorkspaceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "state": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected State to be of type string, got %T instead", value) + return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.State = types.State(jtv) } default: @@ -1450,14 +1524,14 @@ func awsRestjson1_deserializeOpDocumentDeleteEntityOutput(v **DeleteEntityOutput return nil } -type awsRestjson1_deserializeOpDeleteScene struct { +type awsRestjson1_deserializeOpDeleteComponentType struct { } -func (*awsRestjson1_deserializeOpDeleteScene) ID() string { +func (*awsRestjson1_deserializeOpDeleteComponentType) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteScene) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteComponentType) 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) @@ -1471,15 +1545,43 @@ func (m *awsRestjson1_deserializeOpDeleteScene) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteScene(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteComponentType(response, &metadata) } - output := &DeleteSceneOutput{} + output := &DeleteComponentTypeOutput{} 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_deserializeOpDocumentDeleteComponentTypeOutput(&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_deserializeOpErrorDeleteScene(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteComponentType(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)} @@ -1545,14 +1647,54 @@ func awsRestjson1_deserializeOpErrorDeleteScene(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpDeleteSyncJob struct { +func awsRestjson1_deserializeOpDocumentDeleteComponentTypeOutput(v **DeleteComponentTypeOutput, 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 *DeleteComponentTypeOutput + if *v == nil { + sv = &DeleteComponentTypeOutput{} + } 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 State to be of type string, got %T instead", value) + } + sv.State = types.State(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteSyncJob) ID() string { +type awsRestjson1_deserializeOpDeleteEntity struct { +} + +func (*awsRestjson1_deserializeOpDeleteEntity) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteSyncJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteEntity) 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) @@ -1566,9 +1708,9 @@ func (m *awsRestjson1_deserializeOpDeleteSyncJob) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteSyncJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteEntity(response, &metadata) } - output := &DeleteSyncJobOutput{} + output := &DeleteEntityOutput{} out.Result = output var buff [1024]byte @@ -1589,7 +1731,7 @@ func (m *awsRestjson1_deserializeOpDeleteSyncJob) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteSyncJobOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteEntityOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1602,7 +1744,7 @@ func (m *awsRestjson1_deserializeOpDeleteSyncJob) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteSyncJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteEntity(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)} @@ -1643,9 +1785,6 @@ func awsRestjson1_deserializeOpErrorDeleteSyncJob(response *smithyhttp.Response, } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -1671,7 +1810,7 @@ func awsRestjson1_deserializeOpErrorDeleteSyncJob(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDeleteSyncJobOutput(v **DeleteSyncJobOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteEntityOutput(v **DeleteEntityOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1684,9 +1823,9 @@ func awsRestjson1_deserializeOpDocumentDeleteSyncJobOutput(v **DeleteSyncJobOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteSyncJobOutput + var sv *DeleteEntityOutput if *v == nil { - sv = &DeleteSyncJobOutput{} + sv = &DeleteEntityOutput{} } else { sv = *v } @@ -1697,9 +1836,9 @@ func awsRestjson1_deserializeOpDocumentDeleteSyncJobOutput(v **DeleteSyncJobOutp if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SyncJobState to be of type string, got %T instead", value) + return fmt.Errorf("expected State to be of type string, got %T instead", value) } - sv.State = types.SyncJobState(jtv) + sv.State = types.State(jtv) } default: @@ -1711,14 +1850,14 @@ func awsRestjson1_deserializeOpDocumentDeleteSyncJobOutput(v **DeleteSyncJobOutp return nil } -type awsRestjson1_deserializeOpDeleteWorkspace struct { +type awsRestjson1_deserializeOpDeleteScene struct { } -func (*awsRestjson1_deserializeOpDeleteWorkspace) ID() string { +func (*awsRestjson1_deserializeOpDeleteScene) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteScene) 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) @@ -1732,15 +1871,15 @@ func (m *awsRestjson1_deserializeOpDeleteWorkspace) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteScene(response, &metadata) } - output := &DeleteWorkspaceOutput{} + output := &DeleteSceneOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteScene(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)} @@ -1806,14 +1945,14 @@ func awsRestjson1_deserializeOpErrorDeleteWorkspace(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpExecuteQuery struct { +type awsRestjson1_deserializeOpDeleteSyncJob struct { } -func (*awsRestjson1_deserializeOpExecuteQuery) ID() string { +func (*awsRestjson1_deserializeOpDeleteSyncJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpExecuteQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteSyncJob) 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) @@ -1827,9 +1966,9 @@ func (m *awsRestjson1_deserializeOpExecuteQuery) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorExecuteQuery(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteSyncJob(response, &metadata) } - output := &ExecuteQueryOutput{} + output := &DeleteSyncJobOutput{} out.Result = output var buff [1024]byte @@ -1850,7 +1989,7 @@ func (m *awsRestjson1_deserializeOpExecuteQuery) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentExecuteQueryOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteSyncJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1863,7 +2002,7 @@ func (m *awsRestjson1_deserializeOpExecuteQuery) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorExecuteQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteSyncJob(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)} @@ -1910,8 +2049,8 @@ func awsRestjson1_deserializeOpErrorExecuteQuery(response *smithyhttp.Response, case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("QueryTimeoutException", errorCode): - return awsRestjson1_deserializeErrorQueryTimeoutException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) @@ -1932,7 +2071,7 @@ func awsRestjson1_deserializeOpErrorExecuteQuery(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentExecuteQueryOutput(v **ExecuteQueryOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteSyncJobOutput(v **DeleteSyncJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1945,32 +2084,22 @@ func awsRestjson1_deserializeOpDocumentExecuteQueryOutput(v **ExecuteQueryOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ExecuteQueryOutput + var sv *DeleteSyncJobOutput if *v == nil { - sv = &ExecuteQueryOutput{} + sv = &DeleteSyncJobOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "columnDescriptions": - if err := awsRestjson1_deserializeDocumentColumnDescriptions(&sv.ColumnDescriptions, value); err != nil { - return err - } - - case "nextToken": + case "state": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected SyncJobState to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) - } - - case "rows": - if err := awsRestjson1_deserializeDocumentRows(&sv.Rows, value); err != nil { - return err + sv.State = types.SyncJobState(jtv) } default: @@ -1982,14 +2111,14 @@ func awsRestjson1_deserializeOpDocumentExecuteQueryOutput(v **ExecuteQueryOutput return nil } -type awsRestjson1_deserializeOpGetComponentType struct { +type awsRestjson1_deserializeOpDeleteWorkspace struct { } -func (*awsRestjson1_deserializeOpGetComponentType) ID() string { +func (*awsRestjson1_deserializeOpDeleteWorkspace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetComponentType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteWorkspace) 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) @@ -2003,9 +2132,9 @@ func (m *awsRestjson1_deserializeOpGetComponentType) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetComponentType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkspace(response, &metadata) } - output := &GetComponentTypeOutput{} + output := &DeleteWorkspaceOutput{} out.Result = output var buff [1024]byte @@ -2026,7 +2155,7 @@ func (m *awsRestjson1_deserializeOpGetComponentType) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetComponentTypeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteWorkspaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2039,7 +2168,7 @@ func (m *awsRestjson1_deserializeOpGetComponentType) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetComponentType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteWorkspace(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)} @@ -2105,7 +2234,7 @@ func awsRestjson1_deserializeOpErrorGetComponentType(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetComponentTypeOutput(v **GetComponentTypeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteWorkspaceOutput(v **DeleteWorkspaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2118,190 +2247,61 @@ func awsRestjson1_deserializeOpDocumentGetComponentTypeOutput(v **GetComponentTy return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetComponentTypeOutput + var sv *DeleteWorkspaceOutput if *v == nil { - sv = &GetComponentTypeOutput{} + sv = &DeleteWorkspaceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkspaceDeleteMessage to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "componentTypeId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) - } - sv.ComponentTypeId = ptr.String(jtv) - } + default: + _, _ = key, value - case "componentTypeName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentTypeName to be of type string, got %T instead", value) - } - sv.ComponentTypeName = ptr.String(jtv) - } + } + } + *v = sv + return nil +} - case "creationDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) +type awsRestjson1_deserializeOpExecuteQuery struct { +} - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) +func (*awsRestjson1_deserializeOpExecuteQuery) ID() string { + return "OperationDeserializer" +} - } - } +func (m *awsRestjson1_deserializeOpExecuteQuery) 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 + } - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - case "extendsFrom": - if err := awsRestjson1_deserializeDocumentExtendsFrom(&sv.ExtendsFrom, value); err != nil { - return err - } + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorExecuteQuery(response, &metadata) + } + output := &ExecuteQueryOutput{} + out.Result = output - case "functions": - if err := awsRestjson1_deserializeDocumentFunctionsResponse(&sv.Functions, value); err != nil { - return err - } - - case "isAbstract": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.IsAbstract = ptr.Bool(jtv) - } - - case "isSchemaInitialized": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.IsSchemaInitialized = ptr.Bool(jtv) - } - - case "isSingleton": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.IsSingleton = ptr.Bool(jtv) - } - - case "propertyDefinitions": - if err := awsRestjson1_deserializeDocumentPropertyDefinitionsResponse(&sv.PropertyDefinitions, value); err != nil { - return err - } - - case "propertyGroups": - if err := awsRestjson1_deserializeDocumentPropertyGroupsResponse(&sv.PropertyGroups, value); err != nil { - return err - } - - case "status": - if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { - return err - } - - case "syncSource": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SyncSource to be of type string, got %T instead", value) - } - sv.SyncSource = ptr.String(jtv) - } - - case "updateDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "workspaceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.WorkspaceId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetEntity struct { -} - -func (*awsRestjson1_deserializeOpGetEntity) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetEntity) 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_deserializeOpErrorGetEntity(response, &metadata) - } - output := &GetEntityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -2318,7 +2318,7 @@ func (m *awsRestjson1_deserializeOpGetEntity) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetEntityOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentExecuteQueryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2331,7 +2331,7 @@ func (m *awsRestjson1_deserializeOpGetEntity) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetEntity(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorExecuteQuery(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)} @@ -2372,11 +2372,14 @@ func awsRestjson1_deserializeOpErrorGetEntity(response *smithyhttp.Response, met } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("QueryTimeoutException", errorCode): + return awsRestjson1_deserializeErrorQueryTimeoutException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) @@ -2397,7 +2400,7 @@ func awsRestjson1_deserializeOpErrorGetEntity(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentGetEntityOutput(v **GetEntityOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentExecuteQueryOutput(v **ExecuteQueryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2410,129 +2413,34 @@ func awsRestjson1_deserializeOpDocumentGetEntityOutput(v **GetEntityOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetEntityOutput + var sv *ExecuteQueryOutput if *v == nil { - sv = &GetEntityOutput{} + sv = &ExecuteQueryOutput{} } 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 TwinMakerArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "components": - if err := awsRestjson1_deserializeDocumentComponentsMap(&sv.Components, value); err != nil { + case "columnDescriptions": + if err := awsRestjson1_deserializeDocumentColumnDescriptions(&sv.ColumnDescriptions, value); err != nil { return err } - case "creationDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "entityId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) - } - sv.EntityId = ptr.String(jtv) - } - - case "entityName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) - } - sv.EntityName = ptr.String(jtv) - } - - case "hasChildEntities": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.HasChildEntities = ptr.Bool(jtv) - } - - case "parentEntityId": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ParentEntityId to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.ParentEntityId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "status": - if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + case "rows": + if err := awsRestjson1_deserializeDocumentRows(&sv.Rows, value); err != nil { return err } - case "syncSource": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SyncSource to be of type string, got %T instead", value) - } - sv.SyncSource = ptr.String(jtv) - } - - case "updateDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "workspaceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.WorkspaceId = ptr.String(jtv) - } - default: _, _ = key, value @@ -2542,14 +2450,14 @@ func awsRestjson1_deserializeOpDocumentGetEntityOutput(v **GetEntityOutput, valu return nil } -type awsRestjson1_deserializeOpGetPricingPlan struct { +type awsRestjson1_deserializeOpGetComponentType struct { } -func (*awsRestjson1_deserializeOpGetPricingPlan) ID() string { +func (*awsRestjson1_deserializeOpGetComponentType) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetPricingPlan) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetComponentType) 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) @@ -2563,9 +2471,9 @@ func (m *awsRestjson1_deserializeOpGetPricingPlan) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPricingPlan(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetComponentType(response, &metadata) } - output := &GetPricingPlanOutput{} + output := &GetComponentTypeOutput{} out.Result = output var buff [1024]byte @@ -2586,7 +2494,7 @@ func (m *awsRestjson1_deserializeOpGetPricingPlan) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetPricingPlanOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetComponentTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2599,7 +2507,7 @@ func (m *awsRestjson1_deserializeOpGetPricingPlan) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetPricingPlan(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetComponentType(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)} @@ -2646,6 +2554,9 @@ func awsRestjson1_deserializeOpErrorGetPricingPlan(response *smithyhttp.Response case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -2662,7 +2573,7 @@ func awsRestjson1_deserializeOpErrorGetPricingPlan(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentGetPricingPlanOutput(v **GetPricingPlanOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetComponentTypeOutput(v **GetComponentTypeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2675,25 +2586,158 @@ func awsRestjson1_deserializeOpDocumentGetPricingPlanOutput(v **GetPricingPlanOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPricingPlanOutput + var sv *GetComponentTypeOutput if *v == nil { - sv = &GetPricingPlanOutput{} + sv = &GetComponentTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "currentPricingPlan": - if err := awsRestjson1_deserializeDocumentPricingPlan(&sv.CurrentPricingPlan, value); err != nil { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "componentTypeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) + } + sv.ComponentTypeId = ptr.String(jtv) + } + + case "componentTypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentTypeName to be of type string, got %T instead", value) + } + sv.ComponentTypeName = ptr.String(jtv) + } + + case "compositeComponentTypes": + if err := awsRestjson1_deserializeDocumentCompositeComponentTypesResponse(&sv.CompositeComponentTypes, value); err != nil { return err } - case "pendingPricingPlan": - if err := awsRestjson1_deserializeDocumentPricingPlan(&sv.PendingPricingPlan, value); err != nil { + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "extendsFrom": + if err := awsRestjson1_deserializeDocumentExtendsFrom(&sv.ExtendsFrom, value); err != nil { return err } + case "functions": + if err := awsRestjson1_deserializeDocumentFunctionsResponse(&sv.Functions, value); err != nil { + return err + } + + case "isAbstract": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsAbstract = ptr.Bool(jtv) + } + + case "isSchemaInitialized": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsSchemaInitialized = ptr.Bool(jtv) + } + + case "isSingleton": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsSingleton = ptr.Bool(jtv) + } + + case "propertyDefinitions": + if err := awsRestjson1_deserializeDocumentPropertyDefinitionsResponse(&sv.PropertyDefinitions, value); err != nil { + return err + } + + case "propertyGroups": + if err := awsRestjson1_deserializeDocumentPropertyGroupsResponse(&sv.PropertyGroups, value); err != nil { + return err + } + + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } + + case "syncSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SyncSource to be of type string, got %T instead", value) + } + sv.SyncSource = ptr.String(jtv) + } + + case "updateDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "workspaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.WorkspaceId = ptr.String(jtv) + } + default: _, _ = key, value @@ -2703,14 +2747,14 @@ func awsRestjson1_deserializeOpDocumentGetPricingPlanOutput(v **GetPricingPlanOu return nil } -type awsRestjson1_deserializeOpGetPropertyValue struct { +type awsRestjson1_deserializeOpGetEntity struct { } -func (*awsRestjson1_deserializeOpGetPropertyValue) ID() string { +func (*awsRestjson1_deserializeOpGetEntity) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetPropertyValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetEntity) 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) @@ -2724,9 +2768,9 @@ func (m *awsRestjson1_deserializeOpGetPropertyValue) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPropertyValue(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetEntity(response, &metadata) } - output := &GetPropertyValueOutput{} + output := &GetEntityOutput{} out.Result = output var buff [1024]byte @@ -2747,7 +2791,7 @@ func (m *awsRestjson1_deserializeOpGetPropertyValue) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetPropertyValueOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetEntityOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2760,7 +2804,7 @@ func (m *awsRestjson1_deserializeOpGetPropertyValue) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetPropertyValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetEntity(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)} @@ -2801,21 +2845,15 @@ func awsRestjson1_deserializeOpErrorGetPropertyValue(response *smithyhttp.Respon } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConnectorFailureException", errorCode): - return awsRestjson1_deserializeErrorConnectorFailureException(response, errorBody) - - case strings.EqualFold("ConnectorTimeoutException", errorCode): - return awsRestjson1_deserializeErrorConnectorTimeoutException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -2832,7 +2870,7 @@ func awsRestjson1_deserializeOpErrorGetPropertyValue(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetPropertyValueOutput(v **GetPropertyValueOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetEntityOutput(v **GetEntityOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2845,206 +2883,136 @@ func awsRestjson1_deserializeOpDocumentGetPropertyValueOutput(v **GetPropertyVal return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPropertyValueOutput + var sv *GetEntityOutput if *v == nil { - sv = &GetPropertyValueOutput{} + sv = &GetEntityOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "areAllComponentsReturned": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.AreAllComponentsReturned = ptr.Bool(jtv) } - case "propertyValues": - if err := awsRestjson1_deserializeDocumentPropertyLatestValueMap(&sv.PropertyValues, value); err != nil { - return err + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) } - case "tabularPropertyValues": - if err := awsRestjson1_deserializeDocumentTabularPropertyValues(&sv.TabularPropertyValues, value); err != nil { + case "components": + if err := awsRestjson1_deserializeDocumentComponentsMap(&sv.Components, value); err != nil { return err } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetPropertyValueHistory struct { -} + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) -func (*awsRestjson1_deserializeOpGetPropertyValueHistory) ID() string { - return "OperationDeserializer" -} + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) -func (m *awsRestjson1_deserializeOpGetPropertyValueHistory) 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)} - } + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPropertyValueHistory(response, &metadata) - } - output := &GetPropertyValueHistoryOutput{} - out.Result = output + case "entityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) + } + sv.EntityId = ptr.String(jtv) + } - 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_deserializeOpDocumentGetPropertyValueHistoryOutput(&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_deserializeOpErrorGetPropertyValueHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConnectorFailureException", errorCode): - return awsRestjson1_deserializeErrorConnectorFailureException(response, errorBody) - - case strings.EqualFold("ConnectorTimeoutException", errorCode): - return awsRestjson1_deserializeErrorConnectorTimeoutException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case "entityName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) + } + sv.EntityName = ptr.String(jtv) + } - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case "hasChildEntities": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.HasChildEntities = ptr.Bool(jtv) + } - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) + case "parentEntityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParentEntityId to be of type string, got %T instead", value) + } + sv.ParentEntityId = ptr.String(jtv) + } - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } - } -} + case "syncSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SyncSource to be of type string, got %T instead", value) + } + sv.SyncSource = ptr.String(jtv) + } -func awsRestjson1_deserializeOpDocumentGetPropertyValueHistoryOutput(v **GetPropertyValueHistoryOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "updateDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - var sv *GetPropertyValueHistoryOutput - if *v == nil { - sv = &GetPropertyValueHistoryOutput{} - } else { - sv = *v - } + } + } - for key, value := range shape { - switch key { - case "nextToken": + case "workspaceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Id to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) - } - - case "propertyValues": - if err := awsRestjson1_deserializeDocumentPropertyValueList(&sv.PropertyValues, value); err != nil { - return err + sv.WorkspaceId = ptr.String(jtv) } default: @@ -3056,14 +3024,14 @@ func awsRestjson1_deserializeOpDocumentGetPropertyValueHistoryOutput(v **GetProp return nil } -type awsRestjson1_deserializeOpGetScene struct { +type awsRestjson1_deserializeOpGetMetadataTransferJob struct { } -func (*awsRestjson1_deserializeOpGetScene) ID() string { +func (*awsRestjson1_deserializeOpGetMetadataTransferJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetScene) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetMetadataTransferJob) 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) @@ -3077,9 +3045,9 @@ func (m *awsRestjson1_deserializeOpGetScene) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetScene(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetMetadataTransferJob(response, &metadata) } - output := &GetSceneOutput{} + output := &GetMetadataTransferJobOutput{} out.Result = output var buff [1024]byte @@ -3100,7 +3068,7 @@ func (m *awsRestjson1_deserializeOpGetScene) HandleDeserialize(ctx context.Conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetSceneOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetMetadataTransferJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3113,7 +3081,7 @@ func (m *awsRestjson1_deserializeOpGetScene) HandleDeserialize(ctx context.Conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetScene(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetMetadataTransferJob(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)} @@ -3179,7 +3147,7 @@ func awsRestjson1_deserializeOpErrorGetScene(response *smithyhttp.Response, meta } } -func awsRestjson1_deserializeOpDocumentGetSceneOutput(v **GetSceneOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetMetadataTransferJobOutput(v **GetMetadataTransferJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3192,9 +3160,9 @@ func awsRestjson1_deserializeOpDocumentGetSceneOutput(v **GetSceneOutput, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetSceneOutput + var sv *GetMetadataTransferJobOutput if *v == nil { - sv = &GetSceneOutput{} + sv = &GetMetadataTransferJobOutput{} } else { sv = *v } @@ -3210,20 +3178,6 @@ func awsRestjson1_deserializeOpDocumentGetSceneOutput(v **GetSceneOutput, value sv.Arn = ptr.String(jtv) } - case "capabilities": - if err := awsRestjson1_deserializeDocumentSceneCapabilities(&sv.Capabilities, value); err != nil { - return err - } - - case "contentLocation": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) - } - sv.ContentLocation = ptr.String(jtv) - } - case "creationDateTime": if value != nil { switch jtv := value.(type) { @@ -3249,27 +3203,50 @@ func awsRestjson1_deserializeOpDocumentGetSceneOutput(v **GetSceneOutput, value sv.Description = ptr.String(jtv) } - case "error": - if err := awsRestjson1_deserializeDocumentSceneError(&sv.Error, value); err != nil { + case "destination": + if err := awsRestjson1_deserializeDocumentDestinationConfiguration(&sv.Destination, value); err != nil { return err } - case "generatedSceneMetadata": - if err := awsRestjson1_deserializeDocumentGeneratedSceneMetadataMap(&sv.GeneratedSceneMetadata, value); err != nil { + case "metadataTransferJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.MetadataTransferJobId = ptr.String(jtv) + } + + case "metadataTransferJobRole": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.MetadataTransferJobRole = ptr.String(jtv) + } + + case "progress": + if err := awsRestjson1_deserializeDocumentMetadataTransferJobProgress(&sv.Progress, value); err != nil { return err } - case "sceneId": + case "reportUrl": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.SceneId = ptr.String(jtv) + sv.ReportUrl = ptr.String(jtv) } - case "sceneMetadata": - if err := awsRestjson1_deserializeDocumentSceneMetadataMap(&sv.SceneMetadata, value); err != nil { + case "sources": + if err := awsRestjson1_deserializeDocumentSourceConfigurations(&sv.Sources, value); err != nil { + return err + } + + case "status": + if err := awsRestjson1_deserializeDocumentMetadataTransferJobStatus(&sv.Status, value); err != nil { return err } @@ -3289,15 +3266,6 @@ func awsRestjson1_deserializeOpDocumentGetSceneOutput(v **GetSceneOutput, value } } - case "workspaceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.WorkspaceId = ptr.String(jtv) - } - default: _, _ = key, value @@ -3307,14 +3275,14 @@ func awsRestjson1_deserializeOpDocumentGetSceneOutput(v **GetSceneOutput, value return nil } -type awsRestjson1_deserializeOpGetSyncJob struct { +type awsRestjson1_deserializeOpGetPricingPlan struct { } -func (*awsRestjson1_deserializeOpGetSyncJob) ID() string { +func (*awsRestjson1_deserializeOpGetPricingPlan) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetSyncJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPricingPlan) 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) @@ -3328,9 +3296,9 @@ func (m *awsRestjson1_deserializeOpGetSyncJob) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetSyncJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPricingPlan(response, &metadata) } - output := &GetSyncJobOutput{} + output := &GetPricingPlanOutput{} out.Result = output var buff [1024]byte @@ -3351,7 +3319,7 @@ func (m *awsRestjson1_deserializeOpGetSyncJob) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetSyncJobOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPricingPlanOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3364,7 +3332,7 @@ func (m *awsRestjson1_deserializeOpGetSyncJob) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetSyncJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPricingPlan(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)} @@ -3411,14 +3379,8 @@ func awsRestjson1_deserializeOpErrorGetSyncJob(response *smithyhttp.Response, me case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3433,7 +3395,7 @@ func awsRestjson1_deserializeOpErrorGetSyncJob(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetSyncJobOutput(v **GetSyncJobOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPricingPlanOutput(v **GetPricingPlanOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3446,86 +3408,23 @@ func awsRestjson1_deserializeOpDocumentGetSyncJobOutput(v **GetSyncJobOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetSyncJobOutput + var sv *GetPricingPlanOutput if *v == nil { - sv = &GetSyncJobOutput{} + sv = &GetPricingPlanOutput{} } 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 TwinMakerArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "creationDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "status": - if err := awsRestjson1_deserializeDocumentSyncJobStatus(&sv.Status, value); err != nil { + case "currentPricingPlan": + if err := awsRestjson1_deserializeDocumentPricingPlan(&sv.CurrentPricingPlan, value); err != nil { return err } - case "syncRole": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) - } - sv.SyncRole = ptr.String(jtv) - } - - case "syncSource": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SyncSource to be of type string, got %T instead", value) - } - sv.SyncSource = ptr.String(jtv) - } - - case "updateDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "workspaceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.WorkspaceId = ptr.String(jtv) + case "pendingPricingPlan": + if err := awsRestjson1_deserializeDocumentPricingPlan(&sv.PendingPricingPlan, value); err != nil { + return err } default: @@ -3537,14 +3436,14 @@ func awsRestjson1_deserializeOpDocumentGetSyncJobOutput(v **GetSyncJobOutput, va return nil } -type awsRestjson1_deserializeOpGetWorkspace struct { +type awsRestjson1_deserializeOpGetPropertyValue struct { } -func (*awsRestjson1_deserializeOpGetWorkspace) ID() string { +func (*awsRestjson1_deserializeOpGetPropertyValue) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPropertyValue) 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) @@ -3558,9 +3457,9 @@ func (m *awsRestjson1_deserializeOpGetWorkspace) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPropertyValue(response, &metadata) } - output := &GetWorkspaceOutput{} + output := &GetPropertyValueOutput{} out.Result = output var buff [1024]byte @@ -3581,7 +3480,7 @@ func (m *awsRestjson1_deserializeOpGetWorkspace) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetWorkspaceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPropertyValueOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3594,7 +3493,7 @@ func (m *awsRestjson1_deserializeOpGetWorkspace) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPropertyValue(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)} @@ -3635,15 +3534,21 @@ func awsRestjson1_deserializeOpErrorGetWorkspace(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConnectorFailureException", errorCode): + return awsRestjson1_deserializeErrorConnectorFailureException(response, errorBody) + + case strings.EqualFold("ConnectorTimeoutException", errorCode): + return awsRestjson1_deserializeErrorConnectorTimeoutException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -3660,7 +3565,7 @@ func awsRestjson1_deserializeOpErrorGetWorkspace(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetWorkspaceOutput(v **GetWorkspaceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPropertyValueOutput(v **GetPropertyValueOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3673,90 +3578,32 @@ func awsRestjson1_deserializeOpDocumentGetWorkspaceOutput(v **GetWorkspaceOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetWorkspaceOutput + var sv *GetPropertyValueOutput if *v == nil { - sv = &GetWorkspaceOutput{} + sv = &GetPropertyValueOutput{} } 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 TwinMakerArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "creationDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "role": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) - } - sv.Role = ptr.String(jtv) - } - - case "s3Location": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected S3Location to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.S3Location = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "updateDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } + case "propertyValues": + if err := awsRestjson1_deserializeDocumentPropertyLatestValueMap(&sv.PropertyValues, value); err != nil { + return err } - case "workspaceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.WorkspaceId = ptr.String(jtv) + case "tabularPropertyValues": + if err := awsRestjson1_deserializeDocumentTabularPropertyValues(&sv.TabularPropertyValues, value); err != nil { + return err } default: @@ -3768,14 +3615,14 @@ func awsRestjson1_deserializeOpDocumentGetWorkspaceOutput(v **GetWorkspaceOutput return nil } -type awsRestjson1_deserializeOpListComponentTypes struct { +type awsRestjson1_deserializeOpGetPropertyValueHistory struct { } -func (*awsRestjson1_deserializeOpListComponentTypes) ID() string { +func (*awsRestjson1_deserializeOpGetPropertyValueHistory) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListComponentTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPropertyValueHistory) 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) @@ -3789,9 +3636,9 @@ func (m *awsRestjson1_deserializeOpListComponentTypes) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListComponentTypes(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPropertyValueHistory(response, &metadata) } - output := &ListComponentTypesOutput{} + output := &GetPropertyValueHistoryOutput{} out.Result = output var buff [1024]byte @@ -3812,7 +3659,7 @@ func (m *awsRestjson1_deserializeOpListComponentTypes) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListComponentTypesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPropertyValueHistoryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3825,7 +3672,7 @@ func (m *awsRestjson1_deserializeOpListComponentTypes) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListComponentTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPropertyValueHistory(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)} @@ -3869,9 +3716,18 @@ func awsRestjson1_deserializeOpErrorListComponentTypes(response *smithyhttp.Resp case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConnectorFailureException", errorCode): + return awsRestjson1_deserializeErrorConnectorFailureException(response, errorBody) + + case strings.EqualFold("ConnectorTimeoutException", errorCode): + return awsRestjson1_deserializeErrorConnectorTimeoutException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -3888,7 +3744,7 @@ func awsRestjson1_deserializeOpErrorListComponentTypes(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListComponentTypesOutput(v **ListComponentTypesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPropertyValueHistoryOutput(v **GetPropertyValueHistoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3901,33 +3757,15 @@ func awsRestjson1_deserializeOpDocumentListComponentTypesOutput(v **ListComponen return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListComponentTypesOutput + var sv *GetPropertyValueHistoryOutput if *v == nil { - sv = &ListComponentTypesOutput{} + sv = &GetPropertyValueHistoryOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "componentTypeSummaries": - if err := awsRestjson1_deserializeDocumentComponentTypeSummaries(&sv.ComponentTypeSummaries, value); err != nil { - return err - } - - case "maxResults": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected MaxResults to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MaxResults = ptr.Int32(int32(i64)) - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -3937,13 +3775,9 @@ func awsRestjson1_deserializeOpDocumentListComponentTypesOutput(v **ListComponen sv.NextToken = ptr.String(jtv) } - case "workspaceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.WorkspaceId = ptr.String(jtv) + case "propertyValues": + if err := awsRestjson1_deserializeDocumentPropertyValueList(&sv.PropertyValues, value); err != nil { + return err } default: @@ -3955,14 +3789,14 @@ func awsRestjson1_deserializeOpDocumentListComponentTypesOutput(v **ListComponen return nil } -type awsRestjson1_deserializeOpListEntities struct { +type awsRestjson1_deserializeOpGetScene struct { } -func (*awsRestjson1_deserializeOpListEntities) ID() string { +func (*awsRestjson1_deserializeOpGetScene) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListEntities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetScene) 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) @@ -3976,9 +3810,9 @@ func (m *awsRestjson1_deserializeOpListEntities) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListEntities(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetScene(response, &metadata) } - output := &ListEntitiesOutput{} + output := &GetSceneOutput{} out.Result = output var buff [1024]byte @@ -3999,7 +3833,7 @@ func (m *awsRestjson1_deserializeOpListEntities) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListEntitiesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetSceneOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4012,7 +3846,7 @@ func (m *awsRestjson1_deserializeOpListEntities) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListEntities(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetScene(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)} @@ -4053,11 +3887,14 @@ func awsRestjson1_deserializeOpErrorListEntities(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4075,7 +3912,7 @@ func awsRestjson1_deserializeOpErrorListEntities(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListEntitiesOutput(v **ListEntitiesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetSceneOutput(v **GetSceneOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4088,27 +3925,110 @@ func awsRestjson1_deserializeOpDocumentListEntitiesOutput(v **ListEntitiesOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListEntitiesOutput + var sv *GetSceneOutput if *v == nil { - sv = &ListEntitiesOutput{} + sv = &GetSceneOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "entitySummaries": - if err := awsRestjson1_deserializeDocumentEntitySummaries(&sv.EntitySummaries, value); err != nil { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "capabilities": + if err := awsRestjson1_deserializeDocumentSceneCapabilities(&sv.Capabilities, value); err != nil { return err } - case "nextToken": + case "contentLocation": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.ContentLocation = ptr.String(jtv) + } + + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "error": + if err := awsRestjson1_deserializeDocumentSceneError(&sv.Error, value); err != nil { + return err + } + + case "generatedSceneMetadata": + if err := awsRestjson1_deserializeDocumentGeneratedSceneMetadataMap(&sv.GeneratedSceneMetadata, value); err != nil { + return err + } + + case "sceneId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.SceneId = ptr.String(jtv) + } + + case "sceneMetadata": + if err := awsRestjson1_deserializeDocumentSceneMetadataMap(&sv.SceneMetadata, value); err != nil { + return err + } + + case "updateDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "workspaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.WorkspaceId = ptr.String(jtv) } default: @@ -4120,14 +4040,14 @@ func awsRestjson1_deserializeOpDocumentListEntitiesOutput(v **ListEntitiesOutput return nil } -type awsRestjson1_deserializeOpListScenes struct { +type awsRestjson1_deserializeOpGetSyncJob struct { } -func (*awsRestjson1_deserializeOpListScenes) ID() string { +func (*awsRestjson1_deserializeOpGetSyncJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListScenes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetSyncJob) 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) @@ -4141,9 +4061,9 @@ func (m *awsRestjson1_deserializeOpListScenes) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListScenes(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetSyncJob(response, &metadata) } - output := &ListScenesOutput{} + output := &GetSyncJobOutput{} out.Result = output var buff [1024]byte @@ -4164,7 +4084,7 @@ func (m *awsRestjson1_deserializeOpListScenes) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListScenesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetSyncJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4177,7 +4097,7 @@ func (m *awsRestjson1_deserializeOpListScenes) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListScenes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetSyncJob(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)} @@ -4224,6 +4144,12 @@ func awsRestjson1_deserializeOpErrorListScenes(response *smithyhttp.Response, me case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4240,7 +4166,7 @@ func awsRestjson1_deserializeOpErrorListScenes(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListScenesOutput(v **ListScenesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetSyncJobOutput(v **GetSyncJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4253,29 +4179,88 @@ func awsRestjson1_deserializeOpDocumentListScenesOutput(v **ListScenesOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListScenesOutput + var sv *GetSyncJobOutput if *v == nil { - sv = &ListScenesOutput{} + sv = &GetSyncJobOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "sceneSummaries": - if err := awsRestjson1_deserializeDocumentSceneSummaries(&sv.SceneSummaries, value); err != nil { + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "status": + if err := awsRestjson1_deserializeDocumentSyncJobStatus(&sv.Status, value); err != nil { return err } + case "syncRole": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.SyncRole = ptr.String(jtv) + } + + case "syncSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SyncSource to be of type string, got %T instead", value) + } + sv.SyncSource = ptr.String(jtv) + } + + case "updateDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "workspaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.WorkspaceId = ptr.String(jtv) + } + default: _, _ = key, value @@ -4285,14 +4270,14 @@ func awsRestjson1_deserializeOpDocumentListScenesOutput(v **ListScenesOutput, va return nil } -type awsRestjson1_deserializeOpListSyncJobs struct { +type awsRestjson1_deserializeOpGetWorkspace struct { } -func (*awsRestjson1_deserializeOpListSyncJobs) ID() string { +func (*awsRestjson1_deserializeOpGetWorkspace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSyncJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetWorkspace) 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) @@ -4306,9 +4291,9 @@ func (m *awsRestjson1_deserializeOpListSyncJobs) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSyncJobs(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetWorkspace(response, &metadata) } - output := &ListSyncJobsOutput{} + output := &GetWorkspaceOutput{} out.Result = output var buff [1024]byte @@ -4329,7 +4314,7 @@ func (m *awsRestjson1_deserializeOpListSyncJobs) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSyncJobsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetWorkspaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4342,7 +4327,7 @@ func (m *awsRestjson1_deserializeOpListSyncJobs) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSyncJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetWorkspace(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)} @@ -4383,12 +4368,12 @@ func awsRestjson1_deserializeOpErrorListSyncJobs(response *smithyhttp.Response, } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) @@ -4408,7 +4393,7 @@ func awsRestjson1_deserializeOpErrorListSyncJobs(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListSyncJobsOutput(v **ListSyncJobsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetWorkspaceOutput(v **GetWorkspaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4421,31 +4406,99 @@ func awsRestjson1_deserializeOpDocumentListSyncJobsOutput(v **ListSyncJobsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSyncJobsOutput + var sv *GetWorkspaceOutput if *v == nil { - sv = &ListSyncJobsOutput{} + sv = &GetWorkspaceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "syncJobSummaries": - if err := awsRestjson1_deserializeDocumentSyncJobSummaries(&sv.SyncJobSummaries, value); err != nil { - return err - } + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - default: - _, _ = key, value + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "linkedServices": + if err := awsRestjson1_deserializeDocumentLinkedServices(&sv.LinkedServices, value); err != nil { + return err + } + + case "role": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.Role = ptr.String(jtv) + } + + case "s3Location": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3Location to be of type string, got %T instead", value) + } + sv.S3Location = ptr.String(jtv) + } + + case "updateDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "workspaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.WorkspaceId = ptr.String(jtv) + } + + default: + _, _ = key, value } } @@ -4453,14 +4506,14 @@ func awsRestjson1_deserializeOpDocumentListSyncJobsOutput(v **ListSyncJobsOutput return nil } -type awsRestjson1_deserializeOpListSyncResources struct { +type awsRestjson1_deserializeOpListComponents struct { } -func (*awsRestjson1_deserializeOpListSyncResources) ID() string { +func (*awsRestjson1_deserializeOpListComponents) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSyncResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListComponents) 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) @@ -4474,9 +4527,9 @@ func (m *awsRestjson1_deserializeOpListSyncResources) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSyncResources(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListComponents(response, &metadata) } - output := &ListSyncResourcesOutput{} + output := &ListComponentsOutput{} out.Result = output var buff [1024]byte @@ -4497,7 +4550,7 @@ func (m *awsRestjson1_deserializeOpListSyncResources) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSyncResourcesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListComponentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4510,7 +4563,7 @@ func (m *awsRestjson1_deserializeOpListSyncResources) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSyncResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListComponents(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)} @@ -4557,8 +4610,8 @@ func awsRestjson1_deserializeOpErrorListSyncResources(response *smithyhttp.Respo case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -4576,7 +4629,7 @@ func awsRestjson1_deserializeOpErrorListSyncResources(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListSyncResourcesOutput(v **ListSyncResourcesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4589,15 +4642,20 @@ func awsRestjson1_deserializeOpDocumentListSyncResourcesOutput(v **ListSyncResou return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSyncResourcesOutput + var sv *ListComponentsOutput if *v == nil { - sv = &ListSyncResourcesOutput{} + sv = &ListComponentsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "componentSummaries": + if err := awsRestjson1_deserializeDocumentComponentSummaries(&sv.ComponentSummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4607,11 +4665,6 @@ func awsRestjson1_deserializeOpDocumentListSyncResourcesOutput(v **ListSyncResou sv.NextToken = ptr.String(jtv) } - case "syncResources": - if err := awsRestjson1_deserializeDocumentSyncResourceSummaries(&sv.SyncResources, value); err != nil { - return err - } - default: _, _ = key, value @@ -4621,14 +4674,14 @@ func awsRestjson1_deserializeOpDocumentListSyncResourcesOutput(v **ListSyncResou return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListComponentTypes struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListComponentTypes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListComponentTypes) 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) @@ -4642,9 +4695,9 @@ 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_deserializeOpErrorListComponentTypes(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListComponentTypesOutput{} out.Result = output var buff [1024]byte @@ -4665,7 +4718,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListComponentTypesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4678,7 +4731,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListComponentTypes(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)} @@ -4722,8 +4775,14 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4735,7 +4794,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListComponentTypesOutput(v **ListComponentTypesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4748,15 +4807,33 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListComponentTypesOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListComponentTypesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "componentTypeSummaries": + if err := awsRestjson1_deserializeDocumentComponentTypeSummaries(&sv.ComponentTypeSummaries, value); err != nil { + return err + } + + case "maxResults": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaxResults to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxResults = ptr.Int32(int32(i64)) + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4766,9 +4843,13 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor sv.NextToken = ptr.String(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err + case "workspaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.WorkspaceId = ptr.String(jtv) } default: @@ -4780,14 +4861,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpListWorkspaces struct { +type awsRestjson1_deserializeOpListEntities struct { } -func (*awsRestjson1_deserializeOpListWorkspaces) ID() string { +func (*awsRestjson1_deserializeOpListEntities) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListEntities) 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) @@ -4801,9 +4882,9 @@ func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListWorkspaces(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListEntities(response, &metadata) } - output := &ListWorkspacesOutput{} + output := &ListEntitiesOutput{} out.Result = output var buff [1024]byte @@ -4824,7 +4905,7 @@ func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListWorkspacesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListEntitiesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4837,7 +4918,7 @@ func (m *awsRestjson1_deserializeOpListWorkspaces) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListEntities(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)} @@ -4900,7 +4981,7 @@ func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListEntitiesOutput(v **ListEntitiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4913,15 +4994,20 @@ func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListWorkspacesOutput + var sv *ListEntitiesOutput if *v == nil { - sv = &ListWorkspacesOutput{} + sv = &ListEntitiesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "entitySummaries": + if err := awsRestjson1_deserializeDocumentEntitySummaries(&sv.EntitySummaries, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -4931,11 +5017,6 @@ func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOu sv.NextToken = ptr.String(jtv) } - case "workspaceSummaries": - if err := awsRestjson1_deserializeDocumentWorkspaceSummaries(&sv.WorkspaceSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -4945,14 +5026,14 @@ func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOu return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpListMetadataTransferJobs struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpListMetadataTransferJobs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListMetadataTransferJobs) 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) @@ -4966,15 +5047,43 @@ 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_deserializeOpErrorListMetadataTransferJobs(response, &metadata) } - output := &TagResourceOutput{} + output := &ListMetadataTransferJobsOutput{} 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_deserializeOpDocumentListMetadataTransferJobsOutput(&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_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListMetadataTransferJobs(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)} @@ -5018,11 +5127,14 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("TooManyTagsException", errorCode): - return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5034,100 +5146,59 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -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 +func awsRestjson1_deserializeOpDocumentListMetadataTransferJobsOutput(v **ListMetadataTransferJobsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - response, ok := out.RawResponse.(*smithyhttp.Response) + shape, ok := value.(map[string]interface{}) if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + return fmt.Errorf("unexpected JSON type %v", value) } - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + var sv *ListMetadataTransferJobsOutput + if *v == nil { + sv = &ListMetadataTransferJobsOutput{} + } else { + sv = *v } - output := &UntagResourceOutput{} - out.Result = output - return out, metadata, err -} + for key, value := range shape { + switch key { + case "metadataTransferJobSummaries": + if err := awsRestjson1_deserializeDocumentMetadataTransferJobSummaries(&sv.MetadataTransferJobSummaries, value); err != nil { + return 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 - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + default: + _, _ = key, value - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, } - return genericError - } + *v = sv + return nil } -type awsRestjson1_deserializeOpUpdateComponentType struct { +type awsRestjson1_deserializeOpListProperties struct { } -func (*awsRestjson1_deserializeOpUpdateComponentType) ID() string { +func (*awsRestjson1_deserializeOpListProperties) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateComponentType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListProperties) 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) @@ -5141,9 +5212,9 @@ func (m *awsRestjson1_deserializeOpUpdateComponentType) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateComponentType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListProperties(response, &metadata) } - output := &UpdateComponentTypeOutput{} + output := &ListPropertiesOutput{} out.Result = output var buff [1024]byte @@ -5164,7 +5235,7 @@ func (m *awsRestjson1_deserializeOpUpdateComponentType) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateComponentTypeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPropertiesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5177,7 +5248,7 @@ func (m *awsRestjson1_deserializeOpUpdateComponentType) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateComponentType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListProperties(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)} @@ -5227,9 +5298,6 @@ func awsRestjson1_deserializeOpErrorUpdateComponentType(response *smithyhttp.Res case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5246,7 +5314,7 @@ func awsRestjson1_deserializeOpErrorUpdateComponentType(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentUpdateComponentTypeOutput(v **UpdateComponentTypeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPropertiesOutput(v **ListPropertiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5259,49 +5327,27 @@ func awsRestjson1_deserializeOpDocumentUpdateComponentTypeOutput(v **UpdateCompo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateComponentTypeOutput + var sv *ListPropertiesOutput if *v == nil { - sv = &UpdateComponentTypeOutput{} + sv = &ListPropertiesOutput{} } 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 TwinMakerArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "componentTypeId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) - } - sv.ComponentTypeId = ptr.String(jtv) - } - - case "state": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected State to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.State = types.State(jtv) + sv.NextToken = ptr.String(jtv) } - case "workspaceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Id to be of type string, got %T instead", value) - } - sv.WorkspaceId = ptr.String(jtv) + case "propertySummaries": + if err := awsRestjson1_deserializeDocumentPropertySummaries(&sv.PropertySummaries, value); err != nil { + return err } default: @@ -5313,14 +5359,14 @@ func awsRestjson1_deserializeOpDocumentUpdateComponentTypeOutput(v **UpdateCompo return nil } -type awsRestjson1_deserializeOpUpdateEntity struct { +type awsRestjson1_deserializeOpListScenes struct { } -func (*awsRestjson1_deserializeOpUpdateEntity) ID() string { +func (*awsRestjson1_deserializeOpListScenes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateEntity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListScenes) 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) @@ -5334,9 +5380,9 @@ func (m *awsRestjson1_deserializeOpUpdateEntity) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateEntity(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListScenes(response, &metadata) } - output := &UpdateEntityOutput{} + output := &ListScenesOutput{} out.Result = output var buff [1024]byte @@ -5357,7 +5403,7 @@ func (m *awsRestjson1_deserializeOpUpdateEntity) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateEntityOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListScenesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5370,7 +5416,7 @@ func (m *awsRestjson1_deserializeOpUpdateEntity) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateEntity(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListScenes(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)} @@ -5414,18 +5460,9 @@ func awsRestjson1_deserializeOpErrorUpdateEntity(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5442,7 +5479,7 @@ func awsRestjson1_deserializeOpErrorUpdateEntity(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateEntityOutput(v **UpdateEntityOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListScenesOutput(v **ListScenesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5455,38 +5492,27 @@ func awsRestjson1_deserializeOpDocumentUpdateEntityOutput(v **UpdateEntityOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateEntityOutput + var sv *ListScenesOutput if *v == nil { - sv = &UpdateEntityOutput{} + sv = &ListScenesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "state": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected State to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.State = types.State(jtv) + sv.NextToken = ptr.String(jtv) } - case "updateDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } + case "sceneSummaries": + if err := awsRestjson1_deserializeDocumentSceneSummaries(&sv.SceneSummaries, value); err != nil { + return err } default: @@ -5498,14 +5524,14 @@ func awsRestjson1_deserializeOpDocumentUpdateEntityOutput(v **UpdateEntityOutput return nil } -type awsRestjson1_deserializeOpUpdatePricingPlan struct { +type awsRestjson1_deserializeOpListSyncJobs struct { } -func (*awsRestjson1_deserializeOpUpdatePricingPlan) ID() string { +func (*awsRestjson1_deserializeOpListSyncJobs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdatePricingPlan) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSyncJobs) 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) @@ -5519,9 +5545,9 @@ func (m *awsRestjson1_deserializeOpUpdatePricingPlan) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdatePricingPlan(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSyncJobs(response, &metadata) } - output := &UpdatePricingPlanOutput{} + output := &ListSyncJobsOutput{} out.Result = output var buff [1024]byte @@ -5542,7 +5568,7 @@ func (m *awsRestjson1_deserializeOpUpdatePricingPlan) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdatePricingPlanOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSyncJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5555,7 +5581,7 @@ func (m *awsRestjson1_deserializeOpUpdatePricingPlan) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdatePricingPlan(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSyncJobs(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)} @@ -5602,6 +5628,9 @@ func awsRestjson1_deserializeOpErrorUpdatePricingPlan(response *smithyhttp.Respo case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5618,7 +5647,7 @@ func awsRestjson1_deserializeOpErrorUpdatePricingPlan(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentUpdatePricingPlanOutput(v **UpdatePricingPlanOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSyncJobsOutput(v **ListSyncJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5631,22 +5660,26 @@ func awsRestjson1_deserializeOpDocumentUpdatePricingPlanOutput(v **UpdatePricing return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdatePricingPlanOutput + var sv *ListSyncJobsOutput if *v == nil { - sv = &UpdatePricingPlanOutput{} + sv = &ListSyncJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "currentPricingPlan": - if err := awsRestjson1_deserializeDocumentPricingPlan(&sv.CurrentPricingPlan, value); err != nil { - return err + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) } - case "pendingPricingPlan": - if err := awsRestjson1_deserializeDocumentPricingPlan(&sv.PendingPricingPlan, value); err != nil { + case "syncJobSummaries": + if err := awsRestjson1_deserializeDocumentSyncJobSummaries(&sv.SyncJobSummaries, value); err != nil { return err } @@ -5659,14 +5692,14 @@ func awsRestjson1_deserializeOpDocumentUpdatePricingPlanOutput(v **UpdatePricing return nil } -type awsRestjson1_deserializeOpUpdateScene struct { +type awsRestjson1_deserializeOpListSyncResources struct { } -func (*awsRestjson1_deserializeOpUpdateScene) ID() string { +func (*awsRestjson1_deserializeOpListSyncResources) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateScene) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSyncResources) 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) @@ -5680,9 +5713,9 @@ func (m *awsRestjson1_deserializeOpUpdateScene) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateScene(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSyncResources(response, &metadata) } - output := &UpdateSceneOutput{} + output := &ListSyncResourcesOutput{} out.Result = output var buff [1024]byte @@ -5703,7 +5736,7 @@ func (m *awsRestjson1_deserializeOpUpdateScene) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateSceneOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSyncResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5716,7 +5749,7 @@ func (m *awsRestjson1_deserializeOpUpdateScene) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateScene(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSyncResources(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)} @@ -5763,8 +5796,8 @@ func awsRestjson1_deserializeOpErrorUpdateScene(response *smithyhttp.Response, m case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -5782,7 +5815,7 @@ func awsRestjson1_deserializeOpErrorUpdateScene(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentUpdateSceneOutput(v **UpdateSceneOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSyncResourcesOutput(v **ListSyncResourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5795,29 +5828,27 @@ func awsRestjson1_deserializeOpDocumentUpdateSceneOutput(v **UpdateSceneOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateSceneOutput + var sv *ListSyncResourcesOutput if *v == nil { - sv = &UpdateSceneOutput{} + sv = &ListSyncResourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "updateDateTime": + case "nextToken": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } + sv.NextToken = ptr.String(jtv) + } + + case "syncResources": + if err := awsRestjson1_deserializeDocumentSyncResourceSummaries(&sv.SyncResources, value); err != nil { + return err } default: @@ -5829,14 +5860,14 @@ func awsRestjson1_deserializeOpDocumentUpdateSceneOutput(v **UpdateSceneOutput, return nil } -type awsRestjson1_deserializeOpUpdateWorkspace struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpUpdateWorkspace) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateWorkspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -5850,9 +5881,9 @@ func (m *awsRestjson1_deserializeOpUpdateWorkspace) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateWorkspace(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UpdateWorkspaceOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -5873,7 +5904,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkspace) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateWorkspaceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5886,7 +5917,7 @@ func (m *awsRestjson1_deserializeOpUpdateWorkspace) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -5930,21 +5961,9 @@ func awsRestjson1_deserializeOpErrorUpdateWorkspace(response *smithyhttp.Respons case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5955,7 +5974,7 @@ func awsRestjson1_deserializeOpErrorUpdateWorkspace(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentUpdateWorkspaceOutput(v **UpdateWorkspaceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5968,29 +5987,27 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkspaceOutput(v **UpdateWorkspace return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateWorkspaceOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &UpdateWorkspaceOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "updateDateTime": + case "nextToken": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } + sv.NextToken = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -6002,12 +6019,37 @@ func awsRestjson1_deserializeOpDocumentUpdateWorkspaceOutput(v **UpdateWorkspace return nil } -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} +type awsRestjson1_deserializeOpListWorkspaces struct { +} + +func (*awsRestjson1_deserializeOpListWorkspaces) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWorkspaces) 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_deserializeOpErrorListWorkspaces(response, &metadata) + } + output := &ListWorkspacesOutput{} + 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{} @@ -6018,36 +6060,45 @@ func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Res Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentListWorkspacesOutput(&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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictException{} +func awsRestjson1_deserializeOpErrorListWorkspaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -6057,69 +6108,134 @@ func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Respons return err } - err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + 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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +func awsRestjson1_deserializeOpDocumentListWorkspacesOutput(v **ListWorkspacesOutput, 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) + } -func awsRestjson1_deserializeErrorConnectorFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConnectorFailureException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + var sv *ListWorkspacesOutput + if *v == nil { + sv = &ListWorkspacesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "workspaceSummaries": + if err := awsRestjson1_deserializeDocumentWorkspaceSummaries(&sv.WorkspaceSummaries, value); err != nil { + return err + } + + 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_deserializeDocumentConnectorFailureException(&output, shape) +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 { - 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 + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output + 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_deserializeErrorConnectorTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConnectorTimeoutException{} +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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -6129,80 +6245,85 @@ func awsRestjson1_deserializeErrorConnectorTimeoutException(response *smithyhttp return err } - err := awsRestjson1_deserializeDocumentConnectorTimeoutException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + 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("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpUntagResource struct { +} - return output +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +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 + } - 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 + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output - 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 + 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()) - errorBody.Seek(0, io.SeekStart) + errorCode := "UnknownError" + errorMessage := errorCode - return output -} + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } -func awsRestjson1_deserializeErrorQueryTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.QueryTimeoutException{} 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_deserializeDocumentQueryTimeoutException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6214,52 +6335,61 @@ func awsRestjson1_deserializeErrorQueryTimeoutException(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output -} + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - 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(), + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) +type awsRestjson1_deserializeOpUpdateComponentType struct { +} + +func (*awsRestjson1_deserializeOpUpdateComponentType) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpUpdateComponentType) 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 { - 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 + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateComponentType(response, &metadata) + } + output := &UpdateComponentTypeOutput{} + out.Result = output -func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceQuotaExceededException{} 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{} @@ -6270,83 +6400,44 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentUpdateComponentTypeOutput(&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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} - 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 +func awsRestjson1_deserializeOpErrorUpdateComponentType(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()) - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + errorCode := "UnknownError" + errorMessage := errorCode - 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 + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTagsException{} 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_deserializeDocumentTooManyTagsException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6358,16 +6449,140 @@ func awsRestjson1_deserializeErrorTooManyTagsException(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output -} + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateComponentTypeOutput(v **UpdateComponentTypeOutput, 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 *UpdateComponentTypeOutput + if *v == nil { + sv = &UpdateComponentTypeOutput{} + } 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 TwinMakerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "componentTypeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) + } + sv.ComponentTypeId = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected State to be of type string, got %T instead", value) + } + sv.State = types.State(jtv) + } + + case "workspaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.WorkspaceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateEntity struct { +} + +func (*awsRestjson1_deserializeOpUpdateEntity) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateEntity) 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_deserializeOpErrorUpdateEntity(response, &metadata) + } + output := &UpdateEntityOutput{} + out.Result = output -func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ValidationException{} 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{} @@ -6378,11 +6593,44 @@ func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Respo Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateEntityOutput(&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_deserializeOpErrorUpdateEntity(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6394,11 +6642,46 @@ func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateEntityOutput(v **UpdateEntityOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6411,22 +6694,2085 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *UpdateEntityOutput if *v == nil { - sv = &types.AccessDeniedException{} + sv = &UpdateEntityOutput{} } else { sv = *v } - for key, value := range shape { - switch key { - case "message": + for key, value := range shape { + switch key { + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected State to be of type string, got %T instead", value) + } + sv.State = types.State(jtv) + } + + case "updateDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdatePricingPlan struct { +} + +func (*awsRestjson1_deserializeOpUpdatePricingPlan) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePricingPlan) 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_deserializeOpErrorUpdatePricingPlan(response, &metadata) + } + output := &UpdatePricingPlanOutput{} + 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_deserializeOpDocumentUpdatePricingPlanOutput(&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_deserializeOpErrorUpdatePricingPlan(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdatePricingPlanOutput(v **UpdatePricingPlanOutput, 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 *UpdatePricingPlanOutput + if *v == nil { + sv = &UpdatePricingPlanOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currentPricingPlan": + if err := awsRestjson1_deserializeDocumentPricingPlan(&sv.CurrentPricingPlan, value); err != nil { + return err + } + + case "pendingPricingPlan": + if err := awsRestjson1_deserializeDocumentPricingPlan(&sv.PendingPricingPlan, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateScene struct { +} + +func (*awsRestjson1_deserializeOpUpdateScene) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateScene) 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_deserializeOpErrorUpdateScene(response, &metadata) + } + output := &UpdateSceneOutput{} + 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_deserializeOpDocumentUpdateSceneOutput(&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_deserializeOpErrorUpdateScene(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateSceneOutput(v **UpdateSceneOutput, 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 *UpdateSceneOutput + if *v == nil { + sv = &UpdateSceneOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "updateDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateWorkspace struct { +} + +func (*awsRestjson1_deserializeOpUpdateWorkspace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWorkspace) 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_deserializeOpErrorUpdateWorkspace(response, &metadata) + } + output := &UpdateWorkspaceOutput{} + 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_deserializeOpDocumentUpdateWorkspaceOutput(&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_deserializeOpErrorUpdateWorkspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateWorkspaceOutput(v **UpdateWorkspaceOutput, 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 *UpdateWorkspaceOutput + if *v == nil { + sv = &UpdateWorkspaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "updateDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + 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_deserializeDocumentAccessDeniedException(&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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + 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_deserializeDocumentConflictException(&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_deserializeErrorConnectorFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConnectorFailureException{} + 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_deserializeDocumentConnectorFailureException(&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_deserializeErrorConnectorTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConnectorTimeoutException{} + 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_deserializeDocumentConnectorTimeoutException(&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_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + 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_deserializeDocumentInternalServerException(&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_deserializeErrorQueryTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.QueryTimeoutException{} + 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_deserializeDocumentQueryTimeoutException(&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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + 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_deserializeDocumentResourceNotFoundException(&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_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + 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_deserializeDocumentServiceQuotaExceededException(&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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + 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_deserializeDocumentThrottlingException(&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_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTagsException{} + 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_deserializeDocumentTooManyTagsException(&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_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + 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_deserializeDocumentValidationException(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } 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 awsRestjson1_deserializeDocumentBatchPutPropertyError(v **types.BatchPutPropertyError, 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.BatchPutPropertyError + if *v == nil { + sv = &types.BatchPutPropertyError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "entry": + if err := awsRestjson1_deserializeDocumentPropertyValueEntry(&sv.Entry, value); err != nil { + return err + } + + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchPutPropertyErrorEntry(v **types.BatchPutPropertyErrorEntry, 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.BatchPutPropertyErrorEntry + if *v == nil { + sv = &types.BatchPutPropertyErrorEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errors": + if err := awsRestjson1_deserializeDocumentErrors(&sv.Errors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBundleInformation(v **types.BundleInformation, 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.BundleInformation + if *v == nil { + sv = &types.BundleInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "bundleNames": + if err := awsRestjson1_deserializeDocumentPricingBundles(&sv.BundleNames, value); err != nil { + return err + } + + case "pricingTier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PricingTier to be of type string, got %T instead", value) + } + sv.PricingTier = types.PricingTier(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentColumnDescription(v **types.ColumnDescription, 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.ColumnDescription + if *v == nil { + sv = &types.ColumnDescription{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnType to be of type string, got %T instead", value) + } + sv.Type = types.ColumnType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentColumnDescriptions(v *[]types.ColumnDescription, 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.ColumnDescription + if *v == nil { + cv = []types.ColumnDescription{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ColumnDescription + destAddr := &col + if err := awsRestjson1_deserializeDocumentColumnDescription(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentPropertyGroupResponse(v **types.ComponentPropertyGroupResponse, 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.ComponentPropertyGroupResponse + if *v == nil { + sv = &types.ComponentPropertyGroupResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "groupType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GroupType to be of type string, got %T instead", value) + } + sv.GroupType = types.GroupType(jtv) + } + + case "isInherited": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsInherited = ptr.Bool(jtv) + } + + case "propertyNames": + if err := awsRestjson1_deserializeDocumentPropertyNames(&sv.PropertyNames, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentPropertyGroupResponses(v *map[string]types.ComponentPropertyGroupResponse, 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 mv map[string]types.ComponentPropertyGroupResponse + if *v == nil { + mv = map[string]types.ComponentPropertyGroupResponse{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.ComponentPropertyGroupResponse + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentComponentPropertyGroupResponse(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentComponentResponse(v **types.ComponentResponse, 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.ComponentResponse + if *v == nil { + sv = &types.ComponentResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "areAllCompositeComponentsReturned": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AreAllCompositeComponentsReturned = ptr.Bool(jtv) + } + + case "areAllPropertiesReturned": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AreAllPropertiesReturned = ptr.Bool(jtv) + } + + case "componentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.ComponentName = ptr.String(jtv) + } + + case "componentTypeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) + } + sv.ComponentTypeId = ptr.String(jtv) + } + + case "compositeComponents": + if err := awsRestjson1_deserializeDocumentCompositeComponentResponse(&sv.CompositeComponents, value); err != nil { + return err + } + + case "definedIn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DefinedIn = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "properties": + if err := awsRestjson1_deserializeDocumentPropertyResponses(&sv.Properties, value); err != nil { + return err + } + + case "propertyGroups": + if err := awsRestjson1_deserializeDocumentComponentPropertyGroupResponses(&sv.PropertyGroups, value); err != nil { + return err + } + + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } + + case "syncSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SyncSource to be of type string, got %T instead", value) + } + sv.SyncSource = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentsMap(v *map[string]types.ComponentResponse, 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 mv map[string]types.ComponentResponse + if *v == nil { + mv = map[string]types.ComponentResponse{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.ComponentResponse + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentComponentResponse(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentComponentSummaries(v *[]types.ComponentSummary, 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.ComponentSummary + if *v == nil { + cv = []types.ComponentSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary, 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.ComponentSummary + if *v == nil { + sv = &types.ComponentSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "componentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.ComponentName = ptr.String(jtv) + } + + case "componentPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentPath to be of type string, got %T instead", value) + } + sv.ComponentPath = ptr.String(jtv) + } + + case "componentTypeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) + } + sv.ComponentTypeId = ptr.String(jtv) + } + + case "definedIn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DefinedIn = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "propertyGroups": + if err := awsRestjson1_deserializeDocumentComponentPropertyGroupResponses(&sv.PropertyGroups, value); err != nil { + return err + } + + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } + + case "syncSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SyncSource to be of type string, got %T instead", value) + } + sv.SyncSource = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentTypeSummaries(v *[]types.ComponentTypeSummary, 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.ComponentTypeSummary + if *v == nil { + cv = []types.ComponentTypeSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentTypeSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentTypeSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentTypeSummary(v **types.ComponentTypeSummary, 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.ComponentTypeSummary + if *v == nil { + sv = &types.ComponentTypeSummary{} + } 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 TwinMakerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "componentTypeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) + } + sv.ComponentTypeId = ptr.String(jtv) + } + + case "componentTypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentTypeName to be of type string, got %T instead", value) + } + sv.ComponentTypeName = ptr.String(jtv) + } + + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } + + case "updateDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCompositeComponentResponse(v *map[string]types.ComponentSummary, 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 mv map[string]types.ComponentSummary + if *v == nil { + mv = map[string]types.ComponentSummary{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.ComponentSummary + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentComponentSummary(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentCompositeComponentTypeResponse(v **types.CompositeComponentTypeResponse, 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.CompositeComponentTypeResponse + if *v == nil { + sv = &types.CompositeComponentTypeResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "componentTypeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) + } + sv.ComponentTypeId = ptr.String(jtv) + } + + case "isInherited": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsInherited = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCompositeComponentTypesResponse(v *map[string]types.CompositeComponentTypeResponse, 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 mv map[string]types.CompositeComponentTypeResponse + if *v == nil { + mv = map[string]types.CompositeComponentTypeResponse{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.CompositeComponentTypeResponse + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentCompositeComponentTypeResponse(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentConfiguration(v *map[string]string, 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 mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Value to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, 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.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } 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 awsRestjson1_deserializeDocumentConnectorFailureException(v **types.ConnectorFailureException, 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.ConnectorFailureException + if *v == nil { + sv = &types.ConnectorFailureException{} + } 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 awsRestjson1_deserializeDocumentConnectorTimeoutException(v **types.ConnectorTimeoutException, 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.ConnectorTimeoutException + if *v == nil { + sv = &types.ConnectorTimeoutException{} + } 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 awsRestjson1_deserializeDocumentDataConnector(v **types.DataConnector, 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.DataConnector + if *v == nil { + sv = &types.DataConnector{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "isNative": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsNative = ptr.Bool(jtv) + } + + case "lambda": + if err := awsRestjson1_deserializeDocumentLambdaFunction(&sv.Lambda, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDataType(v **types.DataType, 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.DataType + if *v == nil { + sv = &types.DataType{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "allowedValues": + if err := awsRestjson1_deserializeDocumentDataValueList(&sv.AllowedValues, value); err != nil { + return err + } + + case "nestedType": + if err := awsRestjson1_deserializeDocumentDataType(&sv.NestedType, value); err != nil { + return err + } + + case "relationship": + if err := awsRestjson1_deserializeDocumentRelationship(&sv.Relationship, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Type to be of type string, got %T instead", value) + } + sv.Type = types.Type(jtv) + } + + case "unitOfMeasure": 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 String to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.UnitOfMeasure = ptr.String(jtv) } default: @@ -6438,7 +8784,7 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsRestjson1_deserializeDocumentBatchPutPropertyError(v **types.BatchPutPropertyError, value interface{}) error { +func awsRestjson1_deserializeDocumentDataValue(v **types.DataValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6451,36 +8797,115 @@ func awsRestjson1_deserializeDocumentBatchPutPropertyError(v **types.BatchPutPro return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchPutPropertyError + var sv *types.DataValue if *v == nil { - sv = &types.BatchPutPropertyError{} + sv = &types.DataValue{} } else { sv = *v } for key, value := range shape { switch key { - case "entry": - if err := awsRestjson1_deserializeDocumentPropertyValueEntry(&sv.Entry, value); err != nil { - return err + case "booleanValue": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.BooleanValue = ptr.Bool(jtv) } - case "errorCode": + case "doubleValue": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DoubleValue = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.DoubleValue = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "expression": 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 Expression to be of type string, got %T instead", value) } - sv.ErrorCode = ptr.String(jtv) + sv.Expression = ptr.String(jtv) } - case "errorMessage": + case "integerValue": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.IntegerValue = ptr.Int32(int32(i64)) + } + + case "listValue": + if err := awsRestjson1_deserializeDocumentDataValueList(&sv.ListValue, value); err != nil { + return err + } + + case "longValue": + 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.LongValue = ptr.Int64(i64) + } + + case "mapValue": + if err := awsRestjson1_deserializeDocumentDataValueMap(&sv.MapValue, value); err != nil { + return err + } + + case "relationshipValue": + if err := awsRestjson1_deserializeDocumentRelationshipValue(&sv.RelationshipValue, value); err != nil { + return err + } + + case "stringValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ErrorMessage = ptr.String(jtv) + sv.StringValue = ptr.String(jtv) } default: @@ -6492,7 +8917,7 @@ func awsRestjson1_deserializeDocumentBatchPutPropertyError(v **types.BatchPutPro return nil } -func awsRestjson1_deserializeDocumentBatchPutPropertyErrorEntry(v **types.BatchPutPropertyErrorEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentDataValueList(v *[]types.DataValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6500,35 +8925,33 @@ func awsRestjson1_deserializeDocumentBatchPutPropertyErrorEntry(v **types.BatchP return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BatchPutPropertyErrorEntry + var cv []types.DataValue if *v == nil { - sv = &types.BatchPutPropertyErrorEntry{} + cv = []types.DataValue{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "errors": - if err := awsRestjson1_deserializeDocumentErrors(&sv.Errors, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.DataValue + destAddr := &col + if err := awsRestjson1_deserializeDocumentDataValue(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentBundleInformation(v **types.BundleInformation, value interface{}) error { +func awsRestjson1_deserializeDocumentDataValueMap(v *map[string]types.DataValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6541,39 +8964,29 @@ func awsRestjson1_deserializeDocumentBundleInformation(v **types.BundleInformati return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BundleInformation + var mv map[string]types.DataValue if *v == nil { - sv = &types.BundleInformation{} + mv = map[string]types.DataValue{} } else { - sv = *v + mv = *v } for key, value := range shape { - switch key { - case "bundleNames": - if err := awsRestjson1_deserializeDocumentPricingBundles(&sv.BundleNames, value); err != nil { - return err - } - - case "pricingTier": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PricingTier to be of type string, got %T instead", value) - } - sv.PricingTier = types.PricingTier(jtv) - } - - default: - _, _ = key, value - + var parsedVal types.DataValue + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentDataValue(&destAddr, value); err != nil { + return err } + parsedVal = *destAddr + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsRestjson1_deserializeDocumentColumnDescription(v **types.ColumnDescription, value interface{}) error { +func awsRestjson1_deserializeDocumentDestinationConfiguration(v **types.DestinationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6586,31 +8999,32 @@ func awsRestjson1_deserializeDocumentColumnDescription(v **types.ColumnDescripti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ColumnDescription + var sv *types.DestinationConfiguration if *v == nil { - sv = &types.ColumnDescription{} + sv = &types.DestinationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) + case "iotTwinMakerConfiguration": + if err := awsRestjson1_deserializeDocumentIotTwinMakerDestinationConfiguration(&sv.IotTwinMakerConfiguration, value); err != nil { + return err + } + + case "s3Configuration": + if err := awsRestjson1_deserializeDocumentS3DestinationConfiguration(&sv.S3Configuration, value); err != nil { + return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ColumnType to be of type string, got %T instead", value) + return fmt.Errorf("expected DestinationType to be of type string, got %T instead", value) } - sv.Type = types.ColumnType(jtv) + sv.Type = types.DestinationType(jtv) } default: @@ -6622,41 +9036,7 @@ func awsRestjson1_deserializeDocumentColumnDescription(v **types.ColumnDescripti return nil } -func awsRestjson1_deserializeDocumentColumnDescriptions(v *[]types.ColumnDescription, 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.ColumnDescription - if *v == nil { - cv = []types.ColumnDescription{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ColumnDescription - destAddr := &col - if err := awsRestjson1_deserializeDocumentColumnDescription(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentComponentPropertyGroupResponse(v **types.ComponentPropertyGroupResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentEntityPropertyReference(v **types.EntityPropertyReference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6669,36 +9049,54 @@ func awsRestjson1_deserializeDocumentComponentPropertyGroupResponse(v **types.Co return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentPropertyGroupResponse + var sv *types.EntityPropertyReference if *v == nil { - sv = &types.ComponentPropertyGroupResponse{} + sv = &types.EntityPropertyReference{} } else { sv = *v } for key, value := range shape { switch key { - case "groupType": + case "componentName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GroupType to be of type string, got %T instead", value) + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } - sv.GroupType = types.GroupType(jtv) + sv.ComponentName = ptr.String(jtv) } - case "isInherited": + case "componentPath": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected ComponentPath to be of type string, got %T instead", value) } - sv.IsInherited = ptr.Bool(jtv) + sv.ComponentPath = ptr.String(jtv) + } + + case "entityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) + } + sv.EntityId = ptr.String(jtv) + } + + case "externalIdProperty": + if err := awsRestjson1_deserializeDocumentExternalIdProperty(&sv.ExternalIdProperty, value); err != nil { + return err } - case "propertyNames": - if err := awsRestjson1_deserializeDocumentPropertyNames(&sv.PropertyNames, value); err != nil { - return err + case "propertyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.PropertyName = ptr.String(jtv) } default: @@ -6710,7 +9108,7 @@ func awsRestjson1_deserializeDocumentComponentPropertyGroupResponse(v **types.Co return nil } -func awsRestjson1_deserializeDocumentComponentPropertyGroupResponses(v *map[string]types.ComponentPropertyGroupResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentEntitySummaries(v *[]types.EntitySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6718,34 +9116,33 @@ func awsRestjson1_deserializeDocumentComponentPropertyGroupResponses(v *map[stri return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.ComponentPropertyGroupResponse + var cv []types.EntitySummary if *v == nil { - mv = map[string]types.ComponentPropertyGroupResponse{} + cv = []types.EntitySummary{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal types.ComponentPropertyGroupResponse - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentComponentPropertyGroupResponse(&destAddr, value); err != nil { + for _, value := range shape { + var col types.EntitySummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentEntitySummary(&destAddr, value); err != nil { return err } - parsedVal = *destAddr - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentComponentResponse(v **types.ComponentResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentEntitySummary(v **types.EntitySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6758,59 +9155,83 @@ func awsRestjson1_deserializeDocumentComponentResponse(v **types.ComponentRespon return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentResponse + var sv *types.EntitySummary if *v == nil { - sv = &types.ComponentResponse{} + sv = &types.EntitySummary{} } else { sv = *v } for key, value := range shape { switch key { - case "componentName": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) } - sv.ComponentName = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "componentTypeId": + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.ComponentTypeId = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "definedIn": + case "entityId": 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 EntityId to be of type string, got %T instead", value) } - sv.DefinedIn = ptr.String(jtv) + sv.EntityId = ptr.String(jtv) } - case "description": + case "entityName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) + return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.EntityName = ptr.String(jtv) } - case "properties": - if err := awsRestjson1_deserializeDocumentPropertyResponses(&sv.Properties, value); err != nil { - return err + case "hasChildEntities": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.HasChildEntities = ptr.Bool(jtv) } - case "propertyGroups": - if err := awsRestjson1_deserializeDocumentComponentPropertyGroupResponses(&sv.PropertyGroups, value); err != nil { - return err + case "parentEntityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParentEntityId to be of type string, got %T instead", value) + } + sv.ParentEntityId = ptr.String(jtv) } case "status": @@ -6818,13 +9239,20 @@ func awsRestjson1_deserializeDocumentComponentResponse(v **types.ComponentRespon return err } - case "syncSource": + case "updateDateTime": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SyncSource 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.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.SyncSource = ptr.String(jtv) } default: @@ -6836,7 +9264,7 @@ func awsRestjson1_deserializeDocumentComponentResponse(v **types.ComponentRespon return nil } -func awsRestjson1_deserializeDocumentComponentsMap(v *map[string]types.ComponentResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentErrorDetails(v **types.ErrorDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6849,29 +9277,43 @@ func awsRestjson1_deserializeDocumentComponentsMap(v *map[string]types.Component return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.ComponentResponse + var sv *types.ErrorDetails if *v == nil { - mv = map[string]types.ComponentResponse{} + sv = &types.ErrorDetails{} } else { - mv = *v + sv = *v } for key, value := range shape { - var parsedVal types.ComponentResponse - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentComponentResponse(&destAddr, value); err != nil { - return err - } - parsedVal = *destAddr - mv[key] = parsedVal + 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 ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + default: + _, _ = key, value + + } } - *v = mv + *v = sv return nil } -func awsRestjson1_deserializeDocumentComponentTypeSummaries(v *[]types.ComponentTypeSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentErrorEntries(v *[]types.BatchPutPropertyErrorEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6884,17 +9326,17 @@ func awsRestjson1_deserializeDocumentComponentTypeSummaries(v *[]types.Component return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ComponentTypeSummary + var cv []types.BatchPutPropertyErrorEntry if *v == nil { - cv = []types.ComponentTypeSummary{} + cv = []types.BatchPutPropertyErrorEntry{} } else { cv = *v } for _, value := range shape { - var col types.ComponentTypeSummary + var col types.BatchPutPropertyErrorEntry destAddr := &col - if err := awsRestjson1_deserializeDocumentComponentTypeSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBatchPutPropertyErrorEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -6905,7 +9347,7 @@ func awsRestjson1_deserializeDocumentComponentTypeSummaries(v *[]types.Component return nil } -func awsRestjson1_deserializeDocumentComponentTypeSummary(v **types.ComponentTypeSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentErrors(v *[]types.BatchPutPropertyError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6913,103 +9355,33 @@ func awsRestjson1_deserializeDocumentComponentTypeSummary(v **types.ComponentTyp return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentTypeSummary + var cv []types.BatchPutPropertyError if *v == nil { - sv = &types.ComponentTypeSummary{} + cv = []types.BatchPutPropertyError{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "componentTypeId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) - } - sv.ComponentTypeId = ptr.String(jtv) - } - - case "componentTypeName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentTypeName to be of type string, got %T instead", value) - } - sv.ComponentTypeName = ptr.String(jtv) - } - - case "creationDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "status": - if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { - return err - } - - case "updateDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.BatchPutPropertyError + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchPutPropertyError(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentConfiguration(v *map[string]string, value interface{}) error { +func awsRestjson1_deserializeDocumentExtendsFrom(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7017,35 +9389,35 @@ func awsRestjson1_deserializeDocumentConfiguration(v *map[string]string, value i return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var cv []string if *v == nil { - mv = map[string]string{} + cv = []string{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal string + for _, value := range shape { + var col string if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Value to be of type string, got %T instead", value) + return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) } - parsedVal = jtv + col = jtv } - mv[key] = parsedVal + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { +func awsRestjson1_deserializeDocumentExternalIdProperty(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7058,34 +9430,30 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConflictException + var mv map[string]string if *v == nil { - sv = &types.ConflictException{} + mv = map[string]string{} } else { - sv = *v + mv = *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) + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + parsedVal = jtv } + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsRestjson1_deserializeDocumentConnectorFailureException(v **types.ConnectorFailureException, value interface{}) error { +func awsRestjson1_deserializeDocumentFilterByAsset(v **types.FilterByAsset, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7098,22 +9466,49 @@ func awsRestjson1_deserializeDocumentConnectorFailureException(v **types.Connect return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConnectorFailureException + var sv *types.FilterByAsset if *v == nil { - sv = &types.ConnectorFailureException{} + sv = &types.FilterByAsset{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "assetExternalId": 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 SiteWiseExternalId to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.AssetExternalId = ptr.String(jtv) + } + + case "assetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssetId = ptr.String(jtv) + } + + case "includeAssetModel": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IncludeAssetModel = ptr.Bool(jtv) + } + + case "includeOffspring": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IncludeOffspring = ptr.Bool(jtv) } default: @@ -7125,7 +9520,7 @@ func awsRestjson1_deserializeDocumentConnectorFailureException(v **types.Connect return nil } -func awsRestjson1_deserializeDocumentConnectorTimeoutException(v **types.ConnectorTimeoutException, value interface{}) error { +func awsRestjson1_deserializeDocumentFilterByAssetModel(v **types.FilterByAssetModel, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7138,22 +9533,49 @@ func awsRestjson1_deserializeDocumentConnectorTimeoutException(v **types.Connect return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConnectorTimeoutException + var sv *types.FilterByAssetModel if *v == nil { - sv = &types.ConnectorTimeoutException{} + sv = &types.FilterByAssetModel{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "assetModelExternalId": 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 SiteWiseExternalId to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.AssetModelExternalId = ptr.String(jtv) + } + + case "assetModelId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.AssetModelId = ptr.String(jtv) + } + + case "includeAssets": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IncludeAssets = ptr.Bool(jtv) + } + + case "includeOffspring": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IncludeOffspring = ptr.Bool(jtv) } default: @@ -7165,7 +9587,7 @@ func awsRestjson1_deserializeDocumentConnectorTimeoutException(v **types.Connect return nil } -func awsRestjson1_deserializeDocumentDataConnector(v **types.DataConnector, value interface{}) error { +func awsRestjson1_deserializeDocumentFilterByComponentType(v **types.FilterByComponentType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7178,27 +9600,22 @@ func awsRestjson1_deserializeDocumentDataConnector(v **types.DataConnector, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DataConnector + var sv *types.FilterByComponentType if *v == nil { - sv = &types.DataConnector{} + sv = &types.FilterByComponentType{} } else { sv = *v } for key, value := range shape { switch key { - case "isNative": + case "componentTypeId": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) } - sv.IsNative = ptr.Bool(jtv) - } - - case "lambda": - if err := awsRestjson1_deserializeDocumentLambdaFunction(&sv.Lambda, value); err != nil { - return err + sv.ComponentTypeId = ptr.String(jtv) } default: @@ -7210,7 +9627,7 @@ func awsRestjson1_deserializeDocumentDataConnector(v **types.DataConnector, valu return nil } -func awsRestjson1_deserializeDocumentDataType(v **types.DataType, value interface{}) error { +func awsRestjson1_deserializeDocumentFilterByEntity(v **types.FilterByEntity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7223,46 +9640,22 @@ func awsRestjson1_deserializeDocumentDataType(v **types.DataType, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DataType + var sv *types.FilterByEntity if *v == nil { - sv = &types.DataType{} + sv = &types.FilterByEntity{} } else { sv = *v } for key, value := range shape { switch key { - case "allowedValues": - if err := awsRestjson1_deserializeDocumentDataValueList(&sv.AllowedValues, value); err != nil { - return err - } - - case "nestedType": - if err := awsRestjson1_deserializeDocumentDataType(&sv.NestedType, value); err != nil { - return err - } - - case "relationship": - if err := awsRestjson1_deserializeDocumentRelationship(&sv.Relationship, value); err != nil { - return err - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Type to be of type string, got %T instead", value) - } - sv.Type = types.Type(jtv) - } - - case "unitOfMeasure": + case "entityId": 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 EntityId to be of type string, got %T instead", value) } - sv.UnitOfMeasure = ptr.String(jtv) + sv.EntityId = ptr.String(jtv) } default: @@ -7274,7 +9667,7 @@ func awsRestjson1_deserializeDocumentDataType(v **types.DataType, value interfac return nil } -func awsRestjson1_deserializeDocumentDataValue(v **types.DataValue, value interface{}) error { +func awsRestjson1_deserializeDocumentFunctionResponse(v **types.FunctionResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7287,115 +9680,41 @@ func awsRestjson1_deserializeDocumentDataValue(v **types.DataValue, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DataValue + var sv *types.FunctionResponse if *v == nil { - sv = &types.DataValue{} + sv = &types.FunctionResponse{} } else { sv = *v } for key, value := range shape { switch key { - case "booleanValue": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.BooleanValue = ptr.Bool(jtv) - } - - case "doubleValue": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DoubleValue = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.DoubleValue = ptr.Float64(f64) - - default: - return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) - - } - } - - case "expression": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Expression to be of type string, got %T instead", value) - } - sv.Expression = ptr.String(jtv) - } - - case "integerValue": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.IntegerValue = ptr.Int32(int32(i64)) - } - - case "listValue": - if err := awsRestjson1_deserializeDocumentDataValueList(&sv.ListValue, value); err != nil { - return err - } - - case "longValue": - 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.LongValue = ptr.Int64(i64) - } - - case "mapValue": - if err := awsRestjson1_deserializeDocumentDataValueMap(&sv.MapValue, value); err != nil { + case "implementedBy": + if err := awsRestjson1_deserializeDocumentDataConnector(&sv.ImplementedBy, value); err != nil { return err } - case "relationshipValue": - if err := awsRestjson1_deserializeDocumentRelationshipValue(&sv.RelationshipValue, value); err != nil { + case "isInherited": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsInherited = ptr.Bool(jtv) + } + + case "requiredProperties": + if err := awsRestjson1_deserializeDocumentRequiredProperties(&sv.RequiredProperties, value); err != nil { return err } - case "stringValue": + case "scope": 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 Scope to be of type string, got %T instead", value) } - sv.StringValue = ptr.String(jtv) + sv.Scope = types.Scope(jtv) } default: @@ -7407,7 +9726,7 @@ func awsRestjson1_deserializeDocumentDataValue(v **types.DataValue, value interf return nil } -func awsRestjson1_deserializeDocumentDataValueList(v *[]types.DataValue, value interface{}) error { +func awsRestjson1_deserializeDocumentFunctionsResponse(v *map[string]types.FunctionResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7415,33 +9734,34 @@ func awsRestjson1_deserializeDocumentDataValueList(v *[]types.DataValue, value i 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.DataValue + var mv map[string]types.FunctionResponse if *v == nil { - cv = []types.DataValue{} + mv = map[string]types.FunctionResponse{} } else { - cv = *v + mv = *v } - for _, value := range shape { - var col types.DataValue - destAddr := &col - if err := awsRestjson1_deserializeDocumentDataValue(&destAddr, value); err != nil { + for key, value := range shape { + var parsedVal types.FunctionResponse + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentFunctionResponse(&destAddr, value); err != nil { return err } - col = *destAddr - cv = append(cv, col) + parsedVal = *destAddr + mv[key] = parsedVal } - *v = cv + *v = mv return nil } -func awsRestjson1_deserializeDocumentDataValueMap(v *map[string]types.DataValue, value interface{}) error { +func awsRestjson1_deserializeDocumentGeneratedSceneMetadataMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7454,21 +9774,22 @@ func awsRestjson1_deserializeDocumentDataValueMap(v *map[string]types.DataValue, return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.DataValue + var mv map[string]string if *v == nil { - mv = map[string]types.DataValue{} + mv = map[string]string{} } else { mv = *v } for key, value := range shape { - var parsedVal types.DataValue - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentDataValue(&destAddr, value); err != nil { - return err + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SceneMetadataValue to be of type string, got %T instead", value) + } + parsedVal = jtv } - parsedVal = *destAddr mv[key] = parsedVal } @@ -7476,7 +9797,7 @@ func awsRestjson1_deserializeDocumentDataValueMap(v *map[string]types.DataValue, return nil } -func awsRestjson1_deserializeDocumentEntityPropertyReference(v **types.EntityPropertyReference, value interface{}) error { +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7489,57 +9810,120 @@ func awsRestjson1_deserializeDocumentEntityPropertyReference(v **types.EntityPro return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EntityPropertyReference + var sv *types.InternalServerException if *v == nil { - sv = &types.EntityPropertyReference{} + sv = &types.InternalServerException{} } else { sv = *v } for key, value := range shape { switch key { - case "componentName": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.ComponentName = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "entityId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) - } - sv.EntityId = ptr.String(jtv) + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIotSiteWiseSourceConfiguration(v **types.IotSiteWiseSourceConfiguration, 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.IotSiteWiseSourceConfiguration + if *v == nil { + sv = &types.IotSiteWiseSourceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "filters": + if err := awsRestjson1_deserializeDocumentIotSiteWiseSourceConfigurationFilters(&sv.Filters, value); err != nil { + return err } - case "externalIdProperty": - if err := awsRestjson1_deserializeDocumentExternalIdProperty(&sv.ExternalIdProperty, value); err != nil { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIotSiteWiseSourceConfigurationFilter(v *types.IotSiteWiseSourceConfigurationFilter, 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 uv types.IotSiteWiseSourceConfigurationFilter +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "filterByAsset": + var mv types.FilterByAsset + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFilterByAsset(&destAddr, value); err != nil { return err } + mv = *destAddr + uv = &types.IotSiteWiseSourceConfigurationFilterMemberFilterByAsset{Value: mv} + break loop - case "propertyName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.PropertyName = ptr.String(jtv) + case "filterByAssetModel": + var mv types.FilterByAssetModel + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFilterByAssetModel(&destAddr, value); err != nil { + return err } + mv = *destAddr + uv = &types.IotSiteWiseSourceConfigurationFilterMemberFilterByAssetModel{Value: mv} + break loop default: - _, _ = key, value + uv = &types.UnknownUnionMember{Tag: key} + break loop } } - *v = sv + *v = uv return nil } -func awsRestjson1_deserializeDocumentEntitySummaries(v *[]types.EntitySummary, value interface{}) error { +func awsRestjson1_deserializeDocumentIotSiteWiseSourceConfigurationFilters(v *[]types.IotSiteWiseSourceConfigurationFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7552,20 +9936,18 @@ func awsRestjson1_deserializeDocumentEntitySummaries(v *[]types.EntitySummary, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.EntitySummary + var cv []types.IotSiteWiseSourceConfigurationFilter if *v == nil { - cv = []types.EntitySummary{} + cv = []types.IotSiteWiseSourceConfigurationFilter{} } else { cv = *v } for _, value := range shape { - var col types.EntitySummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentEntitySummary(&destAddr, value); err != nil { + var col types.IotSiteWiseSourceConfigurationFilter + if err := awsRestjson1_deserializeDocumentIotSiteWiseSourceConfigurationFilter(&col, value); err != nil { return err } - col = *destAddr cv = append(cv, col) } @@ -7573,7 +9955,7 @@ func awsRestjson1_deserializeDocumentEntitySummaries(v *[]types.EntitySummary, v return nil } -func awsRestjson1_deserializeDocumentEntitySummary(v **types.EntitySummary, value interface{}) error { +func awsRestjson1_deserializeDocumentIotTwinMakerDestinationConfiguration(v **types.IotTwinMakerDestinationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7586,104 +9968,22 @@ func awsRestjson1_deserializeDocumentEntitySummary(v **types.EntitySummary, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EntitySummary + var sv *types.IotTwinMakerDestinationConfiguration if *v == nil { - sv = &types.EntitySummary{} + sv = &types.IotTwinMakerDestinationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": + case "workspace": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TwinMakerArn to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) - } - - case "creationDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "entityId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) - } - sv.EntityId = ptr.String(jtv) - } - - case "entityName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) - } - sv.EntityName = ptr.String(jtv) - } - - case "hasChildEntities": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.HasChildEntities = ptr.Bool(jtv) - } - - case "parentEntityId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ParentEntityId to be of type string, got %T instead", value) - } - sv.ParentEntityId = ptr.String(jtv) - } - - case "status": - if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { - return err - } - - case "updateDateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } + sv.Workspace = ptr.String(jtv) } default: @@ -7695,7 +9995,7 @@ func awsRestjson1_deserializeDocumentEntitySummary(v **types.EntitySummary, valu return nil } -func awsRestjson1_deserializeDocumentErrorDetails(v **types.ErrorDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentIotTwinMakerSourceConfiguration(v **types.IotTwinMakerSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7708,31 +10008,27 @@ func awsRestjson1_deserializeDocumentErrorDetails(v **types.ErrorDetails, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ErrorDetails + var sv *types.IotTwinMakerSourceConfiguration if *v == nil { - sv = &types.ErrorDetails{} + sv = &types.IotTwinMakerSourceConfiguration{} } 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 "filters": + if err := awsRestjson1_deserializeDocumentIotTwinMakerSourceConfigurationFilters(&sv.Filters, value); err != nil { + return err } - case "message": + case "workspace": 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 TwinMakerArn to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Workspace = ptr.String(jtv) } default: @@ -7744,7 +10040,7 @@ func awsRestjson1_deserializeDocumentErrorDetails(v **types.ErrorDetails, value return nil } -func awsRestjson1_deserializeDocumentErrorEntries(v *[]types.BatchPutPropertyErrorEntry, value interface{}) error { +func awsRestjson1_deserializeDocumentIotTwinMakerSourceConfigurationFilter(v *types.IotTwinMakerSourceConfigurationFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7752,33 +10048,49 @@ func awsRestjson1_deserializeDocumentErrorEntries(v *[]types.BatchPutPropertyErr 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.BatchPutPropertyErrorEntry - if *v == nil { - cv = []types.BatchPutPropertyErrorEntry{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.BatchPutPropertyErrorEntry - destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchPutPropertyErrorEntry(&destAddr, value); err != nil { - return err + var uv types.IotTwinMakerSourceConfigurationFilter +loop: + for key, value := range shape { + if value == nil { + continue } - col = *destAddr - cv = append(cv, col) + switch key { + case "filterByComponentType": + var mv types.FilterByComponentType + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFilterByComponentType(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.IotTwinMakerSourceConfigurationFilterMemberFilterByComponentType{Value: mv} + break loop + + case "filterByEntity": + var mv types.FilterByEntity + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFilterByEntity(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.IotTwinMakerSourceConfigurationFilterMemberFilterByEntity{Value: mv} + break loop + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } } - *v = cv + *v = uv return nil } -func awsRestjson1_deserializeDocumentErrors(v *[]types.BatchPutPropertyError, value interface{}) error { +func awsRestjson1_deserializeDocumentIotTwinMakerSourceConfigurationFilters(v *[]types.IotTwinMakerSourceConfigurationFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7791,20 +10103,18 @@ func awsRestjson1_deserializeDocumentErrors(v *[]types.BatchPutPropertyError, va return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BatchPutPropertyError + var cv []types.IotTwinMakerSourceConfigurationFilter if *v == nil { - cv = []types.BatchPutPropertyError{} + cv = []types.IotTwinMakerSourceConfigurationFilter{} } else { cv = *v } for _, value := range shape { - var col types.BatchPutPropertyError - destAddr := &col - if err := awsRestjson1_deserializeDocumentBatchPutPropertyError(&destAddr, value); err != nil { + var col types.IotTwinMakerSourceConfigurationFilter + if err := awsRestjson1_deserializeDocumentIotTwinMakerSourceConfigurationFilter(&col, value); err != nil { return err } - col = *destAddr cv = append(cv, col) } @@ -7812,7 +10122,7 @@ func awsRestjson1_deserializeDocumentErrors(v *[]types.BatchPutPropertyError, va return nil } -func awsRestjson1_deserializeDocumentExtendsFrom(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentLambdaFunction(v **types.LambdaFunction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7820,35 +10130,39 @@ func awsRestjson1_deserializeDocumentExtendsFrom(v *[]string, value interface{}) return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.LambdaFunction if *v == nil { - cv = []string{} + sv = &types.LambdaFunction{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentTypeId to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LambdaArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentExternalIdProperty(v *map[string]string, value interface{}) error { +func awsRestjson1_deserializeDocumentLinkedServices(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7856,35 +10170,35 @@ func awsRestjson1_deserializeDocumentExternalIdProperty(v *map[string]string, va return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var cv []string if *v == nil { - mv = map[string]string{} + cv = []string{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal string + for _, value := range shape { + var col string 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 LinkedService to be of type string, got %T instead", value) } - parsedVal = jtv + col = jtv } - mv[key] = parsedVal + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentFunctionResponse(v **types.FunctionResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentMetadataTransferJobProgress(v **types.MetadataTransferJobProgress, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7897,41 +10211,65 @@ func awsRestjson1_deserializeDocumentFunctionResponse(v **types.FunctionResponse return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FunctionResponse + var sv *types.MetadataTransferJobProgress if *v == nil { - sv = &types.FunctionResponse{} + sv = &types.MetadataTransferJobProgress{} } else { sv = *v } for key, value := range shape { switch key { - case "implementedBy": - if err := awsRestjson1_deserializeDocumentDataConnector(&sv.ImplementedBy, value); err != nil { - return err + case "failedCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FailedCount = ptr.Int32(int32(i64)) } - case "isInherited": + case "skippedCount": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.IsInherited = ptr.Bool(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SkippedCount = ptr.Int32(int32(i64)) } - case "requiredProperties": - if err := awsRestjson1_deserializeDocumentRequiredProperties(&sv.RequiredProperties, value); err != nil { - return err + case "succeededCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SucceededCount = ptr.Int32(int32(i64)) } - case "scope": + case "totalCount": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Scope to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.Scope = types.Scope(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalCount = ptr.Int32(int32(i64)) } default: @@ -7943,7 +10281,7 @@ func awsRestjson1_deserializeDocumentFunctionResponse(v **types.FunctionResponse return nil } -func awsRestjson1_deserializeDocumentFunctionsResponse(v *map[string]types.FunctionResponse, value interface{}) error { +func awsRestjson1_deserializeDocumentMetadataTransferJobStatus(v **types.MetadataTransferJobStatus, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7956,29 +10294,52 @@ func awsRestjson1_deserializeDocumentFunctionsResponse(v *map[string]types.Funct return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.FunctionResponse + var sv *types.MetadataTransferJobStatus if *v == nil { - mv = map[string]types.FunctionResponse{} + sv = &types.MetadataTransferJobStatus{} } else { - mv = *v + sv = *v } for key, value := range shape { - var parsedVal types.FunctionResponse - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentFunctionResponse(&destAddr, value); err != nil { - return err - } - parsedVal = *destAddr - mv[key] = parsedVal + switch key { + case "error": + if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.Error, value); err != nil { + return err + } + + case "queuedPosition": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.QueuedPosition = ptr.Int32(int32(i64)) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetadataTransferJobState to be of type string, got %T instead", value) + } + sv.State = types.MetadataTransferJobState(jtv) + } + default: + _, _ = key, value + + } } - *v = mv + *v = sv return nil } -func awsRestjson1_deserializeDocumentGeneratedSceneMetadataMap(v *map[string]string, value interface{}) error { +func awsRestjson1_deserializeDocumentMetadataTransferJobSummaries(v *[]types.MetadataTransferJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7986,35 +10347,33 @@ func awsRestjson1_deserializeDocumentGeneratedSceneMetadataMap(v *map[string]str return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var cv []types.MetadataTransferJobSummary if *v == nil { - mv = map[string]string{} + cv = []types.MetadataTransferJobSummary{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SceneMetadataValue to be of type string, got %T instead", value) - } - parsedVal = jtv + for _, value := range shape { + var col types.MetadataTransferJobSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentMetadataTransferJobSummary(&destAddr, value); err != nil { + return err } - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { +func awsRestjson1_deserializeDocumentMetadataTransferJobSummary(v **types.MetadataTransferJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8027,62 +10386,73 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InternalServerException + var sv *types.MetadataTransferJobSummary if *v == nil { - sv = &types.InternalServerException{} + sv = &types.MetadataTransferJobSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "arn": 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 TwinMakerArn to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - default: - _, _ = key, value + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - } - } - *v = sv - return nil -} + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) -func awsRestjson1_deserializeDocumentLambdaFunction(v **types.LambdaFunction, 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) - } + case "metadataTransferJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.MetadataTransferJobId = ptr.String(jtv) + } - var sv *types.LambdaFunction - if *v == nil { - sv = &types.LambdaFunction{} - } else { - sv = *v - } + case "progress": + if err := awsRestjson1_deserializeDocumentMetadataTransferJobProgress(&sv.Progress, value); err != nil { + return err + } + + case "status": + if err := awsRestjson1_deserializeDocumentMetadataTransferJobStatus(&sv.Status, value); err != nil { + return err + } - for key, value := range shape { - switch key { - case "arn": + case "updateDateTime": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LambdaArn 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.UpdateDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.Arn = ptr.String(jtv) } default: @@ -8605,6 +10975,15 @@ func awsRestjson1_deserializeDocumentPropertyResponse(v **types.PropertyResponse for key, value := range shape { switch key { + case "areAllPropertyValuesReturned": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AreAllPropertyValuesReturned = ptr.Bool(jtv) + } + case "definition": if err := awsRestjson1_deserializeDocumentPropertyDefinitionResponse(&sv.Definition, value); err != nil { return err @@ -8659,6 +11038,99 @@ func awsRestjson1_deserializeDocumentPropertyResponses(v *map[string]types.Prope return nil } +func awsRestjson1_deserializeDocumentPropertySummaries(v *[]types.PropertySummary, 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.PropertySummary + if *v == nil { + cv = []types.PropertySummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PropertySummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentPropertySummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPropertySummary(v **types.PropertySummary, 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.PropertySummary + if *v == nil { + sv = &types.PropertySummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "areAllPropertyValuesReturned": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AreAllPropertyValuesReturned = ptr.Bool(jtv) + } + + case "definition": + if err := awsRestjson1_deserializeDocumentPropertyDefinitionResponse(&sv.Definition, value); err != nil { + return err + } + + case "propertyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.PropertyName = ptr.String(jtv) + } + + case "value": + if err := awsRestjson1_deserializeDocumentDataValue(&sv.Value, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentPropertyTableValue(v *map[string]types.DataValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9229,6 +11701,86 @@ func awsRestjson1_deserializeDocumentRows(v *[]types.Row, value interface{}) err return nil } +func awsRestjson1_deserializeDocumentS3DestinationConfiguration(v **types.S3DestinationConfiguration, 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.S3DestinationConfiguration + if *v == nil { + sv = &types.S3DestinationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "location": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3DestinationLocation to be of type string, got %T instead", value) + } + sv.Location = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentS3SourceConfiguration(v **types.S3SourceConfiguration, 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.S3SourceConfiguration + if *v == nil { + sv = &types.S3SourceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "location": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3SourceLocation to be of type string, got %T instead", value) + } + sv.Location = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentSceneCapabilities(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9523,6 +12075,95 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } +func awsRestjson1_deserializeDocumentSourceConfiguration(v **types.SourceConfiguration, 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.SourceConfiguration + if *v == nil { + sv = &types.SourceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "iotSiteWiseConfiguration": + if err := awsRestjson1_deserializeDocumentIotSiteWiseSourceConfiguration(&sv.IotSiteWiseConfiguration, value); err != nil { + return err + } + + case "iotTwinMakerConfiguration": + if err := awsRestjson1_deserializeDocumentIotTwinMakerSourceConfiguration(&sv.IotTwinMakerConfiguration, value); err != nil { + return err + } + + case "s3Configuration": + if err := awsRestjson1_deserializeDocumentS3SourceConfiguration(&sv.S3Configuration, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceType to be of type string, got %T instead", value) + } + sv.Type = types.SourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSourceConfigurations(v *[]types.SourceConfiguration, 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.SourceConfiguration + if *v == nil { + cv = []types.SourceConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SourceConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentSourceConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentStatus(v **types.Status, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10244,6 +12885,11 @@ func awsRestjson1_deserializeDocumentWorkspaceSummary(v **types.WorkspaceSummary sv.Description = ptr.String(jtv) } + case "linkedServices": + if err := awsRestjson1_deserializeDocumentLinkedServices(&sv.LinkedServices, value); err != nil { + return err + } + case "updateDateTime": if value != nil { switch jtv := value.(type) { diff --git a/service/iottwinmaker/endpoints.go b/service/iottwinmaker/endpoints.go index b6c12640f47..8837e37acd5 100644 --- a/service/iottwinmaker/endpoints.go +++ b/service/iottwinmaker/endpoints.go @@ -366,7 +366,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://iottwinmaker-fips.") diff --git a/service/iottwinmaker/generated.json b/service/iottwinmaker/generated.json index b293d0c451b..630d731159a 100644 --- a/service/iottwinmaker/generated.json +++ b/service/iottwinmaker/generated.json @@ -10,8 +10,10 @@ "api_client.go", "api_client_test.go", "api_op_BatchPutPropertyValues.go", + "api_op_CancelMetadataTransferJob.go", "api_op_CreateComponentType.go", "api_op_CreateEntity.go", + "api_op_CreateMetadataTransferJob.go", "api_op_CreateScene.go", "api_op_CreateSyncJob.go", "api_op_CreateWorkspace.go", @@ -23,6 +25,7 @@ "api_op_ExecuteQuery.go", "api_op_GetComponentType.go", "api_op_GetEntity.go", + "api_op_GetMetadataTransferJob.go", "api_op_GetPricingPlan.go", "api_op_GetPropertyValue.go", "api_op_GetPropertyValueHistory.go", @@ -30,7 +33,10 @@ "api_op_GetSyncJob.go", "api_op_GetWorkspace.go", "api_op_ListComponentTypes.go", + "api_op_ListComponents.go", "api_op_ListEntities.go", + "api_op_ListMetadataTransferJobs.go", + "api_op_ListProperties.go", "api_op_ListScenes.go", "api_op_ListSyncJobs.go", "api_op_ListSyncResources.go", diff --git a/service/iottwinmaker/serializers.go b/service/iottwinmaker/serializers.go index e34489f11a9..1929b2d4990 100644 --- a/service/iottwinmaker/serializers.go +++ b/service/iottwinmaker/serializers.go @@ -106,6 +106,71 @@ func awsRestjson1_serializeOpDocumentBatchPutPropertyValuesInput(v *BatchPutProp return nil } +type awsRestjson1_serializeOpCancelMetadataTransferJob struct { +} + +func (*awsRestjson1_serializeOpCancelMetadataTransferJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCancelMetadataTransferJob) 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.(*CancelMetadataTransferJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/metadata-transfer-jobs/{metadataTransferJobId}/cancel") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCancelMetadataTransferJobInput(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_serializeOpHttpBindingsCancelMetadataTransferJobInput(v *CancelMetadataTransferJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MetadataTransferJobId == nil || len(*v.MetadataTransferJobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member metadataTransferJobId must not be empty")} + } + if v.MetadataTransferJobId != nil { + if err := encoder.SetURI("metadataTransferJobId").String(*v.MetadataTransferJobId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateComponentType struct { } @@ -200,6 +265,13 @@ func awsRestjson1_serializeOpDocumentCreateComponentTypeInput(v *CreateComponent ok.String(*v.ComponentTypeName) } + if v.CompositeComponentTypes != nil { + ok := object.Key("compositeComponentTypes") + if err := awsRestjson1_serializeDocumentCompositeComponentTypesRequest(v.CompositeComponentTypes, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -335,6 +407,13 @@ func awsRestjson1_serializeOpDocumentCreateEntityInput(v *CreateEntityInput, val } } + if v.CompositeComponents != nil { + ok := object.Key("compositeComponents") + if err := awsRestjson1_serializeDocumentCompositeComponentsMapRequest(v.CompositeComponents, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -365,6 +444,100 @@ func awsRestjson1_serializeOpDocumentCreateEntityInput(v *CreateEntityInput, val return nil } +type awsRestjson1_serializeOpCreateMetadataTransferJob struct { +} + +func (*awsRestjson1_serializeOpCreateMetadataTransferJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateMetadataTransferJob) 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.(*CreateMetadataTransferJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/metadata-transfer-jobs") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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_serializeOpDocumentCreateMetadataTransferJobInput(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_serializeOpHttpBindingsCreateMetadataTransferJobInput(v *CreateMetadataTransferJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateMetadataTransferJobInput(v *CreateMetadataTransferJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Destination != nil { + ok := object.Key("destination") + if err := awsRestjson1_serializeDocumentDestinationConfiguration(v.Destination, ok); err != nil { + return err + } + } + + if v.MetadataTransferJobId != nil { + ok := object.Key("metadataTransferJobId") + ok.String(*v.MetadataTransferJobId) + } + + if v.Sources != nil { + ok := object.Key("sources") + if err := awsRestjson1_serializeDocumentSourceConfigurations(v.Sources, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateScene struct { } @@ -1296,6 +1469,71 @@ func awsRestjson1_serializeOpHttpBindingsGetEntityInput(v *GetEntityInput, encod return nil } +type awsRestjson1_serializeOpGetMetadataTransferJob struct { +} + +func (*awsRestjson1_serializeOpGetMetadataTransferJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetMetadataTransferJob) 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.(*GetMetadataTransferJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/metadata-transfer-jobs/{metadataTransferJobId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetMetadataTransferJobInput(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_serializeOpHttpBindingsGetMetadataTransferJobInput(v *GetMetadataTransferJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MetadataTransferJobId == nil || len(*v.MetadataTransferJobId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member metadataTransferJobId must not be empty")} + } + if v.MetadataTransferJobId != nil { + if err := encoder.SetURI("metadataTransferJobId").String(*v.MetadataTransferJobId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetPricingPlan struct { } @@ -1433,6 +1671,11 @@ func awsRestjson1_serializeOpDocumentGetPropertyValueInput(v *GetPropertyValueIn ok.String(*v.ComponentName) } + if v.ComponentPath != nil { + ok := object.Key("componentPath") + ok.String(*v.ComponentPath) + } + if v.ComponentTypeId != nil { ok := object.Key("componentTypeId") ok.String(*v.ComponentTypeId) @@ -1560,6 +1803,11 @@ func awsRestjson1_serializeOpDocumentGetPropertyValueHistoryInput(v *GetProperty ok.String(*v.ComponentName) } + if v.ComponentPath != nil { + ok := object.Key("componentPath") + ok.String(*v.ComponentPath) + } + if v.ComponentTypeId != nil { ok := object.Key("componentTypeId") ok.String(*v.ComponentTypeId) @@ -1837,14 +2085,14 @@ func awsRestjson1_serializeOpHttpBindingsGetWorkspaceInput(v *GetWorkspaceInput, return nil } -type awsRestjson1_serializeOpListComponentTypes struct { +type awsRestjson1_serializeOpListComponents struct { } -func (*awsRestjson1_serializeOpListComponentTypes) ID() string { +func (*awsRestjson1_serializeOpListComponents) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListComponentTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListComponents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1852,13 +2100,13 @@ func (m *awsRestjson1_serializeOpListComponentTypes) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListComponentTypesInput) + input, ok := in.Parameters.(*ListComponentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/component-types-list") + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/entities/{entityId}/components-list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1874,14 +2122,14 @@ func (m *awsRestjson1_serializeOpListComponentTypes) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListComponentTypesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListComponentsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListComponentTypesInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListComponentsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1896,11 +2144,20 @@ func (m *awsRestjson1_serializeOpListComponentTypes) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListComponentTypesInput(v *ListComponentTypesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListComponentsInput(v *ListComponentsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.EntityId == nil || len(*v.EntityId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member entityId must not be empty")} + } + if v.EntityId != nil { + if err := encoder.SetURI("entityId").String(*v.EntityId); err != nil { + return err + } + } + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} } @@ -1913,15 +2170,13 @@ func awsRestjson1_serializeOpHttpBindingsListComponentTypesInput(v *ListComponen return nil } -func awsRestjson1_serializeOpDocumentListComponentTypesInput(v *ListComponentTypesInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListComponentsInput(v *ListComponentsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Filters != nil { - ok := object.Key("filters") - if err := awsRestjson1_serializeDocumentListComponentTypesFilters(v.Filters, ok); err != nil { - return err - } + if v.ComponentPath != nil { + ok := object.Key("componentPath") + ok.String(*v.ComponentPath) } if v.MaxResults != nil { @@ -1937,14 +2192,14 @@ func awsRestjson1_serializeOpDocumentListComponentTypesInput(v *ListComponentTyp return nil } -type awsRestjson1_serializeOpListEntities struct { +type awsRestjson1_serializeOpListComponentTypes struct { } -func (*awsRestjson1_serializeOpListEntities) ID() string { +func (*awsRestjson1_serializeOpListComponentTypes) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListEntities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListComponentTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1952,13 +2207,13 @@ func (m *awsRestjson1_serializeOpListEntities) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListEntitiesInput) + input, ok := in.Parameters.(*ListComponentTypesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/entities-list") + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/component-types-list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1974,14 +2229,14 @@ func (m *awsRestjson1_serializeOpListEntities) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListEntitiesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListComponentTypesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListEntitiesInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListComponentTypesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1996,7 +2251,7 @@ func (m *awsRestjson1_serializeOpListEntities) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListEntitiesInput(v *ListEntitiesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListComponentTypesInput(v *ListComponentTypesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2013,13 +2268,13 @@ func awsRestjson1_serializeOpHttpBindingsListEntitiesInput(v *ListEntitiesInput, return nil } -func awsRestjson1_serializeOpDocumentListEntitiesInput(v *ListEntitiesInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentListComponentTypesInput(v *ListComponentTypesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Filters != nil { ok := object.Key("filters") - if err := awsRestjson1_serializeDocumentListEntitiesFilters(v.Filters, ok); err != nil { + if err := awsRestjson1_serializeDocumentListComponentTypesFilters(v.Filters, ok); err != nil { return err } } @@ -2037,14 +2292,14 @@ func awsRestjson1_serializeOpDocumentListEntitiesInput(v *ListEntitiesInput, val return nil } -type awsRestjson1_serializeOpListScenes struct { +type awsRestjson1_serializeOpListEntities struct { } -func (*awsRestjson1_serializeOpListScenes) ID() string { +func (*awsRestjson1_serializeOpListEntities) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListScenes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListEntities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2052,13 +2307,13 @@ func (m *awsRestjson1_serializeOpListScenes) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListScenesInput) + input, ok := in.Parameters.(*ListEntitiesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/scenes-list") + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/entities-list") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -2074,14 +2329,14 @@ func (m *awsRestjson1_serializeOpListScenes) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListScenesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListEntitiesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListScenesInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentListEntitiesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2096,7 +2351,312 @@ func (m *awsRestjson1_serializeOpListScenes) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListScenesInput(v *ListScenesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListEntitiesInput(v *ListEntitiesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListEntitiesInput(v *ListEntitiesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentListEntitiesFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListMetadataTransferJobs struct { +} + +func (*awsRestjson1_serializeOpListMetadataTransferJobs) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListMetadataTransferJobs) 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.(*ListMetadataTransferJobsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/metadata-transfer-jobs-list") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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_serializeOpDocumentListMetadataTransferJobsInput(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_serializeOpHttpBindingsListMetadataTransferJobsInput(v *ListMetadataTransferJobsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListMetadataTransferJobsInput(v *ListMetadataTransferJobsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.DestinationType) > 0 { + ok := object.Key("destinationType") + ok.String(string(v.DestinationType)) + } + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentListMetadataTransferJobsFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if len(v.SourceType) > 0 { + ok := object.Key("sourceType") + ok.String(string(v.SourceType)) + } + + return nil +} + +type awsRestjson1_serializeOpListProperties struct { +} + +func (*awsRestjson1_serializeOpListProperties) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListProperties) 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.(*ListPropertiesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/properties-list") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListPropertiesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListPropertiesInput(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_serializeOpHttpBindingsListPropertiesInput(v *ListPropertiesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkspaceId == nil || len(*v.WorkspaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member workspaceId must not be empty")} + } + if v.WorkspaceId != nil { + if err := encoder.SetURI("workspaceId").String(*v.WorkspaceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListPropertiesInput(v *ListPropertiesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComponentName != nil { + ok := object.Key("componentName") + ok.String(*v.ComponentName) + } + + if v.ComponentPath != nil { + ok := object.Key("componentPath") + ok.String(*v.ComponentPath) + } + + if v.EntityId != nil { + ok := object.Key("entityId") + ok.String(*v.EntityId) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListScenes struct { +} + +func (*awsRestjson1_serializeOpListScenes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListScenes) 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.(*ListScenesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workspaces/{workspaceId}/scenes-list") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListScenesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListScenesInput(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_serializeOpHttpBindingsListScenesInput(v *ListScenesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2739,6 +3299,13 @@ func awsRestjson1_serializeOpDocumentUpdateComponentTypeInput(v *UpdateComponent ok.String(*v.ComponentTypeName) } + if v.CompositeComponentTypes != nil { + ok := object.Key("compositeComponentTypes") + if err := awsRestjson1_serializeDocumentCompositeComponentTypesRequest(v.CompositeComponentTypes, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -2876,6 +3443,13 @@ func awsRestjson1_serializeOpDocumentUpdateEntityInput(v *UpdateEntityInput, val } } + if v.CompositeComponentUpdates != nil { + ok := object.Key("compositeComponentUpdates") + if err := awsRestjson1_serializeDocumentCompositeComponentUpdatesMapRequest(v.CompositeComponentUpdates, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -3184,6 +3758,11 @@ func awsRestjson1_serializeOpDocumentUpdateWorkspaceInput(v *UpdateWorkspaceInpu ok.String(*v.Role) } + if v.S3Location != nil { + ok := object.Key("s3Location") + ok.String(*v.S3Location) + } + return nil } @@ -3263,22 +3842,133 @@ func awsRestjson1_serializeDocumentComponentsMapRequest(v map[string]types.Compo for key := range v { om := object.Key(key) mapVar := v[key] - if err := awsRestjson1_serializeDocumentComponentRequest(&mapVar, om); err != nil { + if err := awsRestjson1_serializeDocumentComponentRequest(&mapVar, om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentComponentUpdateRequest(v *types.ComponentUpdateRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComponentTypeId != nil { + ok := object.Key("componentTypeId") + ok.String(*v.ComponentTypeId) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.PropertyGroupUpdates != nil { + ok := object.Key("propertyGroupUpdates") + if err := awsRestjson1_serializeDocumentComponentPropertyGroupRequests(v.PropertyGroupUpdates, ok); err != nil { + return err + } + } + + if v.PropertyUpdates != nil { + ok := object.Key("propertyUpdates") + if err := awsRestjson1_serializeDocumentPropertyRequests(v.PropertyUpdates, ok); err != nil { + return err + } + } + + if len(v.UpdateType) > 0 { + ok := object.Key("updateType") + ok.String(string(v.UpdateType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentComponentUpdatesMapRequest(v map[string]types.ComponentUpdateRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentComponentUpdateRequest(&mapVar, om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCompositeComponentRequest(v *types.CompositeComponentRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Properties != nil { + ok := object.Key("properties") + if err := awsRestjson1_serializeDocumentPropertyRequests(v.Properties, ok); err != nil { + return err + } + } + + if v.PropertyGroups != nil { + ok := object.Key("propertyGroups") + if err := awsRestjson1_serializeDocumentComponentPropertyGroupRequests(v.PropertyGroups, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCompositeComponentsMapRequest(v map[string]types.CompositeComponentRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentCompositeComponentRequest(&mapVar, om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCompositeComponentTypeRequest(v *types.CompositeComponentTypeRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComponentTypeId != nil { + ok := object.Key("componentTypeId") + ok.String(*v.ComponentTypeId) + } + + return nil +} + +func awsRestjson1_serializeDocumentCompositeComponentTypesRequest(v map[string]types.CompositeComponentTypeRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentCompositeComponentTypeRequest(&mapVar, om); err != nil { return err } } return nil } -func awsRestjson1_serializeDocumentComponentUpdateRequest(v *types.ComponentUpdateRequest, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentCompositeComponentUpdateRequest(v *types.CompositeComponentUpdateRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.ComponentTypeId != nil { - ok := object.Key("componentTypeId") - ok.String(*v.ComponentTypeId) - } - if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -3306,14 +3996,14 @@ func awsRestjson1_serializeDocumentComponentUpdateRequest(v *types.ComponentUpda return nil } -func awsRestjson1_serializeDocumentComponentUpdatesMapRequest(v map[string]types.ComponentUpdateRequest, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentCompositeComponentUpdatesMapRequest(v map[string]types.CompositeComponentUpdateRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) mapVar := v[key] - if err := awsRestjson1_serializeDocumentComponentUpdateRequest(&mapVar, om); err != nil { + if err := awsRestjson1_serializeDocumentCompositeComponentUpdateRequest(&mapVar, om); err != nil { return err } } @@ -3486,6 +4176,32 @@ func awsRestjson1_serializeDocumentDataValueMap(v map[string]types.DataValue, va return nil } +func awsRestjson1_serializeDocumentDestinationConfiguration(v *types.DestinationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IotTwinMakerConfiguration != nil { + ok := object.Key("iotTwinMakerConfiguration") + if err := awsRestjson1_serializeDocumentIotTwinMakerDestinationConfiguration(v.IotTwinMakerConfiguration, ok); err != nil { + return err + } + } + + if v.S3Configuration != nil { + ok := object.Key("s3Configuration") + if err := awsRestjson1_serializeDocumentS3DestinationConfiguration(v.S3Configuration, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + func awsRestjson1_serializeDocumentEntityPropertyReference(v *types.EntityPropertyReference, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3495,6 +4211,11 @@ func awsRestjson1_serializeDocumentEntityPropertyReference(v *types.EntityProper ok.String(*v.ComponentName) } + if v.ComponentPath != nil { + ok := object.Key("componentPath") + ok.String(*v.ComponentPath) + } + if v.EntityId != nil { ok := object.Key("entityId") ok.String(*v.EntityId) @@ -3550,6 +4271,84 @@ func awsRestjson1_serializeDocumentExternalIdProperty(v map[string]string, value return nil } +func awsRestjson1_serializeDocumentFilterByAsset(v *types.FilterByAsset, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssetExternalId != nil { + ok := object.Key("assetExternalId") + ok.String(*v.AssetExternalId) + } + + if v.AssetId != nil { + ok := object.Key("assetId") + ok.String(*v.AssetId) + } + + if v.IncludeAssetModel != nil { + ok := object.Key("includeAssetModel") + ok.Boolean(*v.IncludeAssetModel) + } + + if v.IncludeOffspring != nil { + ok := object.Key("includeOffspring") + ok.Boolean(*v.IncludeOffspring) + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterByAssetModel(v *types.FilterByAssetModel, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssetModelExternalId != nil { + ok := object.Key("assetModelExternalId") + ok.String(*v.AssetModelExternalId) + } + + if v.AssetModelId != nil { + ok := object.Key("assetModelId") + ok.String(*v.AssetModelId) + } + + if v.IncludeAssets != nil { + ok := object.Key("includeAssets") + ok.Boolean(*v.IncludeAssets) + } + + if v.IncludeOffspring != nil { + ok := object.Key("includeOffspring") + ok.Boolean(*v.IncludeOffspring) + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterByComponentType(v *types.FilterByComponentType, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComponentTypeId != nil { + ok := object.Key("componentTypeId") + ok.String(*v.ComponentTypeId) + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterByEntity(v *types.FilterByEntity, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EntityId != nil { + ok := object.Key("entityId") + ok.String(*v.EntityId) + } + + return nil +} + func awsRestjson1_serializeDocumentFunctionRequest(v *types.FunctionRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3607,6 +4406,131 @@ func awsRestjson1_serializeDocumentInterpolationParameters(v *types.Interpolatio return nil } +func awsRestjson1_serializeDocumentIotSiteWiseSourceConfiguration(v *types.IotSiteWiseSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentIotSiteWiseSourceConfigurationFilters(v.Filters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIotSiteWiseSourceConfigurationFilter(v types.IotSiteWiseSourceConfigurationFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.IotSiteWiseSourceConfigurationFilterMemberFilterByAsset: + av := object.Key("filterByAsset") + if err := awsRestjson1_serializeDocumentFilterByAsset(&uv.Value, av); err != nil { + return err + } + + case *types.IotSiteWiseSourceConfigurationFilterMemberFilterByAssetModel: + av := object.Key("filterByAssetModel") + if err := awsRestjson1_serializeDocumentFilterByAssetModel(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentIotSiteWiseSourceConfigurationFilters(v []types.IotSiteWiseSourceConfigurationFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentIotSiteWiseSourceConfigurationFilter(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentIotTwinMakerDestinationConfiguration(v *types.IotTwinMakerDestinationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Workspace != nil { + ok := object.Key("workspace") + ok.String(*v.Workspace) + } + + return nil +} + +func awsRestjson1_serializeDocumentIotTwinMakerSourceConfiguration(v *types.IotTwinMakerSourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentIotTwinMakerSourceConfigurationFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.Workspace != nil { + ok := object.Key("workspace") + ok.String(*v.Workspace) + } + + return nil +} + +func awsRestjson1_serializeDocumentIotTwinMakerSourceConfigurationFilter(v types.IotTwinMakerSourceConfigurationFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.IotTwinMakerSourceConfigurationFilterMemberFilterByComponentType: + av := object.Key("filterByComponentType") + if err := awsRestjson1_serializeDocumentFilterByComponentType(&uv.Value, av); err != nil { + return err + } + + case *types.IotTwinMakerSourceConfigurationFilterMemberFilterByEntity: + av := object.Key("filterByEntity") + if err := awsRestjson1_serializeDocumentFilterByEntity(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentIotTwinMakerSourceConfigurationFilters(v []types.IotTwinMakerSourceConfigurationFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentIotTwinMakerSourceConfigurationFilter(v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentLambdaFunction(v *types.LambdaFunction, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3699,6 +4623,42 @@ func awsRestjson1_serializeDocumentListEntitiesFilters(v []types.ListEntitiesFil return nil } +func awsRestjson1_serializeDocumentListMetadataTransferJobsFilter(v types.ListMetadataTransferJobsFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ListMetadataTransferJobsFilterMemberState: + av := object.Key("state") + av.String(string(uv.Value)) + + case *types.ListMetadataTransferJobsFilterMemberWorkspaceId: + av := object.Key("workspaceId") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentListMetadataTransferJobsFilters(v []types.ListMetadataTransferJobsFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentListMetadataTransferJobsFilter(v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentOrderBy(v *types.OrderBy, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4048,6 +5008,30 @@ func awsRestjson1_serializeDocumentRequiredProperties(v []string, value smithyjs return nil } +func awsRestjson1_serializeDocumentS3DestinationConfiguration(v *types.S3DestinationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Location != nil { + ok := object.Key("location") + ok.String(*v.Location) + } + + return nil +} + +func awsRestjson1_serializeDocumentS3SourceConfiguration(v *types.S3SourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Location != nil { + ok := object.Key("location") + ok.String(*v.Location) + } + + return nil +} + func awsRestjson1_serializeDocumentSceneCapabilities(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4081,6 +5065,52 @@ func awsRestjson1_serializeDocumentSelectedPropertyList(v []string, value smithy return nil } +func awsRestjson1_serializeDocumentSourceConfiguration(v *types.SourceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IotSiteWiseConfiguration != nil { + ok := object.Key("iotSiteWiseConfiguration") + if err := awsRestjson1_serializeDocumentIotSiteWiseSourceConfiguration(v.IotSiteWiseConfiguration, ok); err != nil { + return err + } + } + + if v.IotTwinMakerConfiguration != nil { + ok := object.Key("iotTwinMakerConfiguration") + if err := awsRestjson1_serializeDocumentIotTwinMakerSourceConfiguration(v.IotTwinMakerConfiguration, ok); err != nil { + return err + } + } + + if v.S3Configuration != nil { + ok := object.Key("s3Configuration") + if err := awsRestjson1_serializeDocumentS3SourceConfiguration(v.S3Configuration, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentSourceConfigurations(v []types.SourceConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSourceConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentSyncResourceFilter(v types.SyncResourceFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/iottwinmaker/types/enums.go b/service/iottwinmaker/types/enums.go index 674300a2d5e..b0091cb5c97 100644 --- a/service/iottwinmaker/types/enums.go +++ b/service/iottwinmaker/types/enums.go @@ -42,15 +42,38 @@ func (ComponentUpdateType) Values() []ComponentUpdateType { } } +type DestinationType string + +// Enum values for DestinationType +const ( + DestinationTypeS3 DestinationType = "s3" + DestinationTypeIotsitewise DestinationType = "iotsitewise" + DestinationTypeIottwinmaker DestinationType = "iottwinmaker" +) + +// Values returns all known values for DestinationType. 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 (DestinationType) Values() []DestinationType { + return []DestinationType{ + "s3", + "iotsitewise", + "iottwinmaker", + } +} + type ErrorCode string // Enum values for ErrorCode const ( - ErrorCodeValidationError ErrorCode = "VALIDATION_ERROR" - ErrorCodeInternalFailure ErrorCode = "INTERNAL_FAILURE" - ErrorCodeSyncInitializingError ErrorCode = "SYNC_INITIALIZING_ERROR" - ErrorCodeSyncCreatingError ErrorCode = "SYNC_CREATING_ERROR" - ErrorCodeSyncProcessingError ErrorCode = "SYNC_PROCESSING_ERROR" + ErrorCodeValidationError ErrorCode = "VALIDATION_ERROR" + ErrorCodeInternalFailure ErrorCode = "INTERNAL_FAILURE" + ErrorCodeSyncInitializingError ErrorCode = "SYNC_INITIALIZING_ERROR" + ErrorCodeSyncCreatingError ErrorCode = "SYNC_CREATING_ERROR" + ErrorCodeSyncProcessingError ErrorCode = "SYNC_PROCESSING_ERROR" + ErrorCodeSyncDeletingError ErrorCode = "SYNC_DELETING_ERROR" + ErrorCodeProcessingError ErrorCode = "PROCESSING_ERROR" + ErrorCodeCompositeComponentFailure ErrorCode = "COMPOSITE_COMPONENT_FAILURE" ) // Values returns all known values for ErrorCode. Note that this can be expanded @@ -63,6 +86,9 @@ func (ErrorCode) Values() []ErrorCode { "SYNC_INITIALIZING_ERROR", "SYNC_CREATING_ERROR", "SYNC_PROCESSING_ERROR", + "SYNC_DELETING_ERROR", + "PROCESSING_ERROR", + "COMPOSITE_COMPONENT_FAILURE", } } @@ -98,6 +124,34 @@ func (InterpolationType) Values() []InterpolationType { } } +type MetadataTransferJobState string + +// Enum values for MetadataTransferJobState +const ( + MetadataTransferJobStateValidating MetadataTransferJobState = "VALIDATING" + MetadataTransferJobStatePending MetadataTransferJobState = "PENDING" + MetadataTransferJobStateRunning MetadataTransferJobState = "RUNNING" + MetadataTransferJobStateCancelling MetadataTransferJobState = "CANCELLING" + MetadataTransferJobStateError MetadataTransferJobState = "ERROR" + MetadataTransferJobStateCompleted MetadataTransferJobState = "COMPLETED" + MetadataTransferJobStateCancelled MetadataTransferJobState = "CANCELLED" +) + +// Values returns all known values for MetadataTransferJobState. 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 (MetadataTransferJobState) Values() []MetadataTransferJobState { + return []MetadataTransferJobState{ + "VALIDATING", + "PENDING", + "RUNNING", + "CANCELLING", + "ERROR", + "COMPLETED", + "CANCELLED", + } +} + type Order string // Enum values for Order @@ -268,6 +322,26 @@ func (Scope) Values() []Scope { } } +type SourceType string + +// Enum values for SourceType +const ( + SourceTypeS3 SourceType = "s3" + SourceTypeIotsitewise SourceType = "iotsitewise" + SourceTypeIottwinmaker SourceType = "iottwinmaker" +) + +// Values returns all known values for SourceType. 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 (SourceType) Values() []SourceType { + return []SourceType{ + "s3", + "iotsitewise", + "iottwinmaker", + } +} + type State string // Enum values for State diff --git a/service/iottwinmaker/types/types.go b/service/iottwinmaker/types/types.go index 95ed305feb2..19b510de388 100644 --- a/service/iottwinmaker/types/types.go +++ b/service/iottwinmaker/types/types.go @@ -129,12 +129,23 @@ type ComponentRequest struct { // request. type ComponentResponse struct { + // This flag notes whether all compositeComponents are returned in the API + // response. + AreAllCompositeComponentsReturned *bool + + // This flag notes whether all properties of the component are returned in the API + // response. The maximum number of properties returned is 800. + AreAllPropertiesReturned *bool + // The name of the component. ComponentName *string // The ID of the component type. ComponentTypeId *string + // This lists objects that contain information about the compositeComponents . + CompositeComponents map[string]ComponentSummary + // The name of the property definition set in the request. DefinedIn *string @@ -157,6 +168,43 @@ type ComponentResponse struct { noSmithyDocumentSerde } +// An object that returns information about a component summary. +type ComponentSummary struct { + + // The name of the component. + // + // This member is required. + ComponentName *string + + // The ID of the component type. + // + // This member is required. + ComponentTypeId *string + + // The status of the component type. + // + // This member is required. + Status *Status + + // This string specifies the path to the composite component, starting from the + // top-level component. + ComponentPath *string + + // The name of the property definition set in the request. + DefinedIn *string + + // The description of the component request. + Description *string + + // The property groups. + PropertyGroups map[string]ComponentPropertyGroupResponse + + // The syncSource of the sync job, if this entity was created by a sync job. + SyncSource *string + + noSmithyDocumentSerde +} + // An object that contains information about a component type. type ComponentTypeSummary struct { @@ -214,6 +262,65 @@ type ComponentUpdateRequest struct { noSmithyDocumentSerde } +// An object that sets information about the composite component update request. +type CompositeComponentRequest struct { + + // The description of the component type. + Description *string + + // This is an object that maps strings to the properties to set in the component + // type. Each string in the mapping must be unique to this object. + Properties map[string]PropertyRequest + + // The property groups. + PropertyGroups map[string]ComponentPropertyGroupRequest + + noSmithyDocumentSerde +} + +// An object that sets information about the composite component types of a +// component type. +type CompositeComponentTypeRequest struct { + + // This is the componentTypeId that the compositeComponentType refers to. + ComponentTypeId *string + + noSmithyDocumentSerde +} + +// An object that returns information about the composite component types of a +// component type. +type CompositeComponentTypeResponse struct { + + // This is the componentTypeId that this compositeComponentType refers to. + ComponentTypeId *string + + // This boolean indicates whether this compositeComponentType is inherited from + // its parent. + IsInherited *bool + + noSmithyDocumentSerde +} + +// An object that sets information about the composite component update request. +type CompositeComponentUpdateRequest struct { + + // The description of the component type. + Description *string + + // The property group updates. + PropertyGroupUpdates map[string]ComponentPropertyGroupRequest + + // An object that maps strings to the properties to set in the component type + // update. Each string in the mapping must be unique to this object. + PropertyUpdates map[string]PropertyRequest + + // The update type of the component update request. + UpdateType ComponentUpdateType + + noSmithyDocumentSerde +} + // The data connector. type DataConnector struct { @@ -283,6 +390,23 @@ type DataValue struct { noSmithyDocumentSerde } +// The [link to action] metadata transfer job destination configuration. +type DestinationConfiguration struct { + + // The destination type. + // + // This member is required. + Type DestinationType + + // The metadata transfer job Amazon Web Services IoT TwinMaker configuration. + IotTwinMakerConfiguration *IotTwinMakerDestinationConfiguration + + // The metadata transfer job S3 configuration. [need to add S3 entity] + S3Configuration *S3DestinationConfiguration + + noSmithyDocumentSerde +} + // An object that uniquely identifies an entity property. type EntityPropertyReference struct { @@ -294,6 +418,10 @@ type EntityPropertyReference struct { // The name of the component. ComponentName *string + // This string specifies the path to the composite component, starting from the + // top-level component. + ComponentPath *string + // The ID of the entity. EntityId *string @@ -340,7 +468,8 @@ type EntitySummary struct { // The description of the entity. Description *string - // A Boolean value that specifies whether the entity has child entities or not. + // An eventual Boolean value that specifies whether the entity has child entities + // or not. HasChildEntities *bool // The ID of the parent entity. @@ -361,6 +490,64 @@ type ErrorDetails struct { noSmithyDocumentSerde } +// Filter by asset. [TwinMaker asset] +type FilterByAsset struct { + + // The external-Id property of an asset. + AssetExternalId *string + + // Filter by asset Id. + AssetId *string + + // Boolean to include the asset model. + IncludeAssetModel *bool + + // Includes sub-assets.[need description hekp for this] + IncludeOffspring *bool + + noSmithyDocumentSerde +} + +// Filter by asset model. +type FilterByAssetModel struct { + + // The external-Id property of an asset model. + AssetModelExternalId *string + + // The asset model Id. + AssetModelId *string + + // Bolean to include assets. + IncludeAssets *bool + + // Include asset offspring. [need desc.] + IncludeOffspring *bool + + noSmithyDocumentSerde +} + +// Filter by component type. +type FilterByComponentType struct { + + // The component type Id. + // + // This member is required. + ComponentTypeId *string + + noSmithyDocumentSerde +} + +// Vilter by entity. +type FilterByEntity struct { + + // The entity Id. + // + // This member is required. + EntityId *string + + noSmithyDocumentSerde +} + // The function request body. type FunctionRequest struct { @@ -406,6 +593,100 @@ type InterpolationParameters struct { noSmithyDocumentSerde } +// The metadata transfer job AWS IoT SiteWise source configuration. +type IotSiteWiseSourceConfiguration struct { + + // The AWS IoT SiteWise soucre configuration filters. + Filters []IotSiteWiseSourceConfigurationFilter + + noSmithyDocumentSerde +} + +// The AWS IoT SiteWise soucre configuration filter.[need held with desc here] +// +// The following types satisfy this interface: +// +// IotSiteWiseSourceConfigurationFilterMemberFilterByAsset +// IotSiteWiseSourceConfigurationFilterMemberFilterByAssetModel +type IotSiteWiseSourceConfigurationFilter interface { + isIotSiteWiseSourceConfigurationFilter() +} + +// Filter by asset. +type IotSiteWiseSourceConfigurationFilterMemberFilterByAsset struct { + Value FilterByAsset + + noSmithyDocumentSerde +} + +func (*IotSiteWiseSourceConfigurationFilterMemberFilterByAsset) isIotSiteWiseSourceConfigurationFilter() { +} + +// Filter by asset model. +type IotSiteWiseSourceConfigurationFilterMemberFilterByAssetModel struct { + Value FilterByAssetModel + + noSmithyDocumentSerde +} + +func (*IotSiteWiseSourceConfigurationFilterMemberFilterByAssetModel) isIotSiteWiseSourceConfigurationFilter() { +} + +// The metadata transfer job AWS IoT TwinMaker destination configuration. +type IotTwinMakerDestinationConfiguration struct { + + // The IoT TwinMaker workspace. + // + // This member is required. + Workspace *string + + noSmithyDocumentSerde +} + +// The metadata transfer job AWS IoT TwinMaker source configuration. +type IotTwinMakerSourceConfiguration struct { + + // The IoT TwinMaker workspace. + // + // This member is required. + Workspace *string + + // The metadata transfer job AWS IoT TwinMaker source configuration filters. + Filters []IotTwinMakerSourceConfigurationFilter + + noSmithyDocumentSerde +} + +// The metadata transfer job AWS IoT TwinMaker source configuration filter. +// +// The following types satisfy this interface: +// +// IotTwinMakerSourceConfigurationFilterMemberFilterByComponentType +// IotTwinMakerSourceConfigurationFilterMemberFilterByEntity +type IotTwinMakerSourceConfigurationFilter interface { + isIotTwinMakerSourceConfigurationFilter() +} + +// Filter by component type. +type IotTwinMakerSourceConfigurationFilterMemberFilterByComponentType struct { + Value FilterByComponentType + + noSmithyDocumentSerde +} + +func (*IotTwinMakerSourceConfigurationFilterMemberFilterByComponentType) isIotTwinMakerSourceConfigurationFilter() { +} + +// Filter by entity. +type IotTwinMakerSourceConfigurationFilterMemberFilterByEntity struct { + Value FilterByEntity + + noSmithyDocumentSerde +} + +func (*IotTwinMakerSourceConfigurationFilterMemberFilterByEntity) isIotTwinMakerSourceConfigurationFilter() { +} + // The Lambda function. type LambdaFunction struct { @@ -496,6 +777,101 @@ type ListEntitiesFilterMemberParentEntityId struct { func (*ListEntitiesFilterMemberParentEntityId) isListEntitiesFilter() {} +// The ListMetadataTransferJobs filter. +// +// The following types satisfy this interface: +// +// ListMetadataTransferJobsFilterMemberState +// ListMetadataTransferJobsFilterMemberWorkspaceId +type ListMetadataTransferJobsFilter interface { + isListMetadataTransferJobsFilter() +} + +// The filter state. +type ListMetadataTransferJobsFilterMemberState struct { + Value MetadataTransferJobState + + noSmithyDocumentSerde +} + +func (*ListMetadataTransferJobsFilterMemberState) isListMetadataTransferJobsFilter() {} + +// The workspace Id. +type ListMetadataTransferJobsFilterMemberWorkspaceId struct { + Value string + + noSmithyDocumentSerde +} + +func (*ListMetadataTransferJobsFilterMemberWorkspaceId) isListMetadataTransferJobsFilter() {} + +// The metadata transfer job's progress. +type MetadataTransferJobProgress struct { + + // The failed count. + FailedCount *int32 + + // The skipped count. + SkippedCount *int32 + + // The succeeded count. + SucceededCount *int32 + + // The total count. [of what] + TotalCount *int32 + + noSmithyDocumentSerde +} + +// The metadata transfer job status. +type MetadataTransferJobStatus struct { + + // The metadata transfer job error. + Error *ErrorDetails + + // The queued position. + QueuedPosition *int32 + + // The metadata transfer job state. + State MetadataTransferJobState + + noSmithyDocumentSerde +} + +// The metadata transfer job summary. +type MetadataTransferJobSummary struct { + + // The metadata transfer job summary ARN. + // + // This member is required. + Arn *string + + // The metadata transfer job summary creation DateTime object. + // + // This member is required. + CreationDateTime *time.Time + + // The metadata transfer job summary Id. + // + // This member is required. + MetadataTransferJobId *string + + // The metadata transfer job summary status. + // + // This member is required. + Status *MetadataTransferJobStatus + + // The metadata transfer job summary update DateTime object + // + // This member is required. + UpdateDateTime *time.Time + + // The metadata transfer job summary progess. + Progress *MetadataTransferJobProgress + + noSmithyDocumentSerde +} + // Filter criteria that orders the return output. It can be sorted in ascending or // descending order. type OrderBy struct { @@ -729,6 +1105,10 @@ type PropertyRequest struct { // An object that contains information about a property response. type PropertyResponse struct { + // This flag notes whether all values of a list or map type property are returned + // in the API response. The maximum number of values per property returned is 50. + AreAllPropertyValuesReturned *bool + // An object that specifies information about a property. Definition *PropertyDefinitionResponse @@ -738,6 +1118,27 @@ type PropertyResponse struct { noSmithyDocumentSerde } +// This is an object that contains the information of a property. +type PropertySummary struct { + + // This is the name of the property. + // + // This member is required. + PropertyName *string + + // This flag notes whether all values of a list or map type property are returned + // in the API response. The maximum number of values per property returned is 50. + AreAllPropertyValuesReturned *bool + + // This is the schema for the property. + Definition *PropertyDefinitionResponse + + // This is the value for the property. + Value *DataValue + + noSmithyDocumentSerde +} + // An object that contains information about a value for a time series property. type PropertyValue struct { @@ -835,6 +1236,28 @@ type Row struct { noSmithyDocumentSerde } +// The S3 destination configuration. +type S3DestinationConfiguration struct { + + // The S3 destination configuration location. + // + // This member is required. + Location *string + + noSmithyDocumentSerde +} + +// The S3 destination source configuration. +type S3SourceConfiguration struct { + + // The S3 destination source configuration location. + // + // This member is required. + Location *string + + noSmithyDocumentSerde +} + // The scene error. type SceneError struct { @@ -881,6 +1304,26 @@ type SceneSummary struct { noSmithyDocumentSerde } +// The source configuration. +type SourceConfiguration struct { + + // The source configuration type. + // + // This member is required. + Type SourceType + + // The source configuration IoT SiteWise configuration. + IotSiteWiseConfiguration *IotSiteWiseSourceConfiguration + + // The source configuration IoT TwinMaker configuration. + IotTwinMakerConfiguration *IotTwinMakerSourceConfiguration + + // The source configuration S3 configuration. + S3Configuration *S3SourceConfiguration + + noSmithyDocumentSerde +} + // An object that represents the status of an entity, component, component type, // or workspace. type Status struct { @@ -1051,6 +1494,9 @@ type WorkspaceSummary struct { // The description of the workspace. Description *string + // A list of services that are linked to the workspace. + LinkedServices []string + noSmithyDocumentSerde } @@ -1065,6 +1511,9 @@ type UnknownUnionMember struct { noSmithyDocumentSerde } -func (*UnknownUnionMember) isListComponentTypesFilter() {} -func (*UnknownUnionMember) isListEntitiesFilter() {} -func (*UnknownUnionMember) isSyncResourceFilter() {} +func (*UnknownUnionMember) isIotSiteWiseSourceConfigurationFilter() {} +func (*UnknownUnionMember) isIotTwinMakerSourceConfigurationFilter() {} +func (*UnknownUnionMember) isListComponentTypesFilter() {} +func (*UnknownUnionMember) isListEntitiesFilter() {} +func (*UnknownUnionMember) isListMetadataTransferJobsFilter() {} +func (*UnknownUnionMember) isSyncResourceFilter() {} diff --git a/service/iottwinmaker/types/types_exported_test.go b/service/iottwinmaker/types/types_exported_test.go index 7592fb4ac82..d444b9c516c 100644 --- a/service/iottwinmaker/types/types_exported_test.go +++ b/service/iottwinmaker/types/types_exported_test.go @@ -7,6 +7,50 @@ import ( "github.com/aws/aws-sdk-go-v2/service/iottwinmaker/types" ) +func ExampleIotSiteWiseSourceConfigurationFilter_outputUsage() { + var union types.IotSiteWiseSourceConfigurationFilter + // type switches can be used to check the union value + switch v := union.(type) { + case *types.IotSiteWiseSourceConfigurationFilterMemberFilterByAsset: + _ = v.Value // Value is types.FilterByAsset + + case *types.IotSiteWiseSourceConfigurationFilterMemberFilterByAssetModel: + _ = v.Value // Value is types.FilterByAssetModel + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.FilterByAssetModel +var _ *types.FilterByAsset + +func ExampleIotTwinMakerSourceConfigurationFilter_outputUsage() { + var union types.IotTwinMakerSourceConfigurationFilter + // type switches can be used to check the union value + switch v := union.(type) { + case *types.IotTwinMakerSourceConfigurationFilterMemberFilterByComponentType: + _ = v.Value // Value is types.FilterByComponentType + + case *types.IotTwinMakerSourceConfigurationFilterMemberFilterByEntity: + _ = v.Value // Value is types.FilterByEntity + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.FilterByComponentType +var _ *types.FilterByEntity + func ExampleListComponentTypesFilter_outputUsage() { var union types.ListComponentTypesFilter // type switches can be used to check the union value @@ -59,6 +103,28 @@ var _ *string var _ *string var _ *string +func ExampleListMetadataTransferJobsFilter_outputUsage() { + var union types.ListMetadataTransferJobsFilter + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ListMetadataTransferJobsFilterMemberState: + _ = v.Value // Value is types.MetadataTransferJobState + + case *types.ListMetadataTransferJobsFilterMemberWorkspaceId: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ types.MetadataTransferJobState +var _ *string + func ExampleSyncResourceFilter_outputUsage() { var union types.SyncResourceFilter // type switches can be used to check the union value diff --git a/service/iottwinmaker/validators.go b/service/iottwinmaker/validators.go index 4af15120a36..d9b52b88e06 100644 --- a/service/iottwinmaker/validators.go +++ b/service/iottwinmaker/validators.go @@ -30,6 +30,26 @@ func (m *validateOpBatchPutPropertyValues) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCancelMetadataTransferJob struct { +} + +func (*validateOpCancelMetadataTransferJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCancelMetadataTransferJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CancelMetadataTransferJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCancelMetadataTransferJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateComponentType struct { } @@ -70,6 +90,26 @@ func (m *validateOpCreateEntity) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpCreateMetadataTransferJob struct { +} + +func (*validateOpCreateMetadataTransferJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateMetadataTransferJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateMetadataTransferJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateMetadataTransferJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateScene struct { } @@ -290,6 +330,26 @@ func (m *validateOpGetEntity) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpGetMetadataTransferJob struct { +} + +func (*validateOpGetMetadataTransferJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetMetadataTransferJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetMetadataTransferJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetMetadataTransferJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetPropertyValueHistory struct { } @@ -390,6 +450,26 @@ func (m *validateOpGetWorkspace) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpListComponents struct { +} + +func (*validateOpListComponents) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListComponents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListComponentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListComponentsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListComponentTypes struct { } @@ -430,6 +510,46 @@ func (m *validateOpListEntities) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpListMetadataTransferJobs struct { +} + +func (*validateOpListMetadataTransferJobs) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListMetadataTransferJobs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListMetadataTransferJobsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListMetadataTransferJobsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListProperties struct { +} + +func (*validateOpListProperties) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListProperties) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListPropertiesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListPropertiesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListScenes struct { } @@ -654,6 +774,10 @@ func addOpBatchPutPropertyValuesValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpBatchPutPropertyValues{}, middleware.After) } +func addOpCancelMetadataTransferJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCancelMetadataTransferJob{}, middleware.After) +} + func addOpCreateComponentTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateComponentType{}, middleware.After) } @@ -662,6 +786,10 @@ func addOpCreateEntityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateEntity{}, middleware.After) } +func addOpCreateMetadataTransferJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateMetadataTransferJob{}, middleware.After) +} + func addOpCreateSceneValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateScene{}, middleware.After) } @@ -706,6 +834,10 @@ func addOpGetEntityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEntity{}, middleware.After) } +func addOpGetMetadataTransferJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetMetadataTransferJob{}, middleware.After) +} + func addOpGetPropertyValueHistoryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetPropertyValueHistory{}, middleware.After) } @@ -726,6 +858,10 @@ func addOpGetWorkspaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetWorkspace{}, middleware.After) } +func addOpListComponentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListComponents{}, middleware.After) +} + func addOpListComponentTypesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListComponentTypes{}, middleware.After) } @@ -734,6 +870,14 @@ func addOpListEntitiesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListEntities{}, middleware.After) } +func addOpListMetadataTransferJobsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListMetadataTransferJobs{}, middleware.After) +} + +func addOpListPropertiesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListProperties{}, middleware.After) +} + func addOpListScenesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListScenes{}, middleware.After) } @@ -848,6 +992,76 @@ func validateComponentUpdatesMapRequest(v map[string]types.ComponentUpdateReques } } +func validateCompositeComponentRequest(v *types.CompositeComponentRequest) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CompositeComponentRequest"} + if v.Properties != nil { + if err := validatePropertyRequests(v.Properties); err != nil { + invalidParams.AddNested("Properties", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCompositeComponentsMapRequest(v map[string]types.CompositeComponentRequest) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CompositeComponentsMapRequest"} + for key := range v { + value := v[key] + if err := validateCompositeComponentRequest(&value); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCompositeComponentUpdateRequest(v *types.CompositeComponentUpdateRequest) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CompositeComponentUpdateRequest"} + if v.PropertyUpdates != nil { + if err := validatePropertyRequests(v.PropertyUpdates); err != nil { + invalidParams.AddNested("PropertyUpdates", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCompositeComponentUpdatesMapRequest(v map[string]types.CompositeComponentUpdateRequest) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CompositeComponentUpdatesMapRequest"} + for key := range v { + value := v[key] + if err := validateCompositeComponentUpdateRequest(&value); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDataConnector(v *types.DataConnector) error { if v == nil { return nil @@ -885,6 +1099,31 @@ func validateDataType(v *types.DataType) error { } } +func validateDestinationConfiguration(v *types.DestinationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DestinationConfiguration"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.S3Configuration != nil { + if err := validateS3DestinationConfiguration(v.S3Configuration); err != nil { + invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError)) + } + } + if v.IotTwinMakerConfiguration != nil { + if err := validateIotTwinMakerDestinationConfiguration(v.IotTwinMakerConfiguration); err != nil { + invalidParams.AddNested("IotTwinMakerConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateEntityPropertyReference(v *types.EntityPropertyReference) error { if v == nil { return nil @@ -917,6 +1156,36 @@ func validateEntries(v []types.PropertyValueEntry) error { } } +func validateFilterByComponentType(v *types.FilterByComponentType) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FilterByComponentType"} + if v.ComponentTypeId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ComponentTypeId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFilterByEntity(v *types.FilterByEntity) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FilterByEntity"} + if v.EntityId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EntityId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateFunctionRequest(v *types.FunctionRequest) error { if v == nil { return nil @@ -952,6 +1221,82 @@ func validateFunctionsRequest(v map[string]types.FunctionRequest) error { } } +func validateIotTwinMakerDestinationConfiguration(v *types.IotTwinMakerDestinationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IotTwinMakerDestinationConfiguration"} + if v.Workspace == nil { + invalidParams.Add(smithy.NewErrParamRequired("Workspace")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIotTwinMakerSourceConfiguration(v *types.IotTwinMakerSourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IotTwinMakerSourceConfiguration"} + if v.Workspace == nil { + invalidParams.Add(smithy.NewErrParamRequired("Workspace")) + } + if v.Filters != nil { + if err := validateIotTwinMakerSourceConfigurationFilters(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIotTwinMakerSourceConfigurationFilter(v types.IotTwinMakerSourceConfigurationFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IotTwinMakerSourceConfigurationFilter"} + switch uv := v.(type) { + case *types.IotTwinMakerSourceConfigurationFilterMemberFilterByComponentType: + if err := validateFilterByComponentType(&uv.Value); err != nil { + invalidParams.AddNested("[filterByComponentType]", err.(smithy.InvalidParamsError)) + } + + case *types.IotTwinMakerSourceConfigurationFilterMemberFilterByEntity: + if err := validateFilterByEntity(&uv.Value); err != nil { + invalidParams.AddNested("[filterByEntity]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIotTwinMakerSourceConfigurationFilters(v []types.IotTwinMakerSourceConfigurationFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IotTwinMakerSourceConfigurationFilters"} + for i := range v { + if err := validateIotTwinMakerSourceConfigurationFilter(v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateLambdaFunction(v *types.LambdaFunction) error { if v == nil { return nil @@ -1140,6 +1485,78 @@ func validatePropertyValues(v []types.PropertyValue) error { } } +func validateS3DestinationConfiguration(v *types.S3DestinationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "S3DestinationConfiguration"} + if v.Location == nil { + invalidParams.Add(smithy.NewErrParamRequired("Location")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateS3SourceConfiguration(v *types.S3SourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "S3SourceConfiguration"} + if v.Location == nil { + invalidParams.Add(smithy.NewErrParamRequired("Location")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSourceConfiguration(v *types.SourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SourceConfiguration"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.S3Configuration != nil { + if err := validateS3SourceConfiguration(v.S3Configuration); err != nil { + invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError)) + } + } + if v.IotTwinMakerConfiguration != nil { + if err := validateIotTwinMakerSourceConfiguration(v.IotTwinMakerConfiguration); err != nil { + invalidParams.AddNested("IotTwinMakerConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSourceConfigurations(v []types.SourceConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SourceConfigurations"} + for i := range v { + if err := validateSourceConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTabularConditions(v *types.TabularConditions) error { if v == nil { return nil @@ -1179,6 +1596,21 @@ func validateOpBatchPutPropertyValuesInput(v *BatchPutPropertyValuesInput) error } } +func validateOpCancelMetadataTransferJobInput(v *CancelMetadataTransferJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelMetadataTransferJobInput"} + if v.MetadataTransferJobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetadataTransferJobId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateComponentTypeInput(v *CreateComponentTypeInput) error { if v == nil { return nil @@ -1223,6 +1655,37 @@ func validateOpCreateEntityInput(v *CreateEntityInput) error { invalidParams.AddNested("Components", err.(smithy.InvalidParamsError)) } } + if v.CompositeComponents != nil { + if err := validateCompositeComponentsMapRequest(v.CompositeComponents); err != nil { + invalidParams.AddNested("CompositeComponents", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateMetadataTransferJobInput(v *CreateMetadataTransferJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateMetadataTransferJobInput"} + if v.Sources == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sources")) + } else if v.Sources != nil { + if err := validateSourceConfigurations(v.Sources); err != nil { + invalidParams.AddNested("Sources", err.(smithy.InvalidParamsError)) + } + } + if v.Destination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } else if v.Destination != nil { + if err := validateDestinationConfiguration(v.Destination); err != nil { + invalidParams.AddNested("Destination", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1280,12 +1743,6 @@ func validateOpCreateWorkspaceInput(v *CreateWorkspaceInput) error { if v.WorkspaceId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) } - if v.S3Location == nil { - invalidParams.Add(smithy.NewErrParamRequired("S3Location")) - } - if v.Role == nil { - invalidParams.Add(smithy.NewErrParamRequired("Role")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1434,6 +1891,21 @@ func validateOpGetEntityInput(v *GetEntityInput) error { } } +func validateOpGetMetadataTransferJobInput(v *GetMetadataTransferJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetMetadataTransferJobInput"} + if v.MetadataTransferJobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetadataTransferJobId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetPropertyValueHistoryInput(v *GetPropertyValueHistoryInput) error { if v == nil { return nil @@ -1523,6 +1995,24 @@ func validateOpGetWorkspaceInput(v *GetWorkspaceInput) error { } } +func validateOpListComponentsInput(v *ListComponentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListComponentsInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if v.EntityId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EntityId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListComponentTypesInput(v *ListComponentTypesInput) error { if v == nil { return nil @@ -1553,6 +2043,42 @@ func validateOpListEntitiesInput(v *ListEntitiesInput) error { } } +func validateOpListMetadataTransferJobsInput(v *ListMetadataTransferJobsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListMetadataTransferJobsInput"} + if len(v.SourceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SourceType")) + } + if len(v.DestinationType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("DestinationType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListPropertiesInput(v *ListPropertiesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListPropertiesInput"} + if v.WorkspaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkspaceId")) + } + if v.EntityId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EntityId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListScenesInput(v *ListScenesInput) error { if v == nil { return nil @@ -1696,6 +2222,11 @@ func validateOpUpdateEntityInput(v *UpdateEntityInput) error { invalidParams.AddNested("ComponentUpdates", err.(smithy.InvalidParamsError)) } } + if v.CompositeComponentUpdates != nil { + if err := validateCompositeComponentUpdatesMapRequest(v.CompositeComponentUpdates); err != nil { + invalidParams.AddNested("CompositeComponentUpdates", err.(smithy.InvalidParamsError)) + } + } if v.ParentEntityUpdate != nil { if err := validateParentEntityUpdateRequest(v.ParentEntityUpdate); err != nil { invalidParams.AddNested("ParentEntityUpdate", err.(smithy.InvalidParamsError)) diff --git a/service/s3/api_op_CompleteMultipartUpload.go b/service/s3/api_op_CompleteMultipartUpload.go index 6944c3ddae0..0d43af35822 100644 --- a/service/s3/api_op_CompleteMultipartUpload.go +++ b/service/s3/api_op_CompleteMultipartUpload.go @@ -160,8 +160,9 @@ type CompleteMultipartUploadInput struct { RequestPayer types.RequestPayer // The server-side encryption (SSE) algorithm used to encrypt the object. This - // parameter is needed only when the object was created using a checksum algorithm. - // For more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) + // parameter is required only when the object was created using a checksum + // algorithm or if your bucket policy requires the use of SSE-C. For more + // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html#ssec-require-condition-key) // in the Amazon S3 User Guide. SSECustomerAlgorithm *string diff --git a/service/s3/api_op_CopyObject.go b/service/s3/api_op_CopyObject.go index 3e9652cd0c8..83923f8d7bc 100644 --- a/service/s3/api_op_CopyObject.go +++ b/service/s3/api_op_CopyObject.go @@ -356,7 +356,8 @@ type CopyObjectInput struct { // Specifies the Amazon Web Services KMS Encryption Context to use for object // encryption. The value of this header is a base64-encoded UTF-8 string holding - // JSON with the encryption context key-value pairs. + // JSON with the encryption context key-value pairs. This value must be explicitly + // added to specify encryption context for CopyObject requests. SSEKMSEncryptionContext *string // Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object diff --git a/service/s3/api_op_GetObject.go b/service/s3/api_op_GetObject.go index 1db1f0bd2a7..e031bdb0f2d 100644 --- a/service/s3/api_op_GetObject.go +++ b/service/s3/api_op_GetObject.go @@ -73,6 +73,8 @@ import ( // - If the current version of the object is a delete marker, Amazon S3 behaves // as if the object was deleted and includes x-amz-delete-marker: true in the // response. +// - If the specified version is a delete marker, the response returns a 405 +// (Method Not Allowed) error and the Last-Modified: timestamp response header. // // For more information about versioning, see PutBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) // . Overriding Response Header Values There are times when you want to override @@ -319,7 +321,7 @@ type GetObjectOutput struct { // The date and time at which the object is no longer cacheable. Expires *time.Time - // Creation date of the object. + // Date and time when the object was last modified. LastModified *time.Time // A map of metadata to store with the object in S3. diff --git a/service/s3/api_op_HeadObject.go b/service/s3/api_op_HeadObject.go index 18597b10f4c..a50fdc98d23 100644 --- a/service/s3/api_op_HeadObject.go +++ b/service/s3/api_op_HeadObject.go @@ -22,12 +22,13 @@ import ( // To use HEAD , you must have READ access to the object. A HEAD request has the // same options as a GET action on an object. The response is identical to the GET // response except that there is no response body. Because of this, if the HEAD -// request generates an error, it returns a generic 400 Bad Request , 403 Forbidden -// or 404 Not Found code. It is not possible to retrieve the exact exception -// beyond these error codes. If you encrypt an object by using server-side -// encryption with customer-provided encryption keys (SSE-C) when you store the -// object in Amazon S3, then when you retrieve the metadata from the object, you -// must use the following headers: +// request generates an error, it returns a generic code, such as 400 Bad Request , +// 403 Forbidden , 404 Not Found , 405 Method Not Allowed , 412 Precondition Failed +// , or 304 Not Modified . It's not possible to retrieve the exact exception of +// these error codes. If you encrypt an object by using server-side encryption with +// customer-provided encryption keys (SSE-C) when you store the object in Amazon +// S3, then when you retrieve the metadata from the object, you must use the +// following headers: // - x-amz-server-side-encryption-customer-algorithm // - x-amz-server-side-encryption-customer-key // - x-amz-server-side-encryption-customer-key-MD5 @@ -68,6 +69,13 @@ import ( // - If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP // status code 403 error. // +// Versioning +// - If the current version of the object is a delete marker, Amazon S3 behaves +// as if the object was deleted and includes x-amz-delete-marker: true in the +// response. +// - If the specified version is a delete marker, the response returns a 405 +// (Method Not Allowed) error and the Last-Modified: timestamp response header. +// // The following actions are related to HeadObject : // - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) @@ -263,7 +271,7 @@ type HeadObjectOutput struct { // The date and time at which the object is no longer cacheable. Expires *time.Time - // Creation date of the object. + // Date and time when the object was last modified. LastModified *time.Time // A map of metadata to store with the object in S3. diff --git a/service/s3/api_op_ListObjectVersions.go b/service/s3/api_op_ListObjectVersions.go index 60d5dd6461b..f3341b5746c 100644 --- a/service/s3/api_op_ListObjectVersions.go +++ b/service/s3/api_op_ListObjectVersions.go @@ -19,9 +19,8 @@ import ( // perform the s3:ListBucketVersions action. Be aware of the name difference. A // 200 OK response can contain valid or invalid XML. Make sure to design your // application to parse the contents of the response and handle it appropriately. -// To use this operation, you must have READ access to the bucket. This action is -// not supported by Amazon S3 on Outposts. The following operations are related to -// ListObjectVersions : +// To use this operation, you must have READ access to the bucket. The following +// operations are related to ListObjectVersions : // - ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) // - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) diff --git a/service/s3/api_op_PutObject.go b/service/s3/api_op_PutObject.go index 03d01b3bfbd..856fea18657 100644 --- a/service/s3/api_op_PutObject.go +++ b/service/s3/api_op_PutObject.go @@ -287,7 +287,8 @@ type PutObjectInput struct { // encryption. The value of this header is a base64-encoded UTF-8 string holding // JSON with the encryption context key-value pairs. This value is stored as object // metadata and automatically gets passed on to Amazon Web Services KMS for future - // GetObject or CopyObject operations on this object. + // GetObject or CopyObject operations on this object. This value must be + // explicitly added during CopyObject operations. SSEKMSEncryptionContext *string // If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse , diff --git a/service/s3/deserializers.go b/service/s3/deserializers.go index 3588a8180e1..2e75f800dd2 100644 --- a/service/s3/deserializers.go +++ b/service/s3/deserializers.go @@ -17420,6 +17420,12 @@ func awsRestxml_deserializeDocumentLoggingEnabled(v **types.LoggingEnabled, deco return err } + case strings.EqualFold("TargetObjectKeyFormat", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentTargetObjectKeyFormat(&sv.TargetObjectKeyFormat, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("TargetPrefix", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -19570,6 +19576,55 @@ func awsRestxml_deserializeDocumentPart(v **types.Part, decoder smithyxml.NodeDe return nil } +func awsRestxml_deserializeDocumentPartitionedPrefix(v **types.PartitionedPrefix, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PartitionedPrefix + if *v == nil { + sv = &types.PartitionedPrefix{} + } 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("PartitionDateSource", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PartitionDateSource = types.PartitionDateSource(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 awsRestxml_deserializeDocumentParts(v *[]types.Part, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21148,6 +21203,42 @@ func awsRestxml_deserializeDocumentServerSideEncryptionRulesUnwrapped(v *[]types *v = sv return nil } +func awsRestxml_deserializeDocumentSimplePrefix(v **types.SimplePrefix, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SimplePrefix + if *v == nil { + sv = &types.SimplePrefix{} + } 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 { + 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 awsRestxml_deserializeDocumentSourceSelectionCriteria(v **types.SourceSelectionCriteria, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21680,6 +21771,54 @@ func awsRestxml_deserializeDocumentTargetGrantsUnwrapped(v *[]types.TargetGrant, *v = sv return nil } +func awsRestxml_deserializeDocumentTargetObjectKeyFormat(v **types.TargetObjectKeyFormat, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TargetObjectKeyFormat + if *v == nil { + sv = &types.TargetObjectKeyFormat{} + } 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("PartitionedPrefix", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentPartitionedPrefix(&sv.PartitionedPrefix, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SimplePrefix", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentSimplePrefix(&sv.SimplePrefix, 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 awsRestxml_deserializeDocumentTiering(v **types.Tiering, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/s3/serializers.go b/service/s3/serializers.go index 9f010166c60..bae7f32e249 100644 --- a/service/s3/serializers.go +++ b/service/s3/serializers.go @@ -10519,6 +10519,19 @@ func awsRestxml_serializeDocumentLoggingEnabled(v *types.LoggingEnabled, value s return err } } + if v.TargetObjectKeyFormat != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "TargetObjectKeyFormat", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentTargetObjectKeyFormat(v.TargetObjectKeyFormat, el); err != nil { + return err + } + } if v.TargetPrefix != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ @@ -11133,6 +11146,22 @@ func awsRestxml_serializeDocumentParquetInput(v *types.ParquetInput, value smith return nil } +func awsRestxml_serializeDocumentPartitionedPrefix(v *types.PartitionedPrefix, value smithyxml.Value) error { + defer value.Close() + if len(v.PartitionDateSource) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "PartitionDateSource", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.PartitionDateSource)) + } + return nil +} + func awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v *types.PublicAccessBlockConfiguration, value smithyxml.Value) error { defer value.Close() if v.BlockPublicAcls != nil { @@ -12093,6 +12122,11 @@ func awsRestxml_serializeDocumentServerSideEncryptionRules(v []types.ServerSideE return nil } +func awsRestxml_serializeDocumentSimplePrefix(v *types.SimplePrefix, value smithyxml.Value) error { + defer value.Close() + return nil +} + func awsRestxml_serializeDocumentSourceSelectionCriteria(v *types.SourceSelectionCriteria, value smithyxml.Value) error { defer value.Close() if v.ReplicaModifications != nil { @@ -12332,6 +12366,37 @@ func awsRestxml_serializeDocumentTargetGrants(v []types.TargetGrant, value smith return nil } +func awsRestxml_serializeDocumentTargetObjectKeyFormat(v *types.TargetObjectKeyFormat, value smithyxml.Value) error { + defer value.Close() + if v.PartitionedPrefix != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "PartitionedPrefix", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentPartitionedPrefix(v.PartitionedPrefix, el); err != nil { + return err + } + } + if v.SimplePrefix != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "SimplePrefix", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentSimplePrefix(v.SimplePrefix, el); err != nil { + return err + } + } + return nil +} + func awsRestxml_serializeDocumentTiering(v *types.Tiering, value smithyxml.Value) error { defer value.Close() if len(v.AccessTier) > 0 { diff --git a/service/s3/types/enums.go b/service/s3/types/enums.go index 613da169d4c..60a0fd2d76c 100644 --- a/service/s3/types/enums.go +++ b/service/s3/types/enums.go @@ -888,6 +888,24 @@ func (OwnerOverride) Values() []OwnerOverride { } } +type PartitionDateSource string + +// Enum values for PartitionDateSource +const ( + PartitionDateSourceEventTime PartitionDateSource = "EventTime" + PartitionDateSourceDeliveryTime PartitionDateSource = "DeliveryTime" +) + +// Values returns all known values for PartitionDateSource. 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 (PartitionDateSource) Values() []PartitionDateSource { + return []PartitionDateSource{ + "EventTime", + "DeliveryTime", + } +} + type Payer string // Enum values for Payer diff --git a/service/s3/types/types.go b/service/s3/types/types.go index cc006dd4d58..26d4687d57c 100644 --- a/service/s3/types/types.go +++ b/service/s3/types/types.go @@ -624,7 +624,7 @@ type DeleteMarkerEntry struct { // The object key. Key *string - // Date and time the object was last modified. + // Date and time when the object was last modified. LastModified *time.Time // The account that created the delete marker.> @@ -1801,6 +1801,9 @@ type LoggingEnabled struct { // in the Amazon S3 User Guide. TargetGrants []TargetGrant + // Amazon S3 key format for log objects. + TargetObjectKeyFormat *TargetObjectKeyFormat + noSmithyDocumentSerde } @@ -1959,10 +1962,10 @@ type MultipartUpload struct { // the object's lifetime. type NoncurrentVersionExpiration struct { - // Specifies how many noncurrent versions Amazon S3 will retain. If there are this - // many more recent noncurrent versions, Amazon S3 will take the associated action. - // For more information about noncurrent versions, see Lifecycle configuration - // elements (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) + // Specifies how many newer noncurrent versions must exist before Amazon S3 can + // perform the associated action on a given version. If there are this many more + // recent noncurrent versions, Amazon S3 will take the associated action. For more + // information about noncurrent versions, see Lifecycle configuration elements (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) // in the Amazon S3 User Guide. NewerNoncurrentVersions *int32 @@ -1985,10 +1988,10 @@ type NoncurrentVersionExpiration struct { // specific period in the object's lifetime. type NoncurrentVersionTransition struct { - // Specifies how many noncurrent versions Amazon S3 will retain. If there are this - // many more recent noncurrent versions, Amazon S3 will take the associated action. - // For more information about noncurrent versions, see Lifecycle configuration - // elements (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) + // Specifies how many newer noncurrent versions must exist before Amazon S3 can + // perform the associated action on a given version. If there are this many more + // recent noncurrent versions, Amazon S3 will take the associated action. For more + // information about noncurrent versions, see Lifecycle configuration elements (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) // in the Amazon S3 User Guide. NewerNoncurrentVersions *int32 @@ -2210,7 +2213,7 @@ type ObjectVersion struct { // The object key. Key *string - // Date and time the object was last modified. + // Date and time when the object was last modified. LastModified *time.Time // Specifies the owner of the object. @@ -2361,6 +2364,19 @@ type Part struct { noSmithyDocumentSerde } +// Amazon S3 keys for log objects are partitioned in the following format: +// [DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] +// PartitionedPrefix defaults to EventTime delivery when server access logs are +// delivered. +type PartitionedPrefix struct { + + // Specifies the partition date source for the partitioned prefix. + // PartitionDateSource can be EventTime or DeliveryTime. + PartitionDateSource PartitionDateSource + + noSmithyDocumentSerde +} + // The container element for a bucket's policy status. type PolicyStatus struct { @@ -3047,6 +3063,12 @@ type ServerSideEncryptionRule struct { noSmithyDocumentSerde } +// To use simple format for S3 keys for log objects, set SimplePrefix to an empty +// object. [DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] +type SimplePrefix struct { + noSmithyDocumentSerde +} + // A container that describes additional filters for identifying the source // objects that you want to replicate. You can choose to enable or disable the // replication of these objects. Currently, Amazon S3 supports only the filter that @@ -3196,6 +3218,20 @@ type TargetGrant struct { noSmithyDocumentSerde } +// Amazon S3 key format for log objects. Only one format, PartitionedPrefix or +// SimplePrefix, is allowed. +type TargetObjectKeyFormat struct { + + // Partitioned S3 key for log objects. + PartitionedPrefix *PartitionedPrefix + + // To use the simple format for S3 keys for log objects. To specify SimplePrefix + // format, set SimplePrefix to {}. + SimplePrefix *SimplePrefix + + noSmithyDocumentSerde +} + // The S3 Intelligent-Tiering storage class is designed to optimize storage costs // by automatically moving data to the most cost-effective storage access tier, // without additional operational overhead. diff --git a/service/workspaces/internal/endpoints/endpoints.go b/service/workspaces/internal/endpoints/endpoints.go index 57f3df4c80a..f343b519b68 100644 --- a/service/workspaces/internal/endpoints/endpoints.go +++ b/service/workspaces/internal/endpoints/endpoints.go @@ -187,6 +187,9 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{},