From 81ad16867997bc40b56a9ced651840674f23d384 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Wed, 22 May 2024 18:24:55 +0000 Subject: [PATCH] Regenerated Clients --- .../27beef8233014877ad00755e75f3ef9a.json | 8 + .../aaec43dddc7f42de892d37dd1d0b2c56.json | 8 + .../b8ca256a7b15477e86f6b3759b17b3e6.json | 8 + .../c0d4fcb31e7546429871d47352f219fa.json | 8 + .../ee0e8cca166441fa87967d5f53134fb2.json | 8 + .../api_op_CreateChimeWebhookConfiguration.go | 3 + ...reateMicrosoftTeamsChannelConfiguration.go | 3 + .../api_op_CreateSlackChannelConfiguration.go | 3 + service/chatbot/api_op_ListTagsForResource.go | 136 ++++ service/chatbot/api_op_TagResource.go | 137 ++++ service/chatbot/api_op_UntagResource.go | 136 ++++ service/chatbot/deserializers.go | 738 +++++++++++++++++- service/chatbot/generated.json | 3 + service/chatbot/serializers.go | 315 ++++++++ .../api_op_ListTagsForResource.go.snap | 34 + .../snapshot/api_op_TagResource.go.snap | 34 + .../snapshot/api_op_UntagResource.go.snap | 34 + service/chatbot/snapshot_test.go | 72 ++ service/chatbot/types/errors.go | 80 ++ service/chatbot/types/types.go | 25 + service/chatbot/validators.go | 195 +++++ service/cloudformation/api_op_DeleteStack.go | 10 + .../api_op_ListStackInstanceResourceDrifts.go | 4 +- service/cloudformation/deserializers.go | 13 + service/cloudformation/serializers.go | 5 + service/cloudformation/types/enums.go | 19 + service/cloudformation/types/types.go | 13 +- service/kms/api_op_GetParametersForImport.go | 32 +- service/kms/types/enums.go | 4 + service/opensearch/api_op_GetDataSource.go | 3 + service/opensearch/api_op_UpdateDataSource.go | 3 + service/opensearch/deserializers.go | 18 + service/opensearch/serializers.go | 5 + service/opensearch/types/enums.go | 19 + service/opensearch/types/types.go | 5 +- .../s3control/internal/endpoints/endpoints.go | 49 ++ .../api_op_DeleteLoggingConfiguration.go | 20 + .../wafv2/api_op_GetLoggingConfiguration.go | 19 + .../wafv2/api_op_ListLoggingConfigurations.go | 13 + service/wafv2/deserializers.go | 18 + service/wafv2/serializers.go | 35 + service/wafv2/types/enums.go | 36 + service/wafv2/types/types.go | 41 +- 43 files changed, 2332 insertions(+), 40 deletions(-) create mode 100644 .changelog/27beef8233014877ad00755e75f3ef9a.json create mode 100644 .changelog/aaec43dddc7f42de892d37dd1d0b2c56.json create mode 100644 .changelog/b8ca256a7b15477e86f6b3759b17b3e6.json create mode 100644 .changelog/c0d4fcb31e7546429871d47352f219fa.json create mode 100644 .changelog/ee0e8cca166441fa87967d5f53134fb2.json create mode 100644 service/chatbot/api_op_ListTagsForResource.go create mode 100644 service/chatbot/api_op_TagResource.go create mode 100644 service/chatbot/api_op_UntagResource.go create mode 100644 service/chatbot/snapshot/api_op_ListTagsForResource.go.snap create mode 100644 service/chatbot/snapshot/api_op_TagResource.go.snap create mode 100644 service/chatbot/snapshot/api_op_UntagResource.go.snap diff --git a/.changelog/27beef8233014877ad00755e75f3ef9a.json b/.changelog/27beef8233014877ad00755e75f3ef9a.json new file mode 100644 index 00000000000..6430de905db --- /dev/null +++ b/.changelog/27beef8233014877ad00755e75f3ef9a.json @@ -0,0 +1,8 @@ +{ + "id": "27beef82-3301-4877-ad00-755e75f3ef9a", + "type": "feature", + "description": "This release adds support for enabling or disabling a data source configured as part of Zero-ETL integration with Amazon S3, by setting its status.", + "modules": [ + "service/opensearch" + ] +} \ No newline at end of file diff --git a/.changelog/aaec43dddc7f42de892d37dd1d0b2c56.json b/.changelog/aaec43dddc7f42de892d37dd1d0b2c56.json new file mode 100644 index 00000000000..6ce1b0a1b0b --- /dev/null +++ b/.changelog/aaec43dddc7f42de892d37dd1d0b2c56.json @@ -0,0 +1,8 @@ +{ + "id": "aaec43dd-dc7f-42de-892d-37dd1d0b2c56", + "type": "feature", + "description": "This change adds support for tagging Chatbot configurations.", + "modules": [ + "service/chatbot" + ] +} \ No newline at end of file diff --git a/.changelog/b8ca256a7b15477e86f6b3759b17b3e6.json b/.changelog/b8ca256a7b15477e86f6b3759b17b3e6.json new file mode 100644 index 00000000000..501b489e0c3 --- /dev/null +++ b/.changelog/b8ca256a7b15477e86f6b3759b17b3e6.json @@ -0,0 +1,8 @@ +{ + "id": "b8ca256a-7b15-477e-86f6-b3759b17b3e6", + "type": "feature", + "description": "You can now use Security Lake to collect web ACL traffic data.", + "modules": [ + "service/wafv2" + ] +} \ No newline at end of file diff --git a/.changelog/c0d4fcb31e7546429871d47352f219fa.json b/.changelog/c0d4fcb31e7546429871d47352f219fa.json new file mode 100644 index 00000000000..0b9772fb872 --- /dev/null +++ b/.changelog/c0d4fcb31e7546429871d47352f219fa.json @@ -0,0 +1,8 @@ +{ + "id": "c0d4fcb3-1e75-4642-9871-d47352f219fa", + "type": "feature", + "description": "This release includes feature to import customer's asymmetric (RSA, ECC and SM2) and HMAC keys into KMS in China.", + "modules": [ + "service/kms" + ] +} \ No newline at end of file diff --git a/.changelog/ee0e8cca166441fa87967d5f53134fb2.json b/.changelog/ee0e8cca166441fa87967d5f53134fb2.json new file mode 100644 index 00000000000..10711f1ce57 --- /dev/null +++ b/.changelog/ee0e8cca166441fa87967d5f53134fb2.json @@ -0,0 +1,8 @@ +{ + "id": "ee0e8cca-1664-41fa-8796-7d5f53134fb2", + "type": "feature", + "description": "Added DeletionMode FORCE_DELETE_STACK for deleting a stack that is stuck in DELETE_FAILED state due to resource deletion failure.", + "modules": [ + "service/cloudformation" + ] +} \ No newline at end of file diff --git a/service/chatbot/api_op_CreateChimeWebhookConfiguration.go b/service/chatbot/api_op_CreateChimeWebhookConfiguration.go index ab6982f63c8..c566e5cbea5 100644 --- a/service/chatbot/api_op_CreateChimeWebhookConfiguration.go +++ b/service/chatbot/api_op_CreateChimeWebhookConfiguration.go @@ -60,6 +60,9 @@ type CreateChimeWebhookConfigurationInput struct { // Logging levels include ERROR, INFO, or NONE. LoggingLevel *string + // A list of tags to apply to the configuration. + Tags []types.Tag + noSmithyDocumentSerde } diff --git a/service/chatbot/api_op_CreateMicrosoftTeamsChannelConfiguration.go b/service/chatbot/api_op_CreateMicrosoftTeamsChannelConfiguration.go index 3587183cc04..21d2d401ad8 100644 --- a/service/chatbot/api_op_CreateMicrosoftTeamsChannelConfiguration.go +++ b/service/chatbot/api_op_CreateMicrosoftTeamsChannelConfiguration.go @@ -73,6 +73,9 @@ type CreateMicrosoftTeamsChannelConfigurationInput struct { // The ARNs of the SNS topics that deliver notifications to AWS Chatbot. SnsTopicArns []string + // A list of tags to apply to the configuration. + Tags []types.Tag + // The name of the Microsoft Teams Team. TeamName *string diff --git a/service/chatbot/api_op_CreateSlackChannelConfiguration.go b/service/chatbot/api_op_CreateSlackChannelConfiguration.go index 82a809691f7..aea26d1d583 100644 --- a/service/chatbot/api_op_CreateSlackChannelConfiguration.go +++ b/service/chatbot/api_op_CreateSlackChannelConfiguration.go @@ -66,6 +66,9 @@ type CreateSlackChannelConfigurationInput struct { // The ARNs of the SNS topics that deliver notifications to AWS Chatbot. SnsTopicArns []string + // A list of tags to apply to the configuration. + Tags []types.Tag + // Enables use of a user role requirement in your chat configuration. UserAuthorizationRequired *bool diff --git a/service/chatbot/api_op_ListTagsForResource.go b/service/chatbot/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..0857cc6a3a6 --- /dev/null +++ b/service/chatbot/api_op_ListTagsForResource.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chatbot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/chatbot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the list of tags applied to a configuration. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN of the configuration. + // + // This member is required. + ResourceARN *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // A list of tags applied to the configuration. + Tags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); 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 = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = 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 = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = 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_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/service/chatbot/api_op_TagResource.go b/service/chatbot/api_op_TagResource.go new file mode 100644 index 00000000000..a5ec79f015e --- /dev/null +++ b/service/chatbot/api_op_TagResource.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chatbot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/chatbot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Applies the supplied tags to a configuration. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The ARN of the configuration. + // + // This member is required. + ResourceARN *string + + // A list of tags to apply to the configuration. + // + // This member is required. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); 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 = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = 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 = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = 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_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResource", + } +} diff --git a/service/chatbot/api_op_UntagResource.go b/service/chatbot/api_op_UntagResource.go new file mode 100644 index 00000000000..d6981db9fae --- /dev/null +++ b/service/chatbot/api_op_UntagResource.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chatbot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the supplied tags from a configuration +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The ARN of the configuration. + // + // This member is required. + ResourceARN *string + + // A list of tag keys to remove from the configuration. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); 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 = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = 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 = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = 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_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResource", + } +} diff --git a/service/chatbot/deserializers.go b/service/chatbot/deserializers.go index 557f9a2e8a3..6e4e6a86e06 100644 --- a/service/chatbot/deserializers.go +++ b/service/chatbot/deserializers.go @@ -2558,6 +2558,340 @@ func awsRestjson1_deserializeOpDocumentListMicrosoftTeamsUserIdentitiesOutput(v return nil } +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(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("TooManyTagsException", errorCode): + return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpUpdateAccountPreferences struct { } @@ -3774,7 +4108,115 @@ func awsRestjson1_deserializeErrorGetTeamsChannelConfigurationException(response return err } - err := awsRestjson1_deserializeDocumentGetTeamsChannelConfigurationException(&output, shape) + err := awsRestjson1_deserializeDocumentGetTeamsChannelConfigurationException(&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_deserializeErrorInternalServiceError(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServiceError{} + 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_deserializeDocumentInternalServiceError(&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_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidParameterException{} + 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_deserializeDocumentInvalidParameterException(&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 @@ -3791,8 +4233,8 @@ func awsRestjson1_deserializeErrorGetTeamsChannelConfigurationException(response return output } -func awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidParameterException{} +func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.LimitExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3810,7 +4252,7 @@ func awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp return err } - err := awsRestjson1_deserializeDocumentInvalidParameterException(&output, shape) + err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -3827,8 +4269,8 @@ func awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp return output } -func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestException{} +func awsRestjson1_deserializeErrorListMicrosoftTeamsConfiguredTeamsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ListMicrosoftTeamsConfiguredTeamsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3846,7 +4288,7 @@ func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.R return err } - err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) + err := awsRestjson1_deserializeDocumentListMicrosoftTeamsConfiguredTeamsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -3863,8 +4305,8 @@ func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.R return output } -func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.LimitExceededException{} +func awsRestjson1_deserializeErrorListMicrosoftTeamsUserIdentitiesException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ListMicrosoftTeamsUserIdentitiesException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3882,7 +4324,7 @@ func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Re return err } - err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) + err := awsRestjson1_deserializeDocumentListMicrosoftTeamsUserIdentitiesException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -3899,8 +4341,8 @@ func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Re return output } -func awsRestjson1_deserializeErrorListMicrosoftTeamsConfiguredTeamsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ListMicrosoftTeamsConfiguredTeamsException{} +func awsRestjson1_deserializeErrorListTeamsChannelConfigurationsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ListTeamsChannelConfigurationsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3918,7 +4360,7 @@ func awsRestjson1_deserializeErrorListMicrosoftTeamsConfiguredTeamsException(res return err } - err := awsRestjson1_deserializeDocumentListMicrosoftTeamsConfiguredTeamsException(&output, shape) + err := awsRestjson1_deserializeDocumentListTeamsChannelConfigurationsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -3935,8 +4377,8 @@ func awsRestjson1_deserializeErrorListMicrosoftTeamsConfiguredTeamsException(res return output } -func awsRestjson1_deserializeErrorListMicrosoftTeamsUserIdentitiesException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ListMicrosoftTeamsUserIdentitiesException{} +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3954,7 +4396,7 @@ func awsRestjson1_deserializeErrorListMicrosoftTeamsUserIdentitiesException(resp return err } - err := awsRestjson1_deserializeDocumentListMicrosoftTeamsUserIdentitiesException(&output, shape) + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -3971,8 +4413,8 @@ func awsRestjson1_deserializeErrorListMicrosoftTeamsUserIdentitiesException(resp return output } -func awsRestjson1_deserializeErrorListTeamsChannelConfigurationsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ListTeamsChannelConfigurationsException{} +func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceUnavailableException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -3990,7 +4432,7 @@ func awsRestjson1_deserializeErrorListTeamsChannelConfigurationsException(respon return err } - err := awsRestjson1_deserializeDocumentListTeamsChannelConfigurationsException(&output, shape) + err := awsRestjson1_deserializeDocumentServiceUnavailableException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -4007,8 +4449,8 @@ func awsRestjson1_deserializeErrorListTeamsChannelConfigurationsException(respon return output } -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} +func awsRestjson1_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTagsException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4026,7 +4468,7 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp return err } - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + err := awsRestjson1_deserializeDocumentTooManyTagsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -4299,6 +4741,11 @@ func awsRestjson1_deserializeDocumentChimeWebhookConfiguration(v **types.ChimeWe return err } + case "Tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + case "WebhookDescription": if value != nil { jtv, ok := value.(string) @@ -5159,6 +5606,46 @@ func awsRestjson1_deserializeDocumentGuardrailPolicyArnList(v *[]string, value i return nil } +func awsRestjson1_deserializeDocumentInternalServiceError(v **types.InternalServiceError, 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.InternalServiceError + if *v == nil { + sv = &types.InternalServiceError{} + } 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_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5439,6 +5926,46 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } +func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, 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.ServiceUnavailableException + if *v == nil { + sv = &types.ServiceUnavailableException{} + } 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_deserializeDocumentSlackChannelConfiguration(v **types.SlackChannelConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5543,6 +6070,11 @@ func awsRestjson1_deserializeDocumentSlackChannelConfiguration(v **types.SlackCh return err } + case "Tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + case "UserAuthorizationRequired": if value != nil { jtv, ok := value.(bool) @@ -5824,6 +6356,123 @@ func awsRestjson1_deserializeDocumentSnsTopicArnList(v *[]string, value interfac return nil } +func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "TagKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + } + sv.TagKey = ptr.String(jtv) + } + + case "TagValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + sv.TagValue = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTags(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTeamChannelConfigurationsList(v *[]types.TeamsChannelConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5944,6 +6593,11 @@ func awsRestjson1_deserializeDocumentTeamsChannelConfiguration(v **types.TeamsCh return err } + case "Tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + case "TeamId": if value != nil { jtv, ok := value.(string) @@ -6117,6 +6771,46 @@ func awsRestjson1_deserializeDocumentTeamsUserIdentity(v **types.TeamsUserIdenti return nil } +func awsRestjson1_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, 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.TooManyTagsException + if *v == nil { + sv = &types.TooManyTagsException{} + } 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_deserializeDocumentUpdateAccountPreferencesException(v **types.UpdateAccountPreferencesException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/chatbot/generated.json b/service/chatbot/generated.json index 86a26979465..13f6b83aa5d 100644 --- a/service/chatbot/generated.json +++ b/service/chatbot/generated.json @@ -27,6 +27,9 @@ "api_op_ListMicrosoftTeamsChannelConfigurations.go", "api_op_ListMicrosoftTeamsConfiguredTeams.go", "api_op_ListMicrosoftTeamsUserIdentities.go", + "api_op_ListTagsForResource.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", "api_op_UpdateAccountPreferences.go", "api_op_UpdateChimeWebhookConfiguration.go", "api_op_UpdateMicrosoftTeamsChannelConfiguration.go", diff --git a/service/chatbot/serializers.go b/service/chatbot/serializers.go index 7a47e2485de..f3e0ebfbf0c 100644 --- a/service/chatbot/serializers.go +++ b/service/chatbot/serializers.go @@ -6,6 +6,7 @@ import ( "bytes" "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/chatbot/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" @@ -102,6 +103,13 @@ func awsRestjson1_serializeOpDocumentCreateChimeWebhookConfigurationInput(v *Cre } } + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + if v.WebhookDescription != nil { ok := object.Key("WebhookDescription") ok.String(*v.WebhookDescription) @@ -221,6 +229,13 @@ func awsRestjson1_serializeOpDocumentCreateMicrosoftTeamsChannelConfigurationInp } } + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + if v.TeamId != nil { ok := object.Key("TeamId") ok.String(*v.TeamId) @@ -355,6 +370,13 @@ func awsRestjson1_serializeOpDocumentCreateSlackChannelConfigurationInput(v *Cre } } + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + if v.UserAuthorizationRequired != nil { ok := object.Key("UserAuthorizationRequired") ok.Boolean(*v.UserAuthorizationRequired) @@ -1615,6 +1637,245 @@ func awsRestjson1_serializeOpDocumentListMicrosoftTeamsUserIdentitiesInput(v *Li return nil } +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-tags-for-resource") + 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_serializeOpDocumentListTagsForResourceInput(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_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tag-resource") + 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_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/untag-resource") + 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_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsRestjson1_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateAccountPreferences struct { } @@ -2046,3 +2307,57 @@ func awsRestjson1_serializeDocumentSnsTopicArnList(v []string, value smithyjson. } return nil } + +func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TagKey != nil { + ok := object.Key("TagKey") + ok.String(*v.TagKey) + } + + if v.TagValue != nil { + ok := object.Key("TagValue") + ok.String(*v.TagValue) + } + + return nil +} + +func awsRestjson1_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTags(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} diff --git a/service/chatbot/snapshot/api_op_ListTagsForResource.go.snap b/service/chatbot/snapshot/api_op_ListTagsForResource.go.snap new file mode 100644 index 00000000000..7cac42da90f --- /dev/null +++ b/service/chatbot/snapshot/api_op_ListTagsForResource.go.snap @@ -0,0 +1,34 @@ +ListTagsForResource + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/chatbot/snapshot/api_op_TagResource.go.snap b/service/chatbot/snapshot/api_op_TagResource.go.snap new file mode 100644 index 00000000000..8cbd140ba62 --- /dev/null +++ b/service/chatbot/snapshot/api_op_TagResource.go.snap @@ -0,0 +1,34 @@ +TagResource + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/chatbot/snapshot/api_op_UntagResource.go.snap b/service/chatbot/snapshot/api_op_UntagResource.go.snap new file mode 100644 index 00000000000..78e1acab599 --- /dev/null +++ b/service/chatbot/snapshot/api_op_UntagResource.go.snap @@ -0,0 +1,34 @@ +UntagResource + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/chatbot/snapshot_test.go b/service/chatbot/snapshot_test.go index 7313429bfd2..2493b6d5a19 100644 --- a/service/chatbot/snapshot_test.go +++ b/service/chatbot/snapshot_test.go @@ -290,6 +290,42 @@ func TestCheckSnapshot_ListMicrosoftTeamsUserIdentities(t *testing.T) { } } +func TestCheckSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateAccountPreferences(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateAccountPreferences(context.Background(), nil, func(o *Options) { @@ -565,6 +601,42 @@ func TestUpdateSnapshot_ListMicrosoftTeamsUserIdentities(t *testing.T) { } } +func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateAccountPreferences(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateAccountPreferences(context.Background(), nil, func(o *Options) { diff --git a/service/chatbot/types/errors.go b/service/chatbot/types/errors.go index fd72cb0e545..a12487bbc8e 100644 --- a/service/chatbot/types/errors.go +++ b/service/chatbot/types/errors.go @@ -490,6 +490,33 @@ func (e *GetTeamsChannelConfigurationException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// Customer/consumer-facing internal service exception. +// https://w.amazon.com/index.php/AWS/API_Standards/Exceptions#InternalServiceError +type InternalServiceError struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServiceError) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServiceError) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServiceError) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServiceError" + } + return *e.ErrorCodeOverride +} +func (e *InternalServiceError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + // Your request input doesn't meet the constraints that AWS Chatbot requires. type InvalidParameterException struct { Message *string @@ -681,6 +708,59 @@ func (e *ResourceNotFoundException) ErrorCode() string { } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// We can’t process your request right now because of a server issue. Try again +// later. +type ServiceUnavailableException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceUnavailableException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceUnavailableException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceUnavailableException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The supplied list of tags contains too many tags. +type TooManyTagsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyTagsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyTagsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyTagsException" + } + return *e.ErrorCodeOverride +} +func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // We can’t process your request right now because of a server issue. Try again // later. type UpdateAccountPreferencesException struct { diff --git a/service/chatbot/types/types.go b/service/chatbot/types/types.go index 6a3dc33c1a0..4f99ff91cbb 100644 --- a/service/chatbot/types/types.go +++ b/service/chatbot/types/types.go @@ -61,6 +61,9 @@ type ChimeWebhookConfiguration struct { // or NONE. LoggingLevel *string + // A list of tags applied to the configuration. + Tags []Tag + noSmithyDocumentSerde } @@ -139,6 +142,9 @@ type SlackChannelConfiguration struct { // Logging levels include ERROR, INFO, or NONE. LoggingLevel *string + // A list of tags applied to the configuration. + Tags []Tag + // Enables use of a user role requirement in your chat configuration. UserAuthorizationRequired *bool @@ -193,6 +199,22 @@ type SlackWorkspace struct { noSmithyDocumentSerde } +// A tag applied to the configuration. +type Tag struct { + + // The tag key. + // + // This member is required. + TagKey *string + + // The tag value. + // + // This member is required. + TagValue *string + + noSmithyDocumentSerde +} + // An AWS Chatbot configuration for Microsoft Teams. type TeamsChannelConfiguration struct { @@ -245,6 +267,9 @@ type TeamsChannelConfiguration struct { // Logging levels include ERROR, INFO, or NONE. LoggingLevel *string + // A list of tags applied to the configuration. + Tags []Tag + // The name of the Microsoft Teams Team. TeamName *string diff --git a/service/chatbot/validators.go b/service/chatbot/validators.go index 99ad2bbcf81..dcdc976c3db 100644 --- a/service/chatbot/validators.go +++ b/service/chatbot/validators.go @@ -5,6 +5,7 @@ package chatbot import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/chatbot/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -229,6 +230,66 @@ func (m *validateOpGetMicrosoftTeamsChannelConfiguration) HandleInitialize(ctx c return next.HandleInitialize(ctx, in) } +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateChimeWebhookConfiguration struct { } @@ -333,6 +394,18 @@ func addOpGetMicrosoftTeamsChannelConfigurationValidationMiddleware(stack *middl return stack.Initialize.Add(&validateOpGetMicrosoftTeamsChannelConfiguration{}, middleware.After) } +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + func addOpUpdateChimeWebhookConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateChimeWebhookConfiguration{}, middleware.After) } @@ -345,6 +418,58 @@ func addOpUpdateSlackChannelConfigurationValidationMiddleware(stack *middleware. return stack.Initialize.Add(&validateOpUpdateSlackChannelConfiguration{}, middleware.After) } +func validateTag(v *types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Tag"} + if v.TagKey == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKey")) + } + if v.TagValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagValue")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTagList(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagList"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTags(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Tags"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateChimeWebhookConfigurationInput(v *CreateChimeWebhookConfigurationInput) error { if v == nil { return nil @@ -365,6 +490,11 @@ func validateOpCreateChimeWebhookConfigurationInput(v *CreateChimeWebhookConfigu if v.ConfigurationName == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationName")) } + if v.Tags != nil { + if err := validateTags(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -392,6 +522,11 @@ func validateOpCreateMicrosoftTeamsChannelConfigurationInput(v *CreateMicrosoftT if v.ConfigurationName == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationName")) } + if v.Tags != nil { + if err := validateTags(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -416,6 +551,11 @@ func validateOpCreateSlackChannelConfigurationInput(v *CreateSlackChannelConfigu if v.ConfigurationName == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationName")) } + if v.Tags != nil { + if err := validateTags(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -552,6 +692,61 @@ func validateOpGetMicrosoftTeamsChannelConfigurationInput(v *GetMicrosoftTeamsCh } } +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARN")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } else if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARN")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateChimeWebhookConfigurationInput(v *UpdateChimeWebhookConfigurationInput) error { if v == nil { return nil diff --git a/service/cloudformation/api_op_DeleteStack.go b/service/cloudformation/api_op_DeleteStack.go index 3be408fb2a7..9599e382455 100644 --- a/service/cloudformation/api_op_DeleteStack.go +++ b/service/cloudformation/api_op_DeleteStack.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -54,6 +55,15 @@ type DeleteStackInput struct { // Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002 . ClientRequestToken *string + // Specifies the deletion mode for the stack. Possible values are: + // + // - STANDARD - Use the standard behavior. Specifying this value is the same as + // not specifying this parameter. + // + // - FORCE_DELETE_STACK - Delete the stack if it's stuck in a DELETE_FAILED state + // due to resource deletion failure. + DeletionMode types.DeletionMode + // For stacks in the DELETE_FAILED state, a list of resource logical IDs that are // associated with the resources you want to retain. During deletion, // CloudFormation deletes the stack but doesn't delete the retained resources. diff --git a/service/cloudformation/api_op_ListStackInstanceResourceDrifts.go b/service/cloudformation/api_op_ListStackInstanceResourceDrifts.go index 61157d1d277..0683b427bac 100644 --- a/service/cloudformation/api_op_ListStackInstanceResourceDrifts.go +++ b/service/cloudformation/api_op_ListStackInstanceResourceDrifts.go @@ -113,8 +113,8 @@ type ListStackInstanceResourceDriftsOutput struct { // previous response object's NextToken parameter is set to null . NextToken *string - // A list of StackInstanceResourceDriftSummary structures that contain information - // about the specified stack instances. + // A list of StackInstanceResourceDriftsSummary structures that contain + // information about the specified stack instances. Summaries []types.StackInstanceResourceDriftsSummary // Metadata pertaining to the operation's result. diff --git a/service/cloudformation/deserializers.go b/service/cloudformation/deserializers.go index 45e861b2b50..b4ad0eb1275 100644 --- a/service/cloudformation/deserializers.go +++ b/service/cloudformation/deserializers.go @@ -15994,6 +15994,19 @@ func awsAwsquery_deserializeDocumentStack(v **types.Stack, decoder smithyxml.Nod sv.CreationTime = ptr.Time(t) } + case strings.EqualFold("DeletionMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DeletionMode = types.DeletionMode(xtv) + } + case strings.EqualFold("DeletionTime", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/cloudformation/serializers.go b/service/cloudformation/serializers.go index 3ce10b9b6ad..06624a918b8 100644 --- a/service/cloudformation/serializers.go +++ b/service/cloudformation/serializers.go @@ -6514,6 +6514,11 @@ func awsAwsquery_serializeOpDocumentDeleteStackInput(v *DeleteStackInput, value objectKey.String(*v.ClientRequestToken) } + if len(v.DeletionMode) > 0 { + objectKey := object.Key("DeletionMode") + objectKey.String(string(v.DeletionMode)) + } + if v.RetainResources != nil { objectKey := object.Key("RetainResources") if err := awsAwsquery_serializeDocumentRetainResources(v.RetainResources, objectKey); err != nil { diff --git a/service/cloudformation/types/enums.go b/service/cloudformation/types/enums.go index 7028309c816..39c94dac326 100644 --- a/service/cloudformation/types/enums.go +++ b/service/cloudformation/types/enums.go @@ -289,6 +289,25 @@ func (ConcurrencyMode) Values() []ConcurrencyMode { } } +type DeletionMode string + +// Enum values for DeletionMode +const ( + DeletionModeStandard DeletionMode = "STANDARD" + DeletionModeForceDeleteStack DeletionMode = "FORCE_DELETE_STACK" +) + +// Values returns all known values for DeletionMode. 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 (DeletionMode) Values() []DeletionMode { + return []DeletionMode{ + "STANDARD", + "FORCE_DELETE_STACK", + } +} + type DeprecatedStatus string // Enum values for DeprecatedStatus diff --git a/service/cloudformation/types/types.go b/service/cloudformation/types/types.go index 706a36bef10..17301eeb91c 100644 --- a/service/cloudformation/types/types.go +++ b/service/cloudformation/types/types.go @@ -1090,6 +1090,15 @@ type Stack struct { // The unique ID of the change set. ChangeSetId *string + // Specifies the deletion mode for the stack. Possible values are: + // + // - STANDARD - Use the standard behavior. Specifying this value is the same as + // not specifying this parameter. + // + // - FORCE_DELETE_STACK - Delete the stack if it's stuck in a DELETE_FAILED state + // due to resource deletion failure. + DeletionMode DeletionMode + // The time the stack was deleted. DeletionTime *time.Time @@ -2276,8 +2285,8 @@ type StackSetOperationPreferences struct { // level to ensure the number of failed accounts never exceeds the value of // FailureToleranceCount +1. The initial actual concurrency is set to the lower // of either the value of the MaxConcurrentCount , or the value of - // MaxConcurrentCount +1. The actual concurrency is then reduced proportionally - // by the number of failures. This is the default behavior. + // FailureToleranceCount +1. The actual concurrency is then reduced + // proportionally by the number of failures. This is the default behavior. // // If failure tolerance or Maximum concurrent accounts are set to percentages, the // behavior is similar. diff --git a/service/kms/api_op_GetParametersForImport.go b/service/kms/api_op_GetParametersForImport.go index 7c356af5bb2..f658e45481c 100644 --- a/service/kms/api_op_GetParametersForImport.go +++ b/service/kms/api_op_GetParametersForImport.go @@ -31,7 +31,8 @@ import ( // GetParametersForImport returns the items that you need to import your key // material. // -// - The public key (or "wrapping key") of an RSA key pair that KMS generates. +// - The public key (or "wrapping key") of an asymmetric key pair that KMS +// generates. // // You will use this public key to encrypt ("wrap") your key material while it's // @@ -121,18 +122,24 @@ type GetParametersForImportInput struct { // This member is required. KeyId *string - // The algorithm you will use with the RSA public key ( PublicKey ) in the response - // to protect your key material during import. For more information, see Select a wrapping algorithmin the - // Key Management Service Developer Guide. + // The algorithm you will use with the asymmetric public key ( PublicKey ) in the + // response to protect your key material during import. For more information, see Select a wrapping algorithm + // in the Key Management Service Developer Guide. // // For RSA_AES wrapping algorithms, you encrypt your key material with an AES key // that you generate, then encrypt your AES key with the RSA public key from KMS. // For RSAES wrapping algorithms, you encrypt your key material directly with the - // RSA public key from KMS. + // RSA public key from KMS. For SM2PKE wrapping algorithms, you encrypt your key + // material directly with the SM2 public key from KMS. // // The wrapping algorithms that you can use depend on the type of key material // that you are importing. To import an RSA private key, you must use an RSA_AES - // wrapping algorithm. + // wrapping algorithm, except in China Regions, where you must use the SM2PKE + // wrapping algorithm to import an RSA private key. + // + // The SM2PKE wrapping algorithm is available only in China Regions. The + // RSA_AES_KEY_WRAP_SHA_256 and RSA_AES_KEY_WRAP_SHA_1 wrapping algorithms are not + // supported in China Regions. // // - RSA_AES_KEY_WRAP_SHA_256 — Supported for wrapping RSA and ECC key material. // @@ -153,19 +160,24 @@ type GetParametersForImportInput struct { // - RSAES_PKCS1_V1_5 (Deprecated) — As of October 10, 2023, KMS does not // support the RSAES_PKCS1_V1_5 wrapping algorithm. // + // - SM2PKE (China Regions only) — supported for wrapping RSA, ECC, and SM2 key + // material. + // // This member is required. WrappingAlgorithm types.AlgorithmSpec - // The type of RSA public key to return in the response. You will use this - // wrapping key with the specified wrapping algorithm to protect your key material - // during import. + // The type of public key to return in the response. You will use this wrapping + // key with the specified wrapping algorithm to protect your key material during + // import. // - // Use the longest RSA wrapping key that is practical. + // Use the longest wrapping key that is practical. // // You cannot use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private // key. Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public // key. // + // The SM2 wrapping key spec is available only in China Regions. + // // This member is required. WrappingKeySpec types.WrappingKeySpec diff --git a/service/kms/types/enums.go b/service/kms/types/enums.go index b33c20f9b75..f7882c6bc4b 100644 --- a/service/kms/types/enums.go +++ b/service/kms/types/enums.go @@ -11,6 +11,7 @@ const ( AlgorithmSpecRsaesOaepSha256 AlgorithmSpec = "RSAES_OAEP_SHA_256" AlgorithmSpecRsaAesKeyWrapSha1 AlgorithmSpec = "RSA_AES_KEY_WRAP_SHA_1" AlgorithmSpecRsaAesKeyWrapSha256 AlgorithmSpec = "RSA_AES_KEY_WRAP_SHA_256" + AlgorithmSpecSm2pke AlgorithmSpec = "SM2PKE" ) // Values returns all known values for AlgorithmSpec. Note that this can be @@ -24,6 +25,7 @@ func (AlgorithmSpec) Values() []AlgorithmSpec { "RSAES_OAEP_SHA_256", "RSA_AES_KEY_WRAP_SHA_1", "RSA_AES_KEY_WRAP_SHA_256", + "SM2PKE", } } @@ -576,6 +578,7 @@ const ( WrappingKeySpecRsa2048 WrappingKeySpec = "RSA_2048" WrappingKeySpecRsa3072 WrappingKeySpec = "RSA_3072" WrappingKeySpecRsa4096 WrappingKeySpec = "RSA_4096" + WrappingKeySpecSm2 WrappingKeySpec = "SM2" ) // Values returns all known values for WrappingKeySpec. Note that this can be @@ -587,6 +590,7 @@ func (WrappingKeySpec) Values() []WrappingKeySpec { "RSA_2048", "RSA_3072", "RSA_4096", + "SM2", } } diff --git a/service/opensearch/api_op_GetDataSource.go b/service/opensearch/api_op_GetDataSource.go index 3712d915563..b6668679091 100644 --- a/service/opensearch/api_op_GetDataSource.go +++ b/service/opensearch/api_op_GetDataSource.go @@ -55,6 +55,9 @@ type GetDataSourceOutput struct { // The name of the data source. Name *string + // The status of the data source response. + Status types.DataSourceStatus + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/opensearch/api_op_UpdateDataSource.go b/service/opensearch/api_op_UpdateDataSource.go index 3fa59a97a2f..8fd69e43abb 100644 --- a/service/opensearch/api_op_UpdateDataSource.go +++ b/service/opensearch/api_op_UpdateDataSource.go @@ -50,6 +50,9 @@ type UpdateDataSourceInput struct { // A new description of the data source. Description *string + // The status of the data source update request. + Status types.DataSourceStatus + noSmithyDocumentSerde } diff --git a/service/opensearch/deserializers.go b/service/opensearch/deserializers.go index 4e7f4806eb7..8c85a567d46 100644 --- a/service/opensearch/deserializers.go +++ b/service/opensearch/deserializers.go @@ -5739,6 +5739,15 @@ func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutp sv.Name = ptr.String(jtv) } + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) + } + sv.Status = types.DataSourceStatus(jtv) + } + default: _, _ = key, value @@ -12969,6 +12978,15 @@ func awsRestjson1_deserializeDocumentDataSourceDetails(v **types.DataSourceDetai sv.Name = ptr.String(jtv) } + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) + } + sv.Status = types.DataSourceStatus(jtv) + } + default: _, _ = key, value diff --git a/service/opensearch/serializers.go b/service/opensearch/serializers.go index 9c668a90977..2081951d2c4 100644 --- a/service/opensearch/serializers.go +++ b/service/opensearch/serializers.go @@ -4504,6 +4504,11 @@ func awsRestjson1_serializeOpDocumentUpdateDataSourceInput(v *UpdateDataSourceIn ok.String(*v.Description) } + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + return nil } diff --git a/service/opensearch/types/enums.go b/service/opensearch/types/enums.go index 506af0d01bc..7e93821cbfa 100644 --- a/service/opensearch/types/enums.go +++ b/service/opensearch/types/enums.go @@ -190,6 +190,25 @@ func (ConnectionMode) Values() []ConnectionMode { } } +type DataSourceStatus string + +// Enum values for DataSourceStatus +const ( + DataSourceStatusActive DataSourceStatus = "ACTIVE" + DataSourceStatusDisabled DataSourceStatus = "DISABLED" +) + +// Values returns all known values for DataSourceStatus. 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 (DataSourceStatus) Values() []DataSourceStatus { + return []DataSourceStatus{ + "ACTIVE", + "DISABLED", + } +} + type DeploymentStatus string // Enum values for DeploymentStatus diff --git a/service/opensearch/types/types.go b/service/opensearch/types/types.go index 84b61602534..17e44c35f45 100644 --- a/service/opensearch/types/types.go +++ b/service/opensearch/types/types.go @@ -660,6 +660,9 @@ type DataSourceDetails struct { // The name of the data source. Name *string + // The status of the data source. + Status DataSourceStatus + noSmithyDocumentSerde } @@ -994,7 +997,7 @@ type DomainStatus struct { // for all traffic. DomainEndpointOptions *DomainEndpointOptions - // The DualStack Hosted Zone Id for the domain. + // The dual stack hosted zone ID for the domain. DomainEndpointV2HostedZoneId *string // The status of any changes that are currently in progress for the domain. diff --git a/service/s3control/internal/endpoints/endpoints.go b/service/s3control/internal/endpoints/endpoints.go index 54452799f00..f2b8bb1b992 100644 --- a/service/s3control/internal/endpoints/endpoints.go +++ b/service/s3control/internal/endpoints/endpoints.go @@ -397,6 +397,55 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{ + Hostname: "s3-control.ca-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "s3-control-fips.ca-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "s3-control-fips.dualstack.ca-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "s3-control.dualstack.ca-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "ca-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "s3-control-fips.ca-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{ diff --git a/service/wafv2/api_op_DeleteLoggingConfiguration.go b/service/wafv2/api_op_DeleteLoggingConfiguration.go index 1efcb2af861..315b5156827 100644 --- a/service/wafv2/api_op_DeleteLoggingConfiguration.go +++ b/service/wafv2/api_op_DeleteLoggingConfiguration.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/wafv2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -34,6 +35,25 @@ type DeleteLoggingConfigurationInput struct { // This member is required. ResourceArn *string + // The owner of the logging configuration, which must be set to CUSTOMER for the + // configurations that you manage. + // + // The log scope SECURITY_LAKE indicates a configuration that is managed through + // Amazon Security Lake. You can use Security Lake to collect log and event data + // from various sources for normalization, analysis, and management. For + // information, see [Collecting data from Amazon Web Services services]in the Amazon Security Lake user guide. + // + // Default: CUSTOMER + // + // [Collecting data from Amazon Web Services services]: https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html + LogScope types.LogScope + + // Used to distinguish between various logging options. Currently, there is one + // option. + // + // Default: WAF_LOGS + LogType types.LogType + noSmithyDocumentSerde } diff --git a/service/wafv2/api_op_GetLoggingConfiguration.go b/service/wafv2/api_op_GetLoggingConfiguration.go index a883aca9122..49dd092fc08 100644 --- a/service/wafv2/api_op_GetLoggingConfiguration.go +++ b/service/wafv2/api_op_GetLoggingConfiguration.go @@ -34,6 +34,25 @@ type GetLoggingConfigurationInput struct { // This member is required. ResourceArn *string + // The owner of the logging configuration, which must be set to CUSTOMER for the + // configurations that you manage. + // + // The log scope SECURITY_LAKE indicates a configuration that is managed through + // Amazon Security Lake. You can use Security Lake to collect log and event data + // from various sources for normalization, analysis, and management. For + // information, see [Collecting data from Amazon Web Services services]in the Amazon Security Lake user guide. + // + // Default: CUSTOMER + // + // [Collecting data from Amazon Web Services services]: https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html + LogScope types.LogScope + + // Used to distinguish between various logging options. Currently, there is one + // option. + // + // Default: WAF_LOGS + LogType types.LogType + noSmithyDocumentSerde } diff --git a/service/wafv2/api_op_ListLoggingConfigurations.go b/service/wafv2/api_op_ListLoggingConfigurations.go index dedb0662044..978ad7e91cf 100644 --- a/service/wafv2/api_op_ListLoggingConfigurations.go +++ b/service/wafv2/api_op_ListLoggingConfigurations.go @@ -51,6 +51,19 @@ type ListLoggingConfigurationsInput struct { // that you can use in a subsequent call to get the next batch of objects. Limit *int32 + // The owner of the logging configuration, which must be set to CUSTOMER for the + // configurations that you manage. + // + // The log scope SECURITY_LAKE indicates a configuration that is managed through + // Amazon Security Lake. You can use Security Lake to collect log and event data + // from various sources for normalization, analysis, and management. For + // information, see [Collecting data from Amazon Web Services services]in the Amazon Security Lake user guide. + // + // Default: CUSTOMER + // + // [Collecting data from Amazon Web Services services]: https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html + LogScope types.LogScope + // When you request a list of objects with a Limit setting, if the number of // objects that are still available for retrieval exceeds the limit, WAF returns a // NextMarker value in the response. To retrieve the next batch of objects, provide diff --git a/service/wafv2/deserializers.go b/service/wafv2/deserializers.go index 203f43e299d..aa7f369d134 100644 --- a/service/wafv2/deserializers.go +++ b/service/wafv2/deserializers.go @@ -10467,6 +10467,24 @@ func awsAwsjson11_deserializeDocumentLoggingConfiguration(v **types.LoggingConfi return err } + case "LogScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogScope to be of type string, got %T instead", value) + } + sv.LogScope = types.LogScope(jtv) + } + + case "LogType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogType to be of type string, got %T instead", value) + } + sv.LogType = types.LogType(jtv) + } + case "ManagedByFirewallManager": if value != nil { jtv, ok := value.(bool) diff --git a/service/wafv2/serializers.go b/service/wafv2/serializers.go index eb2fb59d2ef..7fed6a0bd0f 100644 --- a/service/wafv2/serializers.go +++ b/service/wafv2/serializers.go @@ -4026,6 +4026,16 @@ func awsAwsjson11_serializeDocumentLoggingConfiguration(v *types.LoggingConfigur } } + if len(v.LogScope) > 0 { + ok := object.Key("LogScope") + ok.String(string(v.LogScope)) + } + + if len(v.LogType) > 0 { + ok := object.Key("LogType") + ok.String(string(v.LogType)) + } + if v.ManagedByFirewallManager { ok := object.Key("ManagedByFirewallManager") ok.Boolean(v.ManagedByFirewallManager) @@ -5851,6 +5861,16 @@ func awsAwsjson11_serializeOpDocumentDeleteLoggingConfigurationInput(v *DeleteLo object := value.Object() defer object.Close() + if len(v.LogScope) > 0 { + ok := object.Key("LogScope") + ok.String(string(v.LogScope)) + } + + if len(v.LogType) > 0 { + ok := object.Key("LogType") + ok.String(string(v.LogType)) + } + if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) @@ -6080,6 +6100,16 @@ func awsAwsjson11_serializeOpDocumentGetLoggingConfigurationInput(v *GetLoggingC object := value.Object() defer object.Close() + if len(v.LogScope) > 0 { + ok := object.Key("LogScope") + ok.String(string(v.LogScope)) + } + + if len(v.LogType) > 0 { + ok := object.Key("LogType") + ok.String(string(v.LogType)) + } + if v.ResourceArn != nil { ok := object.Key("ResourceArn") ok.String(*v.ResourceArn) @@ -6395,6 +6425,11 @@ func awsAwsjson11_serializeOpDocumentListLoggingConfigurationsInput(v *ListLoggi ok.Integer(*v.Limit) } + if len(v.LogScope) > 0 { + ok := object.Key("LogScope") + ok.String(string(v.LogScope)) + } + if v.NextMarker != nil { ok := object.Key("NextMarker") ok.String(*v.NextMarker) diff --git a/service/wafv2/types/enums.go b/service/wafv2/types/enums.go index c74f5c8f67a..f2ea832217f 100644 --- a/service/wafv2/types/enums.go +++ b/service/wafv2/types/enums.go @@ -796,6 +796,42 @@ func (LabelMatchScope) Values() []LabelMatchScope { } } +type LogScope string + +// Enum values for LogScope +const ( + LogScopeCustomer LogScope = "CUSTOMER" + LogScopeSecurityLake LogScope = "SECURITY_LAKE" +) + +// Values returns all known values for LogScope. 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 (LogScope) Values() []LogScope { + return []LogScope{ + "CUSTOMER", + "SECURITY_LAKE", + } +} + +type LogType string + +// Enum values for LogType +const ( + LogTypeWafLogs LogType = "WAF_LOGS" +) + +// Values returns all known values for LogType. 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 (LogType) Values() []LogType { + return []LogType{ + "WAF_LOGS", + } +} + type MapMatchScope string // Enum values for MapMatchScope diff --git a/service/wafv2/types/types.go b/service/wafv2/types/types.go index 54ed7aa9d3d..3304b8690d1 100644 --- a/service/wafv2/types/types.go +++ b/service/wafv2/types/types.go @@ -433,7 +433,8 @@ type ByteMatchStatement struct { // - UriPath : The value that you want WAF to search for in the URI path, for // example, /images/daily-ad.jpg . // - // - JA3Fingerprint : Match against the request's JA3 fingerprint. The JA3 + // - JA3Fingerprint : Available for use with Amazon CloudFront distributions and + // Application Load Balancers. Match against the request's JA3 fingerprint. The JA3 // fingerprint is a 32-character hash derived from the TLS Client Hello of an // incoming request. This fingerprint serves as a unique identifier for the // client's TLS configuration. You can use this choice only with a string match @@ -951,6 +952,10 @@ type ExcludedRule struct { // - In this documentation, the descriptions of the individual fields talk about // specifying the web request component to inspect, but for field redaction, you // are specifying the component type to redact from the logs. +// +// - If you have request sampling enabled, the redacted fields configuration for +// logging has no impact on sampling. The only way to exclude fields from request +// sampling is by disabling sampling in the web ACL visibility configuration. type FieldToMatch struct { // Inspect all query arguments. @@ -1007,7 +1012,8 @@ type FieldToMatch struct { // the underlying host service. Headers *Headers - // Match against the request's JA3 fingerprint. The JA3 fingerprint is a + // Available for use with Amazon CloudFront distributions and Application Load + // Balancers. Match against the request's JA3 fingerprint. The JA3 fingerprint is a // 32-character hash derived from the TLS Client Hello of an incoming request. This // fingerprint serves as a unique identifier for the client's TLS configuration. // WAF calculates and logs this fingerprint for each request that has enough TLS @@ -1642,7 +1648,8 @@ type IPSetSummary struct { noSmithyDocumentSerde } -// Match against the request's JA3 fingerprint. The JA3 fingerprint is a +// Available for use with Amazon CloudFront distributions and Application Load +// Balancers. Match against the request's JA3 fingerprint. The JA3 fingerprint is a // 32-character hash derived from the TLS Client Hello of an incoming request. This // fingerprint serves as a unique identifier for the client's TLS configuration. // WAF calculates and logs this fingerprint for each request that has enough TLS @@ -1933,6 +1940,25 @@ type LoggingConfiguration struct { // This member is required. ResourceArn *string + // The owner of the logging configuration, which must be set to CUSTOMER for the + // configurations that you manage. + // + // The log scope SECURITY_LAKE indicates a configuration that is managed through + // Amazon Security Lake. You can use Security Lake to collect log and event data + // from various sources for normalization, analysis, and management. For + // information, see [Collecting data from Amazon Web Services services]in the Amazon Security Lake user guide. + // + // Default: CUSTOMER + // + // [Collecting data from Amazon Web Services services]: https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html + LogScope LogScope + + // Used to distinguish between various logging options. Currently, there is one + // option. + // + // Default: WAF_LOGS + LogType LogType + // Filtering that specifies which web requests are kept in the logs and which are // dropped. You can filter on the rule action and on the web request labels that // were applied by matching rules during web ACL evaluation. @@ -1954,6 +1980,10 @@ type LoggingConfiguration struct { // // You can specify only the following fields for redaction: UriPath , QueryString , // SingleHeader , and Method . + // + // This setting has no impact on request sampling. With request sampling, the only + // way to exclude fields is by disabling sampling in the web ACL visibility + // configuration. RedactedFields []FieldToMatch noSmithyDocumentSerde @@ -4598,6 +4628,11 @@ type VisibilityConfig struct { // Indicates whether WAF should store a sampling of the web requests that match // the rules. You can view the sampled requests through the WAF console. // + // Request sampling doesn't provide a field redaction option, and any field + // redaction that you specify in your logging configuration doesn't affect + // sampling. The only way to exclude fields from request sampling is by disabling + // sampling in the web ACL visibility configuration. + // // This member is required. SampledRequestsEnabled bool