From 36b4e92c7b0b3a63dad7fc1529fc55612459c061 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Tue, 7 May 2024 18:17:11 +0000 Subject: [PATCH] Regenerated Clients --- .../41575353444b40ffbf474f4155544f00.json | 8 + .../b0a8764f5db04d4288a0b6d10378165d.json | 8 + .../b295faf0af28405ba4e2786e903dbf34.json | 8 + .../bef6872e330d493d9bb8df6ef6ad3c66.json | 8 + .../eb6bc1fbb0054de782878bf4b14edb83.json | 8 + service/b2bi/api_op_CreateTransformer.go | 8 +- service/b2bi/api_op_GetTransformer.go | 4 +- service/b2bi/api_op_TestMapping.go | 4 +- service/b2bi/api_op_UpdateTransformer.go | 8 +- service/b2bi/types/types.go | 4 +- service/budgets/api_op_CreateBudget.go | 4 + service/budgets/api_op_CreateBudgetAction.go | 4 + service/budgets/api_op_ListTagsForResource.go | 136 ++++ service/budgets/api_op_TagResource.go | 137 ++++ service/budgets/api_op_UntagResource.go | 136 ++++ service/budgets/deserializers.go | 682 +++++++++++++++++- service/budgets/endpoints.go | 2 +- service/budgets/generated.json | 3 + service/budgets/serializers.go | 270 +++++++ service/budgets/snapshot_test.go | 72 ++ service/budgets/types/errors.go | 27 + service/budgets/types/types.go | 22 +- service/budgets/validators.go | 172 +++++ .../api_op_ListAppAssessmentResourceDrifts.go | 248 +++++++ .../api_op_ListRecommendationTemplates.go | 5 - service/resiliencehub/deserializers.go | 316 ++++++++ service/resiliencehub/generated.json | 1 + service/resiliencehub/serializers.go | 85 +++ service/resiliencehub/snapshot_test.go | 24 + service/resiliencehub/types/enums.go | 8 +- service/resiliencehub/types/types.go | 99 ++- service/resiliencehub/validators.go | 78 +- .../api_op_AssociateProfile.go | 6 +- .../api_op_AssociateResourceToProfile.go | 6 +- ...api_op_UpdateProfileResourceAssociation.go | 6 +- 35 files changed, 2486 insertions(+), 131 deletions(-) create mode 100644 .changelog/41575353444b40ffbf474f4155544f00.json create mode 100644 .changelog/b0a8764f5db04d4288a0b6d10378165d.json create mode 100644 .changelog/b295faf0af28405ba4e2786e903dbf34.json create mode 100644 .changelog/bef6872e330d493d9bb8df6ef6ad3c66.json create mode 100644 .changelog/eb6bc1fbb0054de782878bf4b14edb83.json create mode 100644 service/budgets/api_op_ListTagsForResource.go create mode 100644 service/budgets/api_op_TagResource.go create mode 100644 service/budgets/api_op_UntagResource.go create mode 100644 service/resiliencehub/api_op_ListAppAssessmentResourceDrifts.go diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..1cc0d8d6b2d --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,8 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "internal/protocoltest/smithyrpcv2cbor" + ] +} \ No newline at end of file diff --git a/.changelog/b0a8764f5db04d4288a0b6d10378165d.json b/.changelog/b0a8764f5db04d4288a0b6d10378165d.json new file mode 100644 index 00000000000..2e1d0489b7d --- /dev/null +++ b/.changelog/b0a8764f5db04d4288a0b6d10378165d.json @@ -0,0 +1,8 @@ +{ + "id": "b0a8764f-5db0-4d42-88a0-b6d10378165d", + "type": "feature", + "description": "This release adds tag support for budgets and budget actions.", + "modules": [ + "service/budgets" + ] +} \ No newline at end of file diff --git a/.changelog/b295faf0af28405ba4e2786e903dbf34.json b/.changelog/b295faf0af28405ba4e2786e903dbf34.json new file mode 100644 index 00000000000..dae992a2109 --- /dev/null +++ b/.changelog/b295faf0af28405ba4e2786e903dbf34.json @@ -0,0 +1,8 @@ +{ + "id": "b295faf0-af28-405b-a4e2-786e903dbf34", + "type": "feature", + "description": "AWS Resilience Hub has expanded its drift detection capabilities by introducing a new type of drift detection - application resource drift. This new enhancement detects changes, such as the addition or deletion of resources within the application's input sources.", + "modules": [ + "service/resiliencehub" + ] +} \ No newline at end of file diff --git a/.changelog/bef6872e330d493d9bb8df6ef6ad3c66.json b/.changelog/bef6872e330d493d9bb8df6ef6ad3c66.json new file mode 100644 index 00000000000..3e02a2f5b40 --- /dev/null +++ b/.changelog/bef6872e330d493d9bb8df6ef6ad3c66.json @@ -0,0 +1,8 @@ +{ + "id": "bef6872e-330d-493d-9bb8-df6ef6ad3c66", + "type": "documentation", + "description": "Documentation update to clarify the MappingTemplate definition.", + "modules": [ + "service/b2bi" + ] +} \ No newline at end of file diff --git a/.changelog/eb6bc1fbb0054de782878bf4b14edb83.json b/.changelog/eb6bc1fbb0054de782878bf4b14edb83.json new file mode 100644 index 00000000000..3faaf020669 --- /dev/null +++ b/.changelog/eb6bc1fbb0054de782878bf4b14edb83.json @@ -0,0 +1,8 @@ +{ + "id": "eb6bc1fb-b005-4de7-8287-8bf4b14edb83", + "type": "documentation", + "description": "Doc only update for Route 53 profiles that fixes some link issues", + "modules": [ + "service/route53profiles" + ] +} \ No newline at end of file diff --git a/service/b2bi/api_op_CreateTransformer.go b/service/b2bi/api_op_CreateTransformer.go index 889108fa750..7b063780a0a 100644 --- a/service/b2bi/api_op_CreateTransformer.go +++ b/service/b2bi/api_op_CreateTransformer.go @@ -44,8 +44,8 @@ type CreateTransformerInput struct { // This member is required. FileFormat types.FileFormat - // Specifies the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. + // Specifies the mapping template for the transformer. This template is used to + // map the parsed EDI file using JSONata or XSLT. // // This member is required. MappingTemplate *string @@ -90,8 +90,8 @@ type CreateTransformerOutput struct { // This member is required. FileFormat types.FileFormat - // Returns the name of the mapping template for the transformer. This template is - // used to convert the input document into the correct set of objects. + // Returns the mapping template for the transformer. This template is used to map + // the parsed EDI file using JSONata or XSLT. // // This member is required. MappingTemplate *string diff --git a/service/b2bi/api_op_GetTransformer.go b/service/b2bi/api_op_GetTransformer.go index bb70d0a29de..c1af11a9c57 100644 --- a/service/b2bi/api_op_GetTransformer.go +++ b/service/b2bi/api_op_GetTransformer.go @@ -60,8 +60,8 @@ type GetTransformerOutput struct { // This member is required. FileFormat types.FileFormat - // Returns the name of the mapping template for the transformer. This template is - // used to convert the input document into the correct set of objects. + // Returns the mapping template for the transformer. This template is used to map + // the parsed EDI file using JSONata or XSLT. // // This member is required. MappingTemplate *string diff --git a/service/b2bi/api_op_TestMapping.go b/service/b2bi/api_op_TestMapping.go index c2924679c3e..24d80041036 100644 --- a/service/b2bi/api_op_TestMapping.go +++ b/service/b2bi/api_op_TestMapping.go @@ -43,8 +43,8 @@ type TestMappingInput struct { // This member is required. InputFileContent *string - // Specifies the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. + // Specifies the mapping template for the transformer. This template is used to + // map the parsed EDI file using JSONata or XSLT. // // This member is required. MappingTemplate *string diff --git a/service/b2bi/api_op_UpdateTransformer.go b/service/b2bi/api_op_UpdateTransformer.go index 160b2a699c0..00294df1c47 100644 --- a/service/b2bi/api_op_UpdateTransformer.go +++ b/service/b2bi/api_op_UpdateTransformer.go @@ -46,8 +46,8 @@ type UpdateTransformerInput struct { // JSON and XML . FileFormat types.FileFormat - // Specifies the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. + // Specifies the mapping template for the transformer. This template is used to + // map the parsed EDI file using JSONata or XSLT. MappingTemplate *string // Specify a new name for the transformer, if you want to update it. @@ -84,8 +84,8 @@ type UpdateTransformerOutput struct { // This member is required. FileFormat types.FileFormat - // Returns the name of the mapping template for the transformer. This template is - // used to convert the input document into the correct set of objects. + // Returns the mapping template for the transformer. This template is used to map + // the parsed EDI file using JSONata or XSLT. // // This member is required. MappingTemplate *string diff --git a/service/b2bi/types/types.go b/service/b2bi/types/types.go index 40f4deb93c4..069ade1b4ea 100644 --- a/service/b2bi/types/types.go +++ b/service/b2bi/types/types.go @@ -242,8 +242,8 @@ type TransformerSummary struct { // This member is required. FileFormat FileFormat - // Returns the name of the mapping template for the transformer. This template is - // used to convert the input document into the correct set of objects. + // Returns the mapping template for the transformer. This template is used to map + // the parsed EDI file using JSONata or XSLT. // // This member is required. MappingTemplate *string diff --git a/service/budgets/api_op_CreateBudget.go b/service/budgets/api_op_CreateBudget.go index 089cc724adb..6b112f1bff6 100644 --- a/service/budgets/api_op_CreateBudget.go +++ b/service/budgets/api_op_CreateBudget.go @@ -51,6 +51,10 @@ type CreateBudgetInput struct { // for you. NotificationsWithSubscribers []types.NotificationWithSubscribers + // An optional list of tags to associate with the specified budget. Each tag + // consists of a key and a value, and each key must be unique for the resource. + ResourceTags []types.ResourceTag + noSmithyDocumentSerde } diff --git a/service/budgets/api_op_CreateBudgetAction.go b/service/budgets/api_op_CreateBudgetAction.go index dc55b0e93bc..0d2107393f9 100644 --- a/service/budgets/api_op_CreateBudgetAction.go +++ b/service/budgets/api_op_CreateBudgetAction.go @@ -77,6 +77,10 @@ type CreateBudgetActionInput struct { // This member is required. Subscribers []types.Subscriber + // An optional list of tags to associate with the specified budget action. Each + // tag consists of a key and a value, and each key must be unique for the resource. + ResourceTags []types.ResourceTag + noSmithyDocumentSerde } diff --git a/service/budgets/api_op_ListTagsForResource.go b/service/budgets/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..29d7a383dd5 --- /dev/null +++ b/service/budgets/api_op_ListTagsForResource.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package budgets + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/budgets/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists tags associated with a budget or budget action resource. +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 unique identifier for the resource. + // + // This member is required. + ResourceARN *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The tags associated with the resource. + ResourceTags []types.ResourceTag + + // 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(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_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/budgets/api_op_TagResource.go b/service/budgets/api_op_TagResource.go new file mode 100644 index 00000000000..f855cc88304 --- /dev/null +++ b/service/budgets/api_op_TagResource.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package budgets + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/budgets/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates tags for a budget or budget action resource. +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 unique identifier for the resource. + // + // This member is required. + ResourceARN *string + + // The tags associated with the resource. + // + // This member is required. + ResourceTags []types.ResourceTag + + 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(&awsAwsjson11_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_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/budgets/api_op_UntagResource.go b/service/budgets/api_op_UntagResource.go new file mode 100644 index 00000000000..cac1c083449 --- /dev/null +++ b/service/budgets/api_op_UntagResource.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package budgets + +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" +) + +// Deletes tags associated with a budget or budget action resource. +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 unique identifier for the resource. + // + // This member is required. + ResourceARN *string + + // The key that's associated with the tag. + // + // This member is required. + ResourceTagKeys []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(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_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/budgets/deserializers.go b/service/budgets/deserializers.go index 658ef2c3208..8cfda5b462f 100644 --- a/service/budgets/deserializers.go +++ b/service/budgets/deserializers.go @@ -129,6 +129,9 @@ func awsAwsjson11_deserializeOpErrorCreateBudget(response *smithyhttp.Response, case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) @@ -254,6 +257,9 @@ func awsAwsjson11_deserializeOpErrorCreateBudgetAction(response *smithyhttp.Resp case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) @@ -2029,7 +2035,379 @@ func (m *awsAwsjson11_deserializeOpDescribeNotificationsForBudget) HandleDeseria return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeNotificationsForBudget(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeNotificationsForBudget(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ExpiredNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorExpiredNextTokenException(response, errorBody) + + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDescribeSubscribersForNotification struct { +} + +func (*awsAwsjson11_deserializeOpDescribeSubscribersForNotification) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeSubscribersForNotification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeSubscribersForNotification(response, &metadata) + } + output := &DescribeSubscribersForNotificationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDescribeSubscribersForNotificationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDescribeSubscribersForNotification(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ExpiredNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorExpiredNextTokenException(response, errorBody) + + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpExecuteBudgetAction struct { +} + +func (*awsAwsjson11_deserializeOpExecuteBudgetAction) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpExecuteBudgetAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorExecuteBudgetAction(response, &metadata) + } + output := &ExecuteBudgetActionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentExecuteBudgetActionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorExecuteBudgetAction(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceLockedException", errorCode): + return awsAwsjson11_deserializeErrorResourceLockedException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_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, awsAwsjson11_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 = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_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)} @@ -2069,15 +2447,9 @@ func awsAwsjson11_deserializeOpErrorDescribeNotificationsForBudget(response *smi case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ExpiredNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorExpiredNextTokenException(response, errorBody) - case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2097,14 +2469,14 @@ func awsAwsjson11_deserializeOpErrorDescribeNotificationsForBudget(response *smi } } -type awsAwsjson11_deserializeOpDescribeSubscribersForNotification struct { +type awsAwsjson11_deserializeOpTagResource struct { } -func (*awsAwsjson11_deserializeOpDescribeSubscribersForNotification) ID() string { +func (*awsAwsjson11_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeSubscribersForNotification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_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) @@ -2118,9 +2490,9 @@ func (m *awsAwsjson11_deserializeOpDescribeSubscribersForNotification) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeSubscribersForNotification(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) } - output := &DescribeSubscribersForNotificationOutput{} + output := &TagResourceOutput{} out.Result = output var buff [1024]byte @@ -2140,7 +2512,7 @@ func (m *awsAwsjson11_deserializeOpDescribeSubscribersForNotification) HandleDes return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeSubscribersForNotificationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2154,7 +2526,7 @@ func (m *awsAwsjson11_deserializeOpDescribeSubscribersForNotification) HandleDes return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeSubscribersForNotification(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_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)} @@ -2194,21 +2566,18 @@ func awsAwsjson11_deserializeOpErrorDescribeSubscribersForNotification(response case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ExpiredNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorExpiredNextTokenException(response, errorBody) - case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) @@ -2222,14 +2591,14 @@ func awsAwsjson11_deserializeOpErrorDescribeSubscribersForNotification(response } } -type awsAwsjson11_deserializeOpExecuteBudgetAction struct { +type awsAwsjson11_deserializeOpUntagResource struct { } -func (*awsAwsjson11_deserializeOpExecuteBudgetAction) ID() string { +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpExecuteBudgetAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_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) @@ -2243,9 +2612,9 @@ func (m *awsAwsjson11_deserializeOpExecuteBudgetAction) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorExecuteBudgetAction(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) } - output := &ExecuteBudgetActionOutput{} + output := &UntagResourceOutput{} out.Result = output var buff [1024]byte @@ -2265,7 +2634,7 @@ func (m *awsAwsjson11_deserializeOpExecuteBudgetAction) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentExecuteBudgetActionOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2279,7 +2648,7 @@ func (m *awsAwsjson11_deserializeOpExecuteBudgetAction) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorExecuteBudgetAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_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)} @@ -2328,9 +2697,6 @@ func awsAwsjson11_deserializeOpErrorExecuteBudgetAction(response *smithyhttp.Res case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("ResourceLockedException", errorCode): - return awsAwsjson11_deserializeErrorResourceLockedException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) @@ -3144,6 +3510,41 @@ func awsAwsjson11_deserializeErrorResourceLockedException(response *smithyhttp.R return output } +func awsAwsjson11_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceQuotaExceededException{} + err := awsAwsjson11_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4982,6 +5383,89 @@ func awsAwsjson11_deserializeDocumentResourceLockedException(v **types.ResourceL return nil } +func awsAwsjson11_deserializeDocumentResourceTag(v **types.ResourceTag, 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.ResourceTag + if *v == nil { + sv = &types.ResourceTag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceTagKey to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceTagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceTagList(v *[]types.ResourceTag, 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.ResourceTag + if *v == nil { + cv = []types.ResourceTag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceTag + destAddr := &col + if err := awsAwsjson11_deserializeDocumentResourceTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentRoles(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5063,6 +5547,46 @@ func awsAwsjson11_deserializeDocumentScpActionDefinition(v **types.ScpActionDefi return nil } +func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentSpend(v **types.Spend, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6239,6 +6763,104 @@ func awsAwsjson11_deserializeOpDocumentExecuteBudgetActionOutput(v **ExecuteBudg return nil } +func awsAwsjson11_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 "ResourceTags": + if err := awsAwsjson11_deserializeDocumentResourceTagList(&sv.ResourceTags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, 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 *TagResourceOutput + if *v == nil { + sv = &TagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, 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 *UntagResourceOutput + if *v == nil { + sv = &UntagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateBudgetActionOutput(v **UpdateBudgetActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/budgets/endpoints.go b/service/budgets/endpoints.go index 5131a7142e3..0a981424c3f 100644 --- a/service/budgets/endpoints.go +++ b/service/budgets/endpoints.go @@ -442,7 +442,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://budgets-fips.") diff --git a/service/budgets/generated.json b/service/budgets/generated.json index d3a262ed196..d7338326e16 100644 --- a/service/budgets/generated.json +++ b/service/budgets/generated.json @@ -27,6 +27,9 @@ "api_op_DescribeNotificationsForBudget.go", "api_op_DescribeSubscribersForNotification.go", "api_op_ExecuteBudgetAction.go", + "api_op_ListTagsForResource.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", "api_op_UpdateBudget.go", "api_op_UpdateBudgetAction.go", "api_op_UpdateNotification.go", diff --git a/service/budgets/serializers.go b/service/budgets/serializers.go index 302bf7707ad..be762a5f792 100644 --- a/service/budgets/serializers.go +++ b/service/budgets/serializers.go @@ -1062,6 +1062,171 @@ func (m *awsAwsjson11_serializeOpExecuteBudgetAction) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_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)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSBudgetServiceGateway.ListTagsForResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpTagResource struct { +} + +func (*awsAwsjson11_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_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)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSBudgetServiceGateway.TagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUntagResource struct { +} + +func (*awsAwsjson11_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_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)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSBudgetServiceGateway.UntagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpUpdateBudget struct { } @@ -1714,6 +1879,47 @@ func awsAwsjson11_serializeDocumentPlannedBudgetLimits(v map[string]types.Spend, return nil } +func awsAwsjson11_serializeDocumentResourceTag(v *types.ResourceTag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentResourceTagKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentResourceTagList(v []types.ResourceTag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentResourceTag(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentRoles(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1902,6 +2108,13 @@ func awsAwsjson11_serializeOpDocumentCreateBudgetActionInput(v *CreateBudgetActi ok.String(string(v.NotificationType)) } + if v.ResourceTags != nil { + ok := object.Key("ResourceTags") + if err := awsAwsjson11_serializeDocumentResourceTagList(v.ResourceTags, ok); err != nil { + return err + } + } + if v.Subscribers != nil { ok := object.Key("Subscribers") if err := awsAwsjson11_serializeDocumentSubscribers(v.Subscribers, ok); err != nil { @@ -1935,6 +2148,13 @@ func awsAwsjson11_serializeOpDocumentCreateBudgetInput(v *CreateBudgetInput, val } } + if v.ResourceTags != nil { + ok := object.Key("ResourceTags") + if err := awsAwsjson11_serializeDocumentResourceTagList(v.ResourceTags, ok); err != nil { + return err + } + } + return nil } @@ -2387,6 +2607,56 @@ func awsAwsjson11_serializeOpDocumentExecuteBudgetActionInput(v *ExecuteBudgetAc return nil } +func awsAwsjson11_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 +} + +func awsAwsjson11_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.ResourceTags != nil { + ok := object.Key("ResourceTags") + if err := awsAwsjson11_serializeDocumentResourceTagList(v.ResourceTags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_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.ResourceTagKeys != nil { + ok := object.Key("ResourceTagKeys") + if err := awsAwsjson11_serializeDocumentResourceTagKeyList(v.ResourceTagKeys, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateBudgetActionInput(v *UpdateBudgetActionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/budgets/snapshot_test.go b/service/budgets/snapshot_test.go index 30b034f9602..824e683d5ca 100644 --- a/service/budgets/snapshot_test.go +++ b/service/budgets/snapshot_test.go @@ -290,6 +290,42 @@ func TestCheckSnapshot_ExecuteBudgetAction(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_UpdateBudget(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateBudget(context.Background(), nil, func(o *Options) { @@ -565,6 +601,42 @@ func TestUpdateSnapshot_ExecuteBudgetAction(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_UpdateBudget(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateBudget(context.Background(), nil, func(o *Options) { diff --git a/service/budgets/types/errors.go b/service/budgets/types/errors.go index ff8d4600952..2d482ca5408 100644 --- a/service/budgets/types/errors.go +++ b/service/budgets/types/errors.go @@ -243,6 +243,33 @@ func (e *ResourceLockedException) ErrorCode() string { } func (e *ResourceLockedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// You've reached the limit on the number of tags you can associate with a +// resource. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The number of API requests has exceeded the maximum allowed API request // throttling limit for the account. type ThrottlingException struct { diff --git a/service/budgets/types/types.go b/service/budgets/types/types.go index cee4315da4f..d6ac187b67f 100644 --- a/service/budgets/types/types.go +++ b/service/budgets/types/types.go @@ -182,9 +182,9 @@ type Budget struct { // The actual and forecasted cost or usage that the budget tracks. CalculatedSpend *CalculatedSpend - // The cost filters, such as Region , Service , member account , Tag , or Cost - // Category , that are applied to a budget. Amazon Web Services Budgets supports - // the following services as a Service filter for RI budgets: + // The cost filters, such as Region , Service , LinkedAccount , Tag , or + // CostCategory , that are applied to a budget. Amazon Web Services Budgets + // supports the following services as a Service filter for RI budgets: // - Amazon EC2 // - Amazon Redshift // - Amazon Relational Database Service @@ -491,6 +491,22 @@ type NotificationWithSubscribers struct { noSmithyDocumentSerde } +// The tag structure that contains a tag key and value. +type ResourceTag struct { + + // The key that's associated with the tag. + // + // This member is required. + Key *string + + // The value that's associated with the tag. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + // The service control policies (SCP) action definition details. type ScpActionDefinition struct { diff --git a/service/budgets/validators.go b/service/budgets/validators.go index 9c982f4c8dd..f529c6b09c6 100644 --- a/service/budgets/validators.go +++ b/service/budgets/validators.go @@ -390,6 +390,66 @@ func (m *validateOpExecuteBudgetAction) HandleInitialize(ctx context.Context, in 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 validateOpUpdateBudgetAction struct { } @@ -546,6 +606,18 @@ func addOpExecuteBudgetActionValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpExecuteBudgetAction{}, 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 addOpUpdateBudgetActionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateBudgetAction{}, middleware.After) } @@ -798,6 +870,41 @@ func validatePlannedBudgetLimits(v map[string]types.Spend) error { } } +func validateResourceTag(v *types.ResourceTag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceTag"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResourceTagList(v []types.ResourceTag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceTagList"} + for i := range v { + if err := validateResourceTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateScpActionDefinition(v *types.ScpActionDefinition) error { if v == nil { return nil @@ -934,6 +1041,11 @@ func validateOpCreateBudgetActionInput(v *CreateBudgetActionInput) error { invalidParams.AddNested("Subscribers", err.(smithy.InvalidParamsError)) } } + if v.ResourceTags != nil { + if err := validateResourceTagList(v.ResourceTags); err != nil { + invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -961,6 +1073,11 @@ func validateOpCreateBudgetInput(v *CreateBudgetInput) error { invalidParams.AddNested("NotificationsWithSubscribers", err.(smithy.InvalidParamsError)) } } + if v.ResourceTags != nil { + if err := validateResourceTagList(v.ResourceTags); err != nil { + invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1336,6 +1453,61 @@ func validateOpExecuteBudgetActionInput(v *ExecuteBudgetActionInput) error { } } +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.ResourceTags == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceTags")) + } else if v.ResourceTags != nil { + if err := validateResourceTagList(v.ResourceTags); err != nil { + invalidParams.AddNested("ResourceTags", 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.ResourceTagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceTagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateBudgetActionInput(v *UpdateBudgetActionInput) error { if v == nil { return nil diff --git a/service/resiliencehub/api_op_ListAppAssessmentResourceDrifts.go b/service/resiliencehub/api_op_ListAppAssessmentResourceDrifts.go new file mode 100644 index 00000000000..749b7aff679 --- /dev/null +++ b/service/resiliencehub/api_op_ListAppAssessmentResourceDrifts.go @@ -0,0 +1,248 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Indicates the list of resource drifts that were detected while running an +// assessment. +func (c *Client) ListAppAssessmentResourceDrifts(ctx context.Context, params *ListAppAssessmentResourceDriftsInput, optFns ...func(*Options)) (*ListAppAssessmentResourceDriftsOutput, error) { + if params == nil { + params = &ListAppAssessmentResourceDriftsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAppAssessmentResourceDrifts", params, optFns, c.addOperationListAppAssessmentResourceDriftsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAppAssessmentResourceDriftsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAppAssessmentResourceDriftsInput struct { + + // Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn: + // partition :resiliencehub: region : account :app-assessment/ app-id . For more + // information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference guide. + // + // This member is required. + AssessmentArn *string + + // Indicates the maximum number of drift results to include in the response. If + // more results exist than the specified MaxResults value, a token is included in + // the response so that the remaining results can be retrieved. + MaxResults *int32 + + // Null, or the token from a previous call to get the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAppAssessmentResourceDriftsOutput struct { + + // Indicates all the resource drifts detected for an assessed entity. + // + // This member is required. + ResourceDrifts []types.ResourceDrift + + // Null, or the token from a previous call to get the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAppAssessmentResourceDriftsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAppAssessmentResourceDrifts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAppAssessmentResourceDrifts{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAppAssessmentResourceDrifts"); 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 = addOpListAppAssessmentResourceDriftsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAppAssessmentResourceDrifts(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 +} + +// ListAppAssessmentResourceDriftsAPIClient is a client that implements the +// ListAppAssessmentResourceDrifts operation. +type ListAppAssessmentResourceDriftsAPIClient interface { + ListAppAssessmentResourceDrifts(context.Context, *ListAppAssessmentResourceDriftsInput, ...func(*Options)) (*ListAppAssessmentResourceDriftsOutput, error) +} + +var _ ListAppAssessmentResourceDriftsAPIClient = (*Client)(nil) + +// ListAppAssessmentResourceDriftsPaginatorOptions is the paginator options for +// ListAppAssessmentResourceDrifts +type ListAppAssessmentResourceDriftsPaginatorOptions struct { + // Indicates the maximum number of drift results to include in the response. If + // more results exist than the specified MaxResults value, a token is included in + // the response so that the remaining results can be retrieved. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListAppAssessmentResourceDriftsPaginator is a paginator for +// ListAppAssessmentResourceDrifts +type ListAppAssessmentResourceDriftsPaginator struct { + options ListAppAssessmentResourceDriftsPaginatorOptions + client ListAppAssessmentResourceDriftsAPIClient + params *ListAppAssessmentResourceDriftsInput + nextToken *string + firstPage bool +} + +// NewListAppAssessmentResourceDriftsPaginator returns a new +// ListAppAssessmentResourceDriftsPaginator +func NewListAppAssessmentResourceDriftsPaginator(client ListAppAssessmentResourceDriftsAPIClient, params *ListAppAssessmentResourceDriftsInput, optFns ...func(*ListAppAssessmentResourceDriftsPaginatorOptions)) *ListAppAssessmentResourceDriftsPaginator { + if params == nil { + params = &ListAppAssessmentResourceDriftsInput{} + } + + options := ListAppAssessmentResourceDriftsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAppAssessmentResourceDriftsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAppAssessmentResourceDriftsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAppAssessmentResourceDrifts page. +func (p *ListAppAssessmentResourceDriftsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppAssessmentResourceDriftsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListAppAssessmentResourceDrifts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListAppAssessmentResourceDrifts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAppAssessmentResourceDrifts", + } +} diff --git a/service/resiliencehub/api_op_ListRecommendationTemplates.go b/service/resiliencehub/api_op_ListRecommendationTemplates.go index 361d716e9df..0a58502f864 100644 --- a/service/resiliencehub/api_op_ListRecommendationTemplates.go +++ b/service/resiliencehub/api_op_ListRecommendationTemplates.go @@ -33,8 +33,6 @@ type ListRecommendationTemplatesInput struct { // partition :resiliencehub: region : account :app-assessment/ app-id . For more // information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference guide. - // - // This member is required. AssessmentArn *string // Maximum number of results to include in the response. If more results exist @@ -130,9 +128,6 @@ func (c *Client) addOperationListRecommendationTemplatesMiddlewares(stack *middl if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addOpListRecommendationTemplatesValidationMiddleware(stack); err != nil { - return err - } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRecommendationTemplates(options.Region), middleware.Before); err != nil { return err } diff --git a/service/resiliencehub/deserializers.go b/service/resiliencehub/deserializers.go index 1c73b5b2b8a..338d3de82aa 100644 --- a/service/resiliencehub/deserializers.go +++ b/service/resiliencehub/deserializers.go @@ -4573,6 +4573,171 @@ func awsRestjson1_deserializeOpDocumentListAppAssessmentComplianceDriftsOutput(v return nil } +type awsRestjson1_deserializeOpListAppAssessmentResourceDrifts struct { +} + +func (*awsRestjson1_deserializeOpListAppAssessmentResourceDrifts) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAppAssessmentResourceDrifts) 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_deserializeOpErrorListAppAssessmentResourceDrifts(response, &metadata) + } + output := &ListAppAssessmentResourceDriftsOutput{} + 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_deserializeOpDocumentListAppAssessmentResourceDriftsOutput(&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_deserializeOpErrorListAppAssessmentResourceDrifts(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListAppAssessmentResourceDriftsOutput(v **ListAppAssessmentResourceDriftsOutput, 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 *ListAppAssessmentResourceDriftsOutput + if *v == nil { + sv = &ListAppAssessmentResourceDriftsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "resourceDrifts": + if err := awsRestjson1_deserializeDocumentResourceDriftList(&sv.ResourceDrifts, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListAppAssessments struct { } @@ -13582,6 +13747,112 @@ func awsRestjson1_deserializeDocumentResiliencyScore(v **types.ResiliencyScore, return nil } +func awsRestjson1_deserializeDocumentResourceDrift(v **types.ResourceDrift, 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.ResourceDrift + if *v == nil { + sv = &types.ResourceDrift{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AppArn = ptr.String(jtv) + } + + case "appVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityVersion to be of type string, got %T instead", value) + } + sv.AppVersion = ptr.String(jtv) + } + + case "diffType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DifferenceType to be of type string, got %T instead", value) + } + sv.DiffType = types.DifferenceType(jtv) + } + + case "referenceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) + } + sv.ReferenceId = ptr.String(jtv) + } + + case "resourceIdentifier": + if err := awsRestjson1_deserializeDocumentResourceIdentifier(&sv.ResourceIdentifier, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceDriftList(v *[]types.ResourceDrift, 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.ResourceDrift + if *v == nil { + cv = []types.ResourceDrift{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceDrift + destAddr := &col + if err := awsRestjson1_deserializeDocumentResourceDrift(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentResourceError(v **types.ResourceError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13719,6 +13990,51 @@ func awsRestjson1_deserializeDocumentResourceErrorsDetails(v **types.ResourceErr return nil } +func awsRestjson1_deserializeDocumentResourceIdentifier(v **types.ResourceIdentifier, 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.ResourceIdentifier + if *v == nil { + sv = &types.ResourceIdentifier{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "logicalResourceId": + if err := awsRestjson1_deserializeDocumentLogicalResourceId(&sv.LogicalResourceId, value); err != nil { + return err + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentResourceMapping(v **types.ResourceMapping, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/resiliencehub/generated.json b/service/resiliencehub/generated.json index ab8887fbce3..83fc6827767 100644 --- a/service/resiliencehub/generated.json +++ b/service/resiliencehub/generated.json @@ -34,6 +34,7 @@ "api_op_ImportResourcesToDraftAppVersion.go", "api_op_ListAlarmRecommendations.go", "api_op_ListAppAssessmentComplianceDrifts.go", + "api_op_ListAppAssessmentResourceDrifts.go", "api_op_ListAppAssessments.go", "api_op_ListAppComponentCompliances.go", "api_op_ListAppComponentRecommendations.go", diff --git a/service/resiliencehub/serializers.go b/service/resiliencehub/serializers.go index 6f73eb18e9a..5fcef2a8916 100644 --- a/service/resiliencehub/serializers.go +++ b/service/resiliencehub/serializers.go @@ -2372,6 +2372,91 @@ func awsRestjson1_serializeOpDocumentListAppAssessmentComplianceDriftsInput(v *L return nil } +type awsRestjson1_serializeOpListAppAssessmentResourceDrifts struct { +} + +func (*awsRestjson1_serializeOpListAppAssessmentResourceDrifts) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAppAssessmentResourceDrifts) 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.(*ListAppAssessmentResourceDriftsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-app-assessment-resource-drifts") + 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_serializeOpDocumentListAppAssessmentResourceDriftsInput(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_serializeOpHttpBindingsListAppAssessmentResourceDriftsInput(v *ListAppAssessmentResourceDriftsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListAppAssessmentResourceDriftsInput(v *ListAppAssessmentResourceDriftsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssessmentArn != nil { + ok := object.Key("assessmentArn") + ok.String(*v.AssessmentArn) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListAppAssessments struct { } diff --git a/service/resiliencehub/snapshot_test.go b/service/resiliencehub/snapshot_test.go index ad6ca467ad3..9756829f907 100644 --- a/service/resiliencehub/snapshot_test.go +++ b/service/resiliencehub/snapshot_test.go @@ -374,6 +374,18 @@ func TestCheckSnapshot_ListAppAssessmentComplianceDrifts(t *testing.T) { } } +func TestCheckSnapshot_ListAppAssessmentResourceDrifts(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAppAssessmentResourceDrifts(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListAppAssessmentResourceDrifts") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListAppAssessments(t *testing.T) { svc := New(Options{}) _, err := svc.ListAppAssessments(context.Background(), nil, func(o *Options) { @@ -1021,6 +1033,18 @@ func TestUpdateSnapshot_ListAppAssessmentComplianceDrifts(t *testing.T) { } } +func TestUpdateSnapshot_ListAppAssessmentResourceDrifts(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListAppAssessmentResourceDrifts(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListAppAssessmentResourceDrifts") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListAppAssessments(t *testing.T) { svc := New(Options{}) _, err := svc.ListAppAssessments(context.Background(), nil, func(o *Options) { diff --git a/service/resiliencehub/types/enums.go b/service/resiliencehub/types/enums.go index 1c66cdb35bf..8e9fd725dd2 100644 --- a/service/resiliencehub/types/enums.go +++ b/service/resiliencehub/types/enums.go @@ -236,6 +236,8 @@ type DifferenceType string // Enum values for DifferenceType const ( DifferenceTypeNotEqual DifferenceType = "NotEqual" + DifferenceTypeAdded DifferenceType = "Added" + DifferenceTypeRemoved DifferenceType = "Removed" ) // Values returns all known values for DifferenceType. Note that this can be @@ -244,6 +246,8 @@ const ( func (DifferenceType) Values() []DifferenceType { return []DifferenceType{ "NotEqual", + "Added", + "Removed", } } @@ -293,7 +297,8 @@ type DriftType string // Enum values for DriftType const ( - DriftTypeApplicationCompliance DriftType = "ApplicationCompliance" + DriftTypeApplicationCompliance DriftType = "ApplicationCompliance" + DriftTypeAppComponentResiliencyComplianceStatus DriftType = "AppComponentResiliencyComplianceStatus" ) // Values returns all known values for DriftType. Note that this can be expanded @@ -302,6 +307,7 @@ const ( func (DriftType) Values() []DriftType { return []DriftType{ "ApplicationCompliance", + "AppComponentResiliencyComplianceStatus", } } diff --git a/service/resiliencehub/types/types.go b/service/resiliencehub/types/types.go index ea7add2e1e0..3a1d8e83d31 100644 --- a/service/resiliencehub/types/types.go +++ b/service/resiliencehub/types/types.go @@ -796,7 +796,7 @@ type PhysicalResource struct { // This member is required. PhysicalResourceId *PhysicalResourceId - // The type of resource. + // Type of resource. // // This member is required. ResourceType *string @@ -1065,6 +1065,31 @@ type ResiliencyScore struct { noSmithyDocumentSerde } +// Indicates the resources that have drifted in the current application version. +type ResourceDrift struct { + + // Amazon Resource Name (ARN) of the application whose resources have drifted. The + // format for this ARN is: arn: partition :resiliencehub: region : account + // :app-assessment/ app-id . For more information about ARNs, see Amazon Resource + // Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference guide. + AppArn *string + + // Version of the application whose resources have drifted. + AppVersion *string + + // Indicates if the resource was added or removed. + DiffType DifferenceType + + // Reference identifier of the resource drift. + ReferenceId *string + + // Identifier of the drifted resource. + ResourceIdentifier *ResourceIdentifier + + noSmithyDocumentSerde +} + // Defines application resource errors. type ResourceError struct { @@ -1092,17 +1117,22 @@ type ResourceErrorsDetails struct { noSmithyDocumentSerde } +// Defines a resource identifier for the drifted resource. +type ResourceIdentifier struct { + + // Logical identifier of the drifted resource. + LogicalResourceId *LogicalResourceId + + // Type of the drifted resource. + ResourceType *string + + noSmithyDocumentSerde +} + // Defines a resource mapping. type ResourceMapping struct { - // Specifies the type of resource mapping. AppRegistryApp The resource is mapped - // to another application. The name of the application is contained in the - // appRegistryAppName property. CfnStack The resource is mapped to a CloudFormation - // stack. The name of the CloudFormation stack is contained in the logicalStackName - // property. Resource The resource is mapped to another resource. The name of the - // resource is contained in the resourceName property. ResourceGroup The resource - // is mapped to Resource Groups. The name of the resource group is contained in the - // resourceGroupName property. + // Specifies the type of resource mapping. // // This member is required. MappingType ResourceMappingType @@ -1112,24 +1142,29 @@ type ResourceMapping struct { // This member is required. PhysicalResourceId *PhysicalResourceId - // The name of the application this resource is mapped to. + // Name of the application this resource is mapped to when the mappingType is + // AppRegistryApp . AppRegistryAppName *string - // Name of the Amazon Elastic Kubernetes Service cluster and namespace this - // resource belongs to. This parameter accepts values in "eks-cluster/namespace" - // format. + // Name of the Amazon Elastic Kubernetes Service cluster and namespace that this + // resource is mapped to when the mappingType is EKS . This parameter accepts + // values in "eks-cluster/namespace" format. EksSourceName *string - // The name of the CloudFormation stack this resource is mapped to. + // Name of the CloudFormation stack this resource is mapped to when the mappingType + // is CfnStack . LogicalStackName *string - // Name of the resource group that the resource is mapped to. + // Name of the Resource Groups that this resource is mapped to when the mappingType + // is ResourceGroup . ResourceGroupName *string - // Name of the resource that the resource is mapped to. + // Name of the resource that this resource is mapped to when the mappingType is + // Resource . ResourceName *string - // The short name of the Terraform source. + // Name of the Terraform source that this resource is mapped to when the + // mappingType is Terraform . TerraformSourceName *string noSmithyDocumentSerde @@ -1153,27 +1188,27 @@ type S3Location struct { type ScoringComponentResiliencyScore struct { // Number of recommendations that were excluded from the assessment. For example, - // if the Excluded count for Resilience Hub recommended Amazon CloudWatch alarms - // is 7, it indicates that 7 Amazon CloudWatch alarms are excluded from the - // assessment. + // if the excludedCount for Alarms coverage scoring component is 7, it indicates + // that 7 Amazon CloudWatch alarms are excluded from the assessment. ExcludedCount int64 - // Number of issues that must be resolved to obtain the maximum possible score for - // the scoring component. For SOPs, alarms, and FIS experiments, these are the - // number of recommendations that must be implemented. For compliance, it is the - // number of Application Components that has breached the resiliency policy. For - // example, if the Outstanding count for Resilience Hub recommended Amazon - // CloudWatch alarms is 5, it indicates that 5 Amazon CloudWatch alarms must be - // fixed to achieve the maximum possible score. + // Number of recommendations that must be implemented to obtain the maximum + // possible score for the scoring component. For SOPs, alarms, and tests, these are + // the number of recommendations that must be implemented. For compliance, these + // are the number of Application Components that have breached the resiliency + // policy. For example, if the outstandingCount for Alarms coverage scoring + // component is 5, it indicates that 5 Amazon CloudWatch alarms need to be + // implemented to achieve the maximum possible score. OutstandingCount int64 - // Maximum possible score that can be obtained for the scoring component. If the - // Possible score is 20 points, it indicates the maximum possible score you can - // achieve for your application when you run a new assessment after implementing - // all the Resilience Hub recommendations. + // Maximum possible score that can be obtained for the scoring component. For + // example, if the possibleScore is 20 points, it indicates the maximum possible + // score you can achieve for the scoring component when you run a new assessment + // after implementing all the Resilience Hub recommendations. PossibleScore float64 - // Resiliency score of your application. + // Resiliency score points given for the scoring component. The score is always + // less than or equal to the possibleScore . Score float64 noSmithyDocumentSerde diff --git a/service/resiliencehub/validators.go b/service/resiliencehub/validators.go index d8cb6d00c43..426c402287b 100644 --- a/service/resiliencehub/validators.go +++ b/service/resiliencehub/validators.go @@ -530,6 +530,26 @@ func (m *validateOpListAppAssessmentComplianceDrifts) HandleInitialize(ctx conte return next.HandleInitialize(ctx, in) } +type validateOpListAppAssessmentResourceDrifts struct { +} + +func (*validateOpListAppAssessmentResourceDrifts) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAppAssessmentResourceDrifts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAppAssessmentResourceDriftsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAppAssessmentResourceDriftsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAppComponentCompliances struct { } @@ -670,26 +690,6 @@ func (m *validateOpListAppVersions) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } -type validateOpListRecommendationTemplates struct { -} - -func (*validateOpListRecommendationTemplates) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListRecommendationTemplates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListRecommendationTemplatesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListRecommendationTemplatesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - type validateOpListSopRecommendations struct { } @@ -1114,6 +1114,10 @@ func addOpListAppAssessmentComplianceDriftsValidationMiddleware(stack *middlewar return stack.Initialize.Add(&validateOpListAppAssessmentComplianceDrifts{}, middleware.After) } +func addOpListAppAssessmentResourceDriftsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAppAssessmentResourceDrifts{}, middleware.After) +} + func addOpListAppComponentCompliancesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAppComponentCompliances{}, middleware.After) } @@ -1142,10 +1146,6 @@ func addOpListAppVersionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAppVersions{}, middleware.After) } -func addOpListRecommendationTemplatesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListRecommendationTemplates{}, middleware.After) -} - func addOpListSopRecommendationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSopRecommendations{}, middleware.After) } @@ -1988,6 +1988,21 @@ func validateOpListAppAssessmentComplianceDriftsInput(v *ListAppAssessmentCompli } } +func validateOpListAppAssessmentResourceDriftsInput(v *ListAppAssessmentResourceDriftsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAppAssessmentResourceDriftsInput"} + if v.AssessmentArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAppComponentCompliancesInput(v *ListAppComponentCompliancesInput) error { if v == nil { return nil @@ -2105,21 +2120,6 @@ func validateOpListAppVersionsInput(v *ListAppVersionsInput) error { } } -func validateOpListRecommendationTemplatesInput(v *ListRecommendationTemplatesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListRecommendationTemplatesInput"} - if v.AssessmentArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssessmentArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpListSopRecommendationsInput(v *ListSopRecommendationsInput) error { if v == nil { return nil diff --git a/service/route53profiles/api_op_AssociateProfile.go b/service/route53profiles/api_op_AssociateProfile.go index 364c13014e8..a8d2478a669 100644 --- a/service/route53profiles/api_op_AssociateProfile.go +++ b/service/route53profiles/api_op_AssociateProfile.go @@ -12,8 +12,10 @@ import ( ) // Associates a Route 53 Profiles profile with a VPC. A VPC can have only one -// Profile associated with it, but a Profile can be associated with up to 5000 -// VPCs. +// Profile associated with it, but a Profile can be associated with 1000 of VPCs +// (and you can request a higher quota). For more information, see +// https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-entities (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-entities) +// . func (c *Client) AssociateProfile(ctx context.Context, params *AssociateProfileInput, optFns ...func(*Options)) (*AssociateProfileOutput, error) { if params == nil { params = &AssociateProfileInput{} diff --git a/service/route53profiles/api_op_AssociateResourceToProfile.go b/service/route53profiles/api_op_AssociateResourceToProfile.go index fabc471a111..f6725caa81a 100644 --- a/service/route53profiles/api_op_AssociateResourceToProfile.go +++ b/service/route53profiles/api_op_AssociateResourceToProfile.go @@ -44,8 +44,10 @@ type AssociateResourceToProfileInput struct { // This member is required. ResourceArn *string - // If you are adding a DNS Firewall rule group, include also a priority in this - // format: Key=FirewallRuleGroupPriority,Value=100 + // If you are adding a DNS Firewall rule group, include also a priority. The + // priority indicates the processing order for the rule groups, starting with the + // priority assinged the lowest value. The allowed values for priority are between + // 100 and 9900. ResourceProperties *string noSmithyDocumentSerde diff --git a/service/route53profiles/api_op_UpdateProfileResourceAssociation.go b/service/route53profiles/api_op_UpdateProfileResourceAssociation.go index 899c96fc0be..43549128a18 100644 --- a/service/route53profiles/api_op_UpdateProfileResourceAssociation.go +++ b/service/route53profiles/api_op_UpdateProfileResourceAssociation.go @@ -37,8 +37,10 @@ type UpdateProfileResourceAssociationInput struct { // Name of the resource association. Name *string - // If you are adding a DNS Firewall rule group, include also a priority in this - // format: Key=FirewallRuleGroupPriority,Value=100 . + // If you are adding a DNS Firewall rule group, include also a priority. The + // priority indicates the processing order for the rule groups, starting with the + // priority assinged the lowest value. The allowed values for priority are between + // 100 and 9900. ResourceProperties *string noSmithyDocumentSerde