From c8b1522acbf72651f7a935528f18dc2151da6ea7 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Fri, 10 Nov 2023 19:34:07 +0000 Subject: [PATCH] Regenerated Clients --- .../20c6deed66594910b71861c1782f41fc.json | 8 + .../26745209a50d44bb8af6729d0541d9ee.json | 8 + .../4a2554ab9951482998f62606d6a1d0db.json | 8 + .../4ca19024ca4b49f9b436158541f0bda6.json | 8 + .../9212b3732b5f436c828b914000d9118f.json | 8 + .../a425f54ecac94da0bf1864e121e89fe8.json | 8 + .../e6ab4efb500d45cea2fda2af187793e8.json | 8 + service/controltower/api_op_EnableControl.go | 7 + .../api_op_GetControlOperation.go | 1 + .../controltower/api_op_GetEnabledControl.go | 10 +- .../api_op_ListEnabledControls.go | 1 + .../api_op_ListTagsForResource.go | 264 +++++++ service/controltower/api_op_TagResource.go | 263 +++++++ service/controltower/api_op_UntagResource.go | 263 +++++++ service/controltower/deserializers.go | 376 ++++++++++ service/controltower/doc.go | 7 +- service/controltower/endpoints.go | 2 +- service/controltower/endpoints_test.go | 20 + service/controltower/generated.json | 3 + service/controltower/serializers.go | 244 +++++++ service/controltower/types/types.go | 9 +- service/controltower/validators.go | 123 ++++ .../api_op_DeleteReportDefinition.go | 8 +- .../api_op_DescribeReportDefinitions.go | 12 +- .../api_op_ListTagsForResource.go | 261 +++++++ .../api_op_ModifyReportDefinition.go | 8 +- .../api_op_PutReportDefinition.go | 3 + .../api_op_TagResource.go | 262 +++++++ .../api_op_UntagResource.go | 261 +++++++ .../deserializers.go | 682 +++++++++++++++++- service/costandusagereportservice/doc.go | 18 +- .../costandusagereportservice/endpoints.go | 2 +- .../costandusagereportservice/generated.json | 3 + .../costandusagereportservice/serializers.go | 287 ++++++++ .../costandusagereportservice/types/enums.go | 26 +- .../costandusagereportservice/types/errors.go | 29 +- .../costandusagereportservice/types/types.go | 62 +- .../costandusagereportservice/validators.go | 206 ++++++ service/ec2/api_op_DescribeInstances.go | 4 +- service/ec2/deserializers.go | 348 +++++++++ service/ec2/serializers.go | 45 ++ service/ec2/types/types.go | 155 +++- service/fms/api_op_DeletePolicy.go | 17 +- service/fms/api_op_GetViolationDetails.go | 9 +- service/fms/api_op_PutPolicy.go | 46 +- service/fms/types/types.go | 106 ++- .../api_op_GetEntitlements.go | 91 +++ .../endpoints.go | 2 +- service/mediaconvert/deserializers.go | 67 ++ service/mediaconvert/serializers.go | 28 + service/mediaconvert/types/enums.go | 6 + service/mediaconvert/types/types.go | 102 ++- .../rds/api_op_CreateCustomDBEngineVersion.go | 4 +- service/rds/api_op_CreateIntegration.go | 16 +- .../rds/api_op_DeleteCustomDBEngineVersion.go | 4 +- service/rds/api_op_DeleteIntegration.go | 10 +- service/rds/api_op_DescribeIntegrations.go | 5 +- .../rds/api_op_ModifyCustomDBEngineVersion.go | 4 +- service/rds/types/types.go | 14 +- 59 files changed, 4650 insertions(+), 212 deletions(-) create mode 100644 .changelog/20c6deed66594910b71861c1782f41fc.json create mode 100644 .changelog/26745209a50d44bb8af6729d0541d9ee.json create mode 100644 .changelog/4a2554ab9951482998f62606d6a1d0db.json create mode 100644 .changelog/4ca19024ca4b49f9b436158541f0bda6.json create mode 100644 .changelog/9212b3732b5f436c828b914000d9118f.json create mode 100644 .changelog/a425f54ecac94da0bf1864e121e89fe8.json create mode 100644 .changelog/e6ab4efb500d45cea2fda2af187793e8.json create mode 100644 service/controltower/api_op_ListTagsForResource.go create mode 100644 service/controltower/api_op_TagResource.go create mode 100644 service/controltower/api_op_UntagResource.go create mode 100644 service/costandusagereportservice/api_op_ListTagsForResource.go create mode 100644 service/costandusagereportservice/api_op_TagResource.go create mode 100644 service/costandusagereportservice/api_op_UntagResource.go diff --git a/.changelog/20c6deed66594910b71861c1782f41fc.json b/.changelog/20c6deed66594910b71861c1782f41fc.json new file mode 100644 index 00000000000..09978692948 --- /dev/null +++ b/.changelog/20c6deed66594910b71861c1782f41fc.json @@ -0,0 +1,8 @@ +{ + "id": "20c6deed-6659-4910-b718-61c1782f41fc", + "type": "documentation", + "description": "Updates Amazon RDS documentation for zero-ETL integrations.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/.changelog/26745209a50d44bb8af6729d0541d9ee.json b/.changelog/26745209a50d44bb8af6729d0541d9ee.json new file mode 100644 index 00000000000..a497ce0e0fb --- /dev/null +++ b/.changelog/26745209a50d44bb8af6729d0541d9ee.json @@ -0,0 +1,8 @@ +{ + "id": "26745209-a50d-44bb-8af6-729d0541d9ee", + "type": "feature", + "description": "AWS Control Tower supports tagging for enabled controls. This release introduces TagResource, UntagResource and ListTagsForResource APIs to manage tags in existing enabled controls. It updates EnabledControl API to tag resources at creation time.", + "modules": [ + "service/controltower" + ] +} \ No newline at end of file diff --git a/.changelog/4a2554ab9951482998f62606d6a1d0db.json b/.changelog/4a2554ab9951482998f62606d6a1d0db.json new file mode 100644 index 00000000000..41f4bf0ef0c --- /dev/null +++ b/.changelog/4a2554ab9951482998f62606d6a1d0db.json @@ -0,0 +1,8 @@ +{ + "id": "4a2554ab-9951-4829-98f6-2606d6a1d0db", + "type": "documentation", + "description": "Adds optimizeUnassociatedWebACL flag to ManagedServiceData, updates third-party firewall examples, and other minor documentation updates.", + "modules": [ + "service/fms" + ] +} \ No newline at end of file diff --git a/.changelog/4ca19024ca4b49f9b436158541f0bda6.json b/.changelog/4ca19024ca4b49f9b436158541f0bda6.json new file mode 100644 index 00000000000..6d82b3a88f2 --- /dev/null +++ b/.changelog/4ca19024ca4b49f9b436158541f0bda6.json @@ -0,0 +1,8 @@ +{ + "id": "4ca19024-ca4b-49f9-b436-158541f0bda6", + "type": "feature", + "description": "EC2 adds API updates to enable ENA Express at instance launch time.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/9212b3732b5f436c828b914000d9118f.json b/.changelog/9212b3732b5f436c828b914000d9118f.json new file mode 100644 index 00000000000..7a7e6b8bf97 --- /dev/null +++ b/.changelog/9212b3732b5f436c828b914000d9118f.json @@ -0,0 +1,8 @@ +{ + "id": "9212b373-2b5f-436c-828b-914000d9118f", + "type": "feature", + "description": "This release adds support for tagging and customers can now tag report definitions. Additionally, ReportStatus is now added to report definition to show when the last delivered time stamp and if it succeeded or not.", + "modules": [ + "service/costandusagereportservice" + ] +} \ No newline at end of file diff --git a/.changelog/a425f54ecac94da0bf1864e121e89fe8.json b/.changelog/a425f54ecac94da0bf1864e121e89fe8.json new file mode 100644 index 00000000000..c9ca70f95f2 --- /dev/null +++ b/.changelog/a425f54ecac94da0bf1864e121e89fe8.json @@ -0,0 +1,8 @@ +{ + "id": "a425f54e-cac9-4da0-bf18-64e121e89fe8", + "type": "feature", + "description": "This release includes the ability to specify any input source as the primary input for corresponding follow modes, and allows users to specify fit and fill behaviors without resizing content.", + "modules": [ + "service/mediaconvert" + ] +} \ No newline at end of file diff --git a/.changelog/e6ab4efb500d45cea2fda2af187793e8.json b/.changelog/e6ab4efb500d45cea2fda2af187793e8.json new file mode 100644 index 00000000000..0ee3f5fc420 --- /dev/null +++ b/.changelog/e6ab4efb500d45cea2fda2af187793e8.json @@ -0,0 +1,8 @@ +{ + "id": "e6ab4efb-500d-45ce-a2fd-a2af187793e8", + "type": "feature", + "description": "Add paginators to GetEntitlements.", + "modules": [ + "service/marketplaceentitlementservice" + ] +} \ No newline at end of file diff --git a/service/controltower/api_op_EnableControl.go b/service/controltower/api_op_EnableControl.go index ce558aa8959..7547764c615 100644 --- a/service/controltower/api_op_EnableControl.go +++ b/service/controltower/api_op_EnableControl.go @@ -19,6 +19,7 @@ import ( // creates AWS resources on the specified organizational unit and the accounts it // contains. The resources created will vary according to the control that you // specify. For usage examples, see the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// . func (c *Client) EnableControl(ctx context.Context, params *EnableControlInput, optFns ...func(*Options)) (*EnableControlOutput, error) { if params == nil { params = &EnableControlInput{} @@ -51,6 +52,9 @@ type EnableControlInput struct { // This member is required. TargetIdentifier *string + // Tags to be applied to the EnabledControl resource. + Tags map[string]string + noSmithyDocumentSerde } @@ -62,6 +66,9 @@ type EnableControlOutput struct { // This member is required. OperationIdentifier *string + // The ARN of the EnabledControl resource. + Arn *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/controltower/api_op_GetControlOperation.go b/service/controltower/api_op_GetControlOperation.go index a3327b2a8b3..b9ac362af61 100644 --- a/service/controltower/api_op_GetControlOperation.go +++ b/service/controltower/api_op_GetControlOperation.go @@ -19,6 +19,7 @@ import ( // Returns the status of a particular EnableControl or DisableControl operation. // Displays a message in case of error. Details for an operation are available for // 90 days. For usage examples, see the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// . func (c *Client) GetControlOperation(ctx context.Context, params *GetControlOperationInput, optFns ...func(*Options)) (*GetControlOperationOutput, error) { if params == nil { params = &GetControlOperationInput{} diff --git a/service/controltower/api_op_GetEnabledControl.go b/service/controltower/api_op_GetEnabledControl.go index 33c290eba53..ecea00354ff 100644 --- a/service/controltower/api_op_GetEnabledControl.go +++ b/service/controltower/api_op_GetEnabledControl.go @@ -16,13 +16,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Provides details about the enabled control. For usage examples, see the AWS +// Retrieves details about an enabled control. For usage examples, see the AWS // Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) -// . Returned values -// - TargetRegions: Shows target AWS Regions where the enabled control is -// available to be deployed. -// - StatusSummary: Provides a detailed summary of the deployment status. -// - DriftSummary: Provides a detailed summary of the drifted status. +// . func (c *Client) GetEnabledControl(ctx context.Context, params *GetEnabledControlInput, optFns ...func(*Options)) (*GetEnabledControlOutput, error) { if params == nil { params = &GetEnabledControlInput{} @@ -40,7 +36,7 @@ func (c *Client) GetEnabledControl(ctx context.Context, params *GetEnabledContro type GetEnabledControlInput struct { - // The ARN of the enabled control. + // The controlIdentifier of the enabled control. // // This member is required. EnabledControlIdentifier *string diff --git a/service/controltower/api_op_ListEnabledControls.go b/service/controltower/api_op_ListEnabledControls.go index c31a1e8d20c..0a5996b4060 100644 --- a/service/controltower/api_op_ListEnabledControls.go +++ b/service/controltower/api_op_ListEnabledControls.go @@ -19,6 +19,7 @@ import ( // Lists the controls enabled by AWS Control Tower on the specified organizational // unit and the accounts it contains. For usage examples, see the AWS Control // Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// . func (c *Client) ListEnabledControls(ctx context.Context, params *ListEnabledControlsInput, optFns ...func(*Options)) (*ListEnabledControlsOutput, error) { if params == nil { params = &ListEnabledControlsInput{} diff --git a/service/controltower/api_op_ListTagsForResource.go b/service/controltower/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..3f61cd98fad --- /dev/null +++ b/service/controltower/api_op_ListTagsForResource.go @@ -0,0 +1,264 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of tags associated with the resource. For usage examples, see +// the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// . +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN of the resource. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // A list of tags, as key:value strings. + // + // This member is required. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addListTagsForResourceResolveEndpointMiddleware(stack, options); 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 = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "controltower", + OperationName: "ListTagsForResource", + } +} + +type opListTagsForResourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListTagsForResourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListTagsForResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "controltower" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "controltower" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("controltower") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListTagsForResourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListTagsForResourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/controltower/api_op_TagResource.go b/service/controltower/api_op_TagResource.go new file mode 100644 index 00000000000..f88d6429a32 --- /dev/null +++ b/service/controltower/api_op_TagResource.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Applies tags to a resource. For usage examples, see the AWS Control Tower User +// Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// . +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The ARN of the resource to be tagged. + // + // This member is required. + ResourceArn *string + + // Tags to be applied to the resource. + // + // This member is required. + Tags map[string]string + + 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) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addTagResourceResolveEndpointMiddleware(stack, options); 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 = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "controltower", + OperationName: "TagResource", + } +} + +type opTagResourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opTagResourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opTagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "controltower" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "controltower" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("controltower") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addTagResourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opTagResourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/controltower/api_op_UntagResource.go b/service/controltower/api_op_UntagResource.go new file mode 100644 index 00000000000..1bdf60f7034 --- /dev/null +++ b/service/controltower/api_op_UntagResource.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes tags from a resource. For usage examples, see the AWS Control Tower +// User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// . +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The ARN of the resource. + // + // This member is required. + ResourceArn *string + + // Tag keys to be removed from the resource. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addUntagResourceResolveEndpointMiddleware(stack, options); 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 = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "controltower", + OperationName: "UntagResource", + } +} + +type opUntagResourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUntagResourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUntagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "controltower" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "controltower" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("controltower") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUntagResourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUntagResourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/controltower/deserializers.go b/service/controltower/deserializers.go index 28b8952ac88..7f537bcdaf8 100644 --- a/service/controltower/deserializers.go +++ b/service/controltower/deserializers.go @@ -340,6 +340,15 @@ func awsRestjson1_deserializeOpDocumentEnableControlOutput(v **EnableControlOutp for key, value := range shape { switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + case "operationIdentifier": if value != nil { jtv, ok := value.(string) @@ -844,6 +853,337 @@ func awsRestjson1_deserializeOpDocumentListEnabledControlsOutput(v **ListEnabled return nil } +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) @@ -1704,6 +2044,42 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsRestjson1_deserializeDocumentTargetRegions(v *[]types.Region, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/controltower/doc.go b/service/controltower/doc.go index 51619d6debd..64235881be3 100644 --- a/service/controltower/doc.go +++ b/service/controltower/doc.go @@ -5,11 +5,12 @@ // // These interfaces allow you to apply the AWS library of pre-defined controls to // your organizational units, programmatically. In AWS Control Tower, the terms -// "control" and "guardrail" are synonyms. . To call these APIs, you'll need to -// know: +// "control" and "guardrail" are synonyms. To call these APIs, you'll need to know: +// // - the controlIdentifier for the control--or guardrail--you are targeting. // - the ARN associated with the target organizational unit (OU), which we call // the targetIdentifier . +// - the ARN associated with a resource that you wish to tag or untag. // // To get the controlIdentifier for your AWS Control Tower control: The // controlIdentifier is an ARN that is specified for each control. You can view the @@ -19,7 +20,7 @@ // Tables of control metadata (https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html) // in the AWS Control Tower User Guide. A quick-reference list of control // identifers for the AWS Control Tower legacy Strongly recommended and Elective -// controls is given in Resource identifiers for APIs and guardrails (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html) +// controls is given in Resource identifiers for APIs and controls (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html) // in the Controls reference guide section (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html) // of the AWS Control Tower User Guide. Remember that Mandatory controls cannot be // added or removed. ARN format: diff --git a/service/controltower/endpoints.go b/service/controltower/endpoints.go index e5dc7ea1a91..cd1369b43ea 100644 --- a/service/controltower/endpoints.go +++ b/service/controltower/endpoints.go @@ -430,7 +430,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://controltower-fips.") diff --git a/service/controltower/endpoints_test.go b/service/controltower/endpoints_test.go index 1703808decf..6bd48fdb5ac 100644 --- a/service/controltower/endpoints_test.go +++ b/service/controltower/endpoints_test.go @@ -1517,3 +1517,23 @@ func TestEndpointCase41(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Partition doesn't support DualStack +func TestEndpointCase42(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/controltower/generated.json b/service/controltower/generated.json index 2843d77fccb..427bd9d3f21 100644 --- a/service/controltower/generated.json +++ b/service/controltower/generated.json @@ -14,6 +14,9 @@ "api_op_GetControlOperation.go", "api_op_GetEnabledControl.go", "api_op_ListEnabledControls.go", + "api_op_ListTagsForResource.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/controltower/serializers.go b/service/controltower/serializers.go index 7b4f9d84f6b..35ebb575240 100644 --- a/service/controltower/serializers.go +++ b/service/controltower/serializers.go @@ -165,6 +165,13 @@ func awsRestjson1_serializeOpDocumentEnableControlInput(v *EnableControlInput, v ok.String(*v.ControlIdentifier) } + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + if v.TargetIdentifier != nil { ok := object.Key("targetIdentifier") ok.String(*v.TargetIdentifier) @@ -407,3 +414,240 @@ func awsRestjson1_serializeOpDocumentListEnabledControlsInput(v *ListEnabledCont return nil } + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} diff --git a/service/controltower/types/types.go b/service/controltower/types/types.go index d5c387cdd22..3bab8298443 100644 --- a/service/controltower/types/types.go +++ b/service/controltower/types/types.go @@ -77,22 +77,19 @@ type EnabledControlDetails struct { noSmithyDocumentSerde } -// A summary of enabled controls. +// Returns a summary of information about an enabled control. type EnabledControlSummary struct { // The ARN of the enabled control. Arn *string - // The ARN of the control. Only Strongly recommended and Elective controls are - // permitted, with the exception of the Region deny control. For information on how - // to find the controlIdentifier , see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) - // . + // The controlIdentifier of the enabled control. ControlIdentifier *string // The drift status of the enabled control. DriftStatusSummary *DriftStatusSummary - // + // A short description of the status of the enabled control. StatusSummary *EnablementStatusSummary // The ARN of the organizational unit. diff --git a/service/controltower/validators.go b/service/controltower/validators.go index a9d74503317..6f3c21cd60a 100644 --- a/service/controltower/validators.go +++ b/service/controltower/validators.go @@ -109,6 +109,66 @@ func (m *validateOpListEnabledControls) 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) +} + func addOpDisableControlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableControl{}, middleware.After) } @@ -129,6 +189,18 @@ func addOpListEnabledControlsValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListEnabledControls{}, 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 validateOpDisableControlInput(v *DisableControlInput) error { if v == nil { return nil @@ -209,3 +281,54 @@ func validateOpListEnabledControlsInput(v *ListEnabledControlsInput) error { return nil } } + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/costandusagereportservice/api_op_DeleteReportDefinition.go b/service/costandusagereportservice/api_op_DeleteReportDefinition.go index 72cbe8ee757..e6428aa92fc 100644 --- a/service/costandusagereportservice/api_op_DeleteReportDefinition.go +++ b/service/costandusagereportservice/api_op_DeleteReportDefinition.go @@ -15,7 +15,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the specified report. +// Deletes the specified report. Any tags associated with the report are also +// deleted. func (c *Client) DeleteReportDefinition(ctx context.Context, params *DeleteReportDefinitionInput, optFns ...func(*Options)) (*DeleteReportDefinitionOutput, error) { if params == nil { params = &DeleteReportDefinitionInput{} @@ -36,6 +37,8 @@ type DeleteReportDefinitionInput struct { // The name of the report that you want to delete. The name must be unique, is // case sensitive, and can't include spaces. + // + // This member is required. ReportName *string noSmithyDocumentSerde @@ -104,6 +107,9 @@ func (c *Client) addOperationDeleteReportDefinitionMiddlewares(stack *middleware if err = addDeleteReportDefinitionResolveEndpointMiddleware(stack, options); err != nil { return err } + if err = addOpDeleteReportDefinitionValidationMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteReportDefinition(options.Region), middleware.Before); err != nil { return err } diff --git a/service/costandusagereportservice/api_op_DescribeReportDefinitions.go b/service/costandusagereportservice/api_op_DescribeReportDefinitions.go index 5cf0ab463f6..23ac7cb26c0 100644 --- a/service/costandusagereportservice/api_op_DescribeReportDefinitions.go +++ b/service/costandusagereportservice/api_op_DescribeReportDefinitions.go @@ -16,7 +16,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the AWS Cost and Usage reports available to this account. +// Lists the Amazon Web Services Cost and Usage Report available to this account. func (c *Client) DescribeReportDefinitions(ctx context.Context, params *DescribeReportDefinitionsInput, optFns ...func(*Options)) (*DescribeReportDefinitionsOutput, error) { if params == nil { params = &DescribeReportDefinitionsInput{} @@ -32,10 +32,11 @@ func (c *Client) DescribeReportDefinitions(ctx context.Context, params *Describe return out, nil } -// Requests a list of AWS Cost and Usage reports owned by the account. +// Requests a Amazon Web Services Cost and Usage Report list owned by the account. type DescribeReportDefinitionsInput struct { - // The maximum number of results that AWS returns for the operation. + // The maximum number of results that Amazon Web Services returns for the + // operation. MaxResults *int32 // A generic string. @@ -50,7 +51,7 @@ type DescribeReportDefinitionsOutput struct { // A generic string. NextToken *string - // A list of AWS Cost and Usage reports owned by the account. + // An Amazon Web Services Cost and Usage Report list owned by the account. ReportDefinitions []types.ReportDefinition // Metadata pertaining to the operation's result. @@ -142,7 +143,8 @@ var _ DescribeReportDefinitionsAPIClient = (*Client)(nil) // DescribeReportDefinitionsPaginatorOptions is the paginator options for // DescribeReportDefinitions type DescribeReportDefinitionsPaginatorOptions struct { - // The maximum number of results that AWS returns for the operation. + // The maximum number of results that Amazon Web Services returns for the + // operation. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/costandusagereportservice/api_op_ListTagsForResource.go b/service/costandusagereportservice/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..7b92ab5cd3d --- /dev/null +++ b/service/costandusagereportservice/api_op_ListTagsForResource.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costandusagereportservice + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/costandusagereportservice/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the tags associated with the specified report definition. +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 report name of the report definition that tags are to be returned for. + // + // This member is required. + ReportName *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The tags assigned to the report definition resource. + Tags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + 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 = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addListTagsForResourceResolveEndpointMiddleware(stack, options); 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 = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cur", + OperationName: "ListTagsForResource", + } +} + +type opListTagsForResourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListTagsForResourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListTagsForResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "cur" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "cur" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("cur") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListTagsForResourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListTagsForResourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/costandusagereportservice/api_op_ModifyReportDefinition.go b/service/costandusagereportservice/api_op_ModifyReportDefinition.go index f746f60060c..c125db69c0a 100644 --- a/service/costandusagereportservice/api_op_ModifyReportDefinition.go +++ b/service/costandusagereportservice/api_op_ModifyReportDefinition.go @@ -16,7 +16,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Allows you to programatically update your report preferences. +// Allows you to programmatically update your report preferences. func (c *Client) ModifyReportDefinition(ctx context.Context, params *ModifyReportDefinitionInput, optFns ...func(*Options)) (*ModifyReportDefinitionOutput, error) { if params == nil { params = &ModifyReportDefinitionInput{} @@ -34,9 +34,9 @@ func (c *Client) ModifyReportDefinition(ctx context.Context, params *ModifyRepor type ModifyReportDefinitionInput struct { - // The definition of AWS Cost and Usage Report. You can specify the report name, - // time unit, report format, compression format, S3 bucket, additional artifacts, - // and schema elements in the definition. + // The definition of Amazon Web Services Cost and Usage Report. You can specify + // the report name, time unit, report format, compression format, S3 bucket, + // additional artifacts, and schema elements in the definition. // // This member is required. ReportDefinition *types.ReportDefinition diff --git a/service/costandusagereportservice/api_op_PutReportDefinition.go b/service/costandusagereportservice/api_op_PutReportDefinition.go index 2b5ef3bdbe1..1f3f18b8143 100644 --- a/service/costandusagereportservice/api_op_PutReportDefinition.go +++ b/service/costandusagereportservice/api_op_PutReportDefinition.go @@ -41,6 +41,9 @@ type PutReportDefinitionInput struct { // This member is required. ReportDefinition *types.ReportDefinition + // The tags to be assigned to the report definition resource. + Tags []types.Tag + noSmithyDocumentSerde } diff --git a/service/costandusagereportservice/api_op_TagResource.go b/service/costandusagereportservice/api_op_TagResource.go new file mode 100644 index 00000000000..ed95a558e3b --- /dev/null +++ b/service/costandusagereportservice/api_op_TagResource.go @@ -0,0 +1,262 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costandusagereportservice + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/costandusagereportservice/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a set of tags with a report definition. +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 report name of the report definition that tags are to be associated with. + // + // This member is required. + ReportName *string + + // The tags to be assigned to the report definition resource. + // + // This member is required. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + 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 = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addTagResourceResolveEndpointMiddleware(stack, options); 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 = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cur", + OperationName: "TagResource", + } +} + +type opTagResourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opTagResourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opTagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "cur" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "cur" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("cur") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addTagResourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opTagResourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/costandusagereportservice/api_op_UntagResource.go b/service/costandusagereportservice/api_op_UntagResource.go new file mode 100644 index 00000000000..af4eab30452 --- /dev/null +++ b/service/costandusagereportservice/api_op_UntagResource.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costandusagereportservice + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disassociates a set of tags from a report definition. +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 report name of the report definition that tags are to be disassociated from. + // + // This member is required. + ReportName *string + + // The tags to be disassociated from the report definition resource. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + 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 = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addUntagResourceResolveEndpointMiddleware(stack, options); 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 = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cur", + OperationName: "UntagResource", + } +} + +type opUntagResourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUntagResourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUntagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "cur" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "cur" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("cur") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUntagResourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUntagResourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/costandusagereportservice/deserializers.go b/service/costandusagereportservice/deserializers.go index 02f71489448..28f4289459b 100644 --- a/service/costandusagereportservice/deserializers.go +++ b/service/costandusagereportservice/deserializers.go @@ -243,6 +243,123 @@ func awsAwsjson11_deserializeOpErrorDescribeReportDefinitions(response *smithyht } } +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)} + } + 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("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpModifyReportDefinition struct { } @@ -464,6 +581,9 @@ func awsAwsjson11_deserializeOpErrorPutReportDefinition(response *smithyhttp.Res case strings.EqualFold("ReportLimitReachedException", errorCode): return awsAwsjson11_deserializeErrorReportLimitReachedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsAwsjson11_deserializeErrorValidationException(response, errorBody) @@ -477,7 +597,276 @@ func awsAwsjson11_deserializeOpErrorPutReportDefinition(response *smithyhttp.Res } } -func awsAwsjson11_deserializeErrorDuplicateReportNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +type awsAwsjson11_deserializeOpTagResource struct { +} + +func (*awsAwsjson11_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +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) + 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_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + 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_deserializeOpDocumentTagResourceOutput(&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_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagResource struct { +} + +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +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) + 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_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + 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_deserializeOpDocumentUntagResourceOutput(&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_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_deserializeErrorDuplicateReportNameException(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.DuplicateReportNameException{} + err := awsAwsjson11_deserializeDocumentDuplicateReportNameException(&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_deserializeErrorInternalErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -495,8 +884,8 @@ func awsAwsjson11_deserializeErrorDuplicateReportNameException(response *smithyh return err } - output := &types.DuplicateReportNameException{} - err := awsAwsjson11_deserializeDocumentDuplicateReportNameException(&output, shape) + output := &types.InternalErrorException{} + err := awsAwsjson11_deserializeDocumentInternalErrorException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -512,7 +901,7 @@ func awsAwsjson11_deserializeErrorDuplicateReportNameException(response *smithyh return output } -func awsAwsjson11_deserializeErrorInternalErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorReportLimitReachedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -530,8 +919,8 @@ func awsAwsjson11_deserializeErrorInternalErrorException(response *smithyhttp.Re return err } - output := &types.InternalErrorException{} - err := awsAwsjson11_deserializeDocumentInternalErrorException(&output, shape) + output := &types.ReportLimitReachedException{} + err := awsAwsjson11_deserializeDocumentReportLimitReachedException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -547,7 +936,7 @@ func awsAwsjson11_deserializeErrorInternalErrorException(response *smithyhttp.Re return output } -func awsAwsjson11_deserializeErrorReportLimitReachedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -565,8 +954,8 @@ func awsAwsjson11_deserializeErrorReportLimitReachedException(response *smithyht return err } - output := &types.ReportLimitReachedException{} - err := awsAwsjson11_deserializeDocumentReportLimitReachedException(&output, shape) + output := &types.ResourceNotFoundException{} + err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -810,6 +1199,11 @@ func awsAwsjson11_deserializeDocumentReportDefinition(v **types.ReportDefinition sv.ReportName = ptr.String(jtv) } + case "ReportStatus": + if err := awsAwsjson11_deserializeDocumentReportStatus(&sv.ReportStatus, value); err != nil { + return err + } + case "ReportVersioning": if value != nil { jtv, ok := value.(string) @@ -938,6 +1332,95 @@ func awsAwsjson11_deserializeDocumentReportLimitReachedException(v **types.Repor return nil } +func awsAwsjson11_deserializeDocumentReportStatus(v **types.ReportStatus, 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.ReportStatus + if *v == nil { + sv = &types.ReportStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "lastDelivery": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LastDelivery to be of type string, got %T instead", value) + } + sv.LastDelivery = ptr.String(jtv) + } + + case "lastStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LastStatus to be of type string, got %T instead", value) + } + sv.LastStatus = types.LastStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentSchemaElementList(v *[]types.SchemaElement, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -974,6 +1457,89 @@ func awsAwsjson11_deserializeDocumentSchemaElementList(v *[]types.SchemaElement, return nil } +func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey 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 TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1099,6 +1665,42 @@ func awsAwsjson11_deserializeOpDocumentDescribeReportDefinitionsOutput(v **Descr 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 "Tags": + if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentModifyReportDefinitionOutput(v **ModifyReportDefinitionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1160,3 +1762,65 @@ func awsAwsjson11_deserializeOpDocumentPutReportDefinitionOutput(v **PutReportDe *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 +} diff --git a/service/costandusagereportservice/doc.go b/service/costandusagereportservice/doc.go index 4ab7e16dbfa..36418e8d48b 100644 --- a/service/costandusagereportservice/doc.go +++ b/service/costandusagereportservice/doc.go @@ -3,13 +3,15 @@ // Package costandusagereportservice provides the API client, operations, and // parameter types for AWS Cost and Usage Report Service. // -// The AWS Cost and Usage Report API enables you to programmatically create, -// query, and delete AWS Cost and Usage report definitions. AWS Cost and Usage -// reports track the monthly AWS costs and usage associated with your AWS account. -// The report contains line items for each unique combination of AWS product, usage -// type, and operation that your AWS account uses. You can configure the AWS Cost -// and Usage report to show only the data that you want, using the AWS Cost and -// Usage API. Service Endpoint The AWS Cost and Usage Report API provides the -// following endpoint: +// You can use the Amazon Web Services Cost and Usage Report API to +// programmatically create, query, and delete Amazon Web Services Cost and Usage +// Report definitions. Amazon Web Services Cost and Usage Report track the monthly +// Amazon Web Services costs and usage associated with your Amazon Web Services +// account. The report contains line items for each unique combination of Amazon +// Web Services product, usage type, and operation that your Amazon Web Services +// account uses. You can configure the Amazon Web Services Cost and Usage Report to +// show only the data that you want, using the Amazon Web Services Cost and Usage +// Report API. Service Endpoint The Amazon Web Services Cost and Usage Report API +// provides the following endpoint: // - cur.us-east-1.amazonaws.com package costandusagereportservice diff --git a/service/costandusagereportservice/endpoints.go b/service/costandusagereportservice/endpoints.go index e7043c669ae..e3f478f7fb7 100644 --- a/service/costandusagereportservice/endpoints.go +++ b/service/costandusagereportservice/endpoints.go @@ -430,7 +430,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://cur-fips.") diff --git a/service/costandusagereportservice/generated.json b/service/costandusagereportservice/generated.json index d8a9fc0a5a4..febc5ea1623 100644 --- a/service/costandusagereportservice/generated.json +++ b/service/costandusagereportservice/generated.json @@ -11,8 +11,11 @@ "api_client_test.go", "api_op_DeleteReportDefinition.go", "api_op_DescribeReportDefinitions.go", + "api_op_ListTagsForResource.go", "api_op_ModifyReportDefinition.go", "api_op_PutReportDefinition.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/costandusagereportservice/serializers.go b/service/costandusagereportservice/serializers.go index 3a7b0bd12aa..26e4f4e6735 100644 --- a/service/costandusagereportservice/serializers.go +++ b/service/costandusagereportservice/serializers.go @@ -125,6 +125,61 @@ func (m *awsAwsjson11_serializeOpDescribeReportDefinitions) HandleSerialize(ctx 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("AWSOrigamiServiceGatewayService.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_serializeOpModifyReportDefinition struct { } @@ -234,6 +289,116 @@ func (m *awsAwsjson11_serializeOpPutReportDefinition) HandleSerialize(ctx contex 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("AWSOrigamiServiceGatewayService.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("AWSOrigamiServiceGatewayService.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) +} func awsAwsjson11_serializeDocumentAdditionalArtifactList(v []types.AdditionalArtifact, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -288,6 +453,13 @@ func awsAwsjson11_serializeDocumentReportDefinition(v *types.ReportDefinition, v ok.String(*v.ReportName) } + if v.ReportStatus != nil { + ok := object.Key("ReportStatus") + if err := awsAwsjson11_serializeDocumentReportStatus(v.ReportStatus, ok); err != nil { + return err + } + } + if len(v.ReportVersioning) > 0 { ok := object.Key("ReportVersioning") ok.String(string(v.ReportVersioning)) @@ -316,6 +488,23 @@ func awsAwsjson11_serializeDocumentReportDefinition(v *types.ReportDefinition, v return nil } +func awsAwsjson11_serializeDocumentReportStatus(v *types.ReportStatus, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LastDelivery != nil { + ok := object.Key("lastDelivery") + ok.String(*v.LastDelivery) + } + + if len(v.LastStatus) > 0 { + ok := object.Key("lastStatus") + ok.String(string(v.LastStatus)) + } + + return nil +} + func awsAwsjson11_serializeDocumentSchemaElementList(v []types.SchemaElement, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -327,6 +516,47 @@ func awsAwsjson11_serializeDocumentSchemaElementList(v []types.SchemaElement, va return nil } +func awsAwsjson11_serializeDocumentTag(v *types.Tag, 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_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteReportDefinitionInput(v *DeleteReportDefinitionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -356,6 +586,18 @@ func awsAwsjson11_serializeOpDocumentDescribeReportDefinitionsInput(v *DescribeR return nil } +func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ReportName != nil { + ok := object.Key("ReportName") + ok.String(*v.ReportName) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentModifyReportDefinitionInput(v *ModifyReportDefinitionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -386,5 +628,50 @@ func awsAwsjson11_serializeOpDocumentPutReportDefinitionInput(v *PutReportDefini } } + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ReportName != nil { + ok := object.Key("ReportName") + ok.String(*v.ReportName) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ReportName != nil { + ok := object.Key("ReportName") + ok.String(*v.ReportName) + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { + return err + } + } + return nil } diff --git a/service/costandusagereportservice/types/enums.go b/service/costandusagereportservice/types/enums.go index d02b8521edb..94443aa98ed 100644 --- a/service/costandusagereportservice/types/enums.go +++ b/service/costandusagereportservice/types/enums.go @@ -112,6 +112,26 @@ func (CompressionFormat) Values() []CompressionFormat { } } +type LastStatus string + +// Enum values for LastStatus +const ( + LastStatusSuccess LastStatus = "SUCCESS" + LastStatusErrorPermissions LastStatus = "ERROR_PERMISSIONS" + LastStatusErrorNoBucket LastStatus = "ERROR_NO_BUCKET" +) + +// Values returns all known values for LastStatus. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (LastStatus) Values() []LastStatus { + return []LastStatus{ + "SUCCESS", + "ERROR_PERMISSIONS", + "ERROR_NO_BUCKET", + } +} + type ReportFormat string // Enum values for ReportFormat @@ -152,8 +172,9 @@ type SchemaElement string // Enum values for SchemaElement const ( - SchemaElementResources SchemaElement = "RESOURCES" - SchemaElementSplitCostAllocationData SchemaElement = "SPLIT_COST_ALLOCATION_DATA" + SchemaElementResources SchemaElement = "RESOURCES" + SchemaElementSplitCostAllocationData SchemaElement = "SPLIT_COST_ALLOCATION_DATA" + SchemaElementManualDiscountCompatibility SchemaElement = "MANUAL_DISCOUNT_COMPATIBILITY" ) // Values returns all known values for SchemaElement. Note that this can be @@ -163,6 +184,7 @@ func (SchemaElement) Values() []SchemaElement { return []SchemaElement{ "RESOURCES", "SPLIT_COST_ALLOCATION_DATA", + "MANUAL_DISCOUNT_COMPATIBILITY", } } diff --git a/service/costandusagereportservice/types/errors.go b/service/costandusagereportservice/types/errors.go index 626faf11900..5df6b2c656e 100644 --- a/service/costandusagereportservice/types/errors.go +++ b/service/costandusagereportservice/types/errors.go @@ -88,7 +88,34 @@ func (e *ReportLimitReachedException) ErrorCode() string { } func (e *ReportLimitReachedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The input fails to satisfy the constraints specified by an AWS service. +// The specified report ( ReportName ) in the request doesn't exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an Amazon Web Services +// service. type ValidationException struct { Message *string diff --git a/service/costandusagereportservice/types/types.go b/service/costandusagereportservice/types/types.go index a3f32dfe472..d393f9f7642 100644 --- a/service/costandusagereportservice/types/types.go +++ b/service/costandusagereportservice/types/types.go @@ -6,9 +6,9 @@ import ( smithydocument "github.com/aws/smithy-go/document" ) -// The definition of AWS Cost and Usage Report. You can specify the report name, -// time unit, report format, compression format, S3 bucket, additional artifacts, -// and schema elements in the definition. +// The definition of Amazon Web Services Cost and Usage Report. You can specify +// the report name, time unit, report format, compression format, S3 bucket, +// additional artifacts, and schema elements in the definition. type ReportDefinition struct { // A list of strings that indicate additional content that Amazon Web Services @@ -17,12 +17,12 @@ type ReportDefinition struct { // This member is required. AdditionalSchemaElements []SchemaElement - // The compression format that AWS uses for the report. + // The compression format that Amazon Web Services uses for the report. // // This member is required. Compression CompressionFormat - // The format that AWS saves the report in. + // The format that Amazon Web Services saves the report in. // // This member is required. Format ReportFormat @@ -33,18 +33,18 @@ type ReportDefinition struct { // This member is required. ReportName *string - // The S3 bucket where AWS delivers the report. + // The S3 bucket where Amazon Web Services delivers the report. // // This member is required. S3Bucket *string - // The prefix that AWS adds to the report name when AWS delivers the report. Your - // prefix can't include spaces. + // The prefix that Amazon Web Services adds to the report name when Amazon Web + // Services delivers the report. Your prefix can't include spaces. // // This member is required. S3Prefix *string - // The region of the S3 bucket that AWS delivers the report into. + // The region of the S3 bucket that Amazon Web Services delivers the report into. // // This member is required. S3Region AWSRegion @@ -57,8 +57,11 @@ type ReportDefinition struct { // A list of manifests that you want Amazon Web Services to create for this report. AdditionalArtifacts []AdditionalArtifact - // The Amazon resource name of the billing view. You can get this value by using - // the billing view service public APIs. + // The Amazon resource name of the billing view. The BillingViewArn is needed to + // create Amazon Web Services Cost and Usage Report for each billing group + // maintained in the Amazon Web Services Billing Conductor service. The + // BillingViewArn for a billing group can be constructed as: + // arn:aws:billing::payer-account-id:billingview/billing-group-primary-account-id BillingViewArn *string // Whether you want Amazon Web Services to update your reports after they have @@ -66,6 +69,9 @@ type ReportDefinition struct { // months. These charges can include refunds, credits, or support fees. RefreshClosedReports *bool + // The status of the report. + ReportStatus *ReportStatus + // Whether you want Amazon Web Services to overwrite the previous version of each // report or to deliver the report in addition to the previous versions. ReportVersioning ReportVersioning @@ -73,4 +79,38 @@ type ReportDefinition struct { noSmithyDocumentSerde } +// A two element dictionary with a lastDelivery and lastStatus key whose values +// describe the date and status of the last delivered report for a particular +// report definition. +type ReportStatus struct { + + // A timestamp that gives the date of a report delivery. + LastDelivery *string + + // An enum that gives the status of a report delivery. + LastStatus LastStatus + + noSmithyDocumentSerde +} + +// Describes a tag. A tag is a key-value pair. You can add up to 50 tags to a +// report definition. +type Tag struct { + + // The key of the tag. Tag keys are case sensitive. Each report definition can + // only have up to one tag with the same key. If you try to add an existing tag + // with the same key, the existing tag value will be updated to the new value. + // + // This member is required. + Key *string + + // The value of the tag. Tag values are case-sensitive. This can be an empty + // string. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/costandusagereportservice/validators.go b/service/costandusagereportservice/validators.go index 7ed8e05c513..ed1ddde577c 100644 --- a/service/costandusagereportservice/validators.go +++ b/service/costandusagereportservice/validators.go @@ -10,6 +10,46 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpDeleteReportDefinition struct { +} + +func (*validateOpDeleteReportDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteReportDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteReportDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteReportDefinitionInput(input); err != nil { + return out, metadata, err + } + 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 validateOpModifyReportDefinition struct { } @@ -50,6 +90,54 @@ func (m *validateOpPutReportDefinition) HandleInitialize(ctx context.Context, in 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) +} + +func addOpDeleteReportDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteReportDefinition{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + func addOpModifyReportDefinitionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpModifyReportDefinition{}, middleware.After) } @@ -58,6 +146,14 @@ func addOpPutReportDefinitionValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpPutReportDefinition{}, 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 validateReportDefinition(v *types.ReportDefinition) error { if v == nil { return nil @@ -94,6 +190,71 @@ func validateReportDefinition(v *types.ReportDefinition) error { } } +func validateTag(v *types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Tag"} + 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 validateTagList(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagList"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteReportDefinitionInput(v *DeleteReportDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteReportDefinitionInput"} + if v.ReportName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ReportName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ReportName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ReportName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpModifyReportDefinitionInput(v *ModifyReportDefinitionInput) error { if v == nil { return nil @@ -128,6 +289,51 @@ func validateOpPutReportDefinitionInput(v *PutReportDefinitionInput) error { invalidParams.AddNested("ReportDefinition", err.(smithy.InvalidParamsError)) } } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ReportName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ReportName")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } else if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ReportName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ReportName")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/ec2/api_op_DescribeInstances.go b/service/ec2/api_op_DescribeInstances.go index db36a1c8747..57770c887eb 100644 --- a/service/ec2/api_op_DescribeInstances.go +++ b/service/ec2/api_op_DescribeInstances.go @@ -111,8 +111,8 @@ type DescribeInstancesInput struct { // instance. Specified as an name. // - image-id - The ID of the image used to launch the instance. // - instance-id - The ID of the instance. - // - instance-lifecycle - Indicates whether this is a Spot Instance or a - // Scheduled Instance ( spot | scheduled ). + // - instance-lifecycle - Indicates whether this is a Spot Instance, a Scheduled + // Instance, or a Capacity Block ( spot | scheduled | capacity-block ). // - instance-state-code - The state of the instance, as a 16-bit unsigned // integer. The high byte is used for internal purposes and should be ignored. The // low byte is set based on the state represented. The valid values are: 0 diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index b061cd62cb4..8d0559ec83c 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -70837,6 +70837,116 @@ func awsEc2query_deserializeDocumentEnableFastSnapshotRestoreSuccessSetUnwrapped *v = sv return nil } +func awsEc2query_deserializeDocumentEnaSrdSpecificationRequest(v **types.EnaSrdSpecificationRequest, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EnaSrdSpecificationRequest + if *v == nil { + sv = &types.EnaSrdSpecificationRequest{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EnaSrdEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.EnaSrdEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("EnaSrdUdpSpecification", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentEnaSrdUdpSpecificationRequest(&sv.EnaSrdUdpSpecification, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentEnaSrdUdpSpecificationRequest(v **types.EnaSrdUdpSpecificationRequest, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EnaSrdUdpSpecificationRequest + if *v == nil { + sv = &types.EnaSrdUdpSpecificationRequest{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EnaSrdUdpEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.EnaSrdUdpEnabled = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeDocumentEnclaveOptions(v **types.EnclaveOptions, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -80272,6 +80382,116 @@ func awsEc2query_deserializeDocumentInstance(v **types.Instance, decoder smithyx return nil } +func awsEc2query_deserializeDocumentInstanceAttachmentEnaSrdSpecification(v **types.InstanceAttachmentEnaSrdSpecification, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InstanceAttachmentEnaSrdSpecification + if *v == nil { + sv = &types.InstanceAttachmentEnaSrdSpecification{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("enaSrdEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.EnaSrdEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("enaSrdUdpSpecification", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentInstanceAttachmentEnaSrdUdpSpecification(&sv.EnaSrdUdpSpecification, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentInstanceAttachmentEnaSrdUdpSpecification(v **types.InstanceAttachmentEnaSrdUdpSpecification, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InstanceAttachmentEnaSrdUdpSpecification + if *v == nil { + sv = &types.InstanceAttachmentEnaSrdUdpSpecification{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("enaSrdUdpEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.EnaSrdUdpEnabled = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeDocumentInstanceBlockDeviceMapping(v **types.InstanceBlockDeviceMapping, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -82843,6 +83063,12 @@ func awsEc2query_deserializeDocumentInstanceNetworkInterfaceAttachment(v **types sv.DeviceIndex = ptr.Int32(int32(i64)) } + case strings.EqualFold("enaSrdSpecification", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentInstanceAttachmentEnaSrdSpecification(&sv.EnaSrdSpecification, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("networkCardIndex", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -83055,6 +83281,12 @@ func awsEc2query_deserializeDocumentInstanceNetworkInterfaceSpecification(v **ty sv.DeviceIndex = ptr.Int32(int32(i64)) } + case strings.EqualFold("EnaSrdSpecification", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentEnaSrdSpecificationRequest(&sv.EnaSrdSpecification, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("SecurityGroupId", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsEc2query_deserializeDocumentSecurityGroupIdStringList(&sv.Groups, nodeDecoder); err != nil { @@ -92270,6 +92502,116 @@ func awsEc2query_deserializeDocumentLaunchTemplateElasticInferenceAcceleratorRes *v = sv return nil } +func awsEc2query_deserializeDocumentLaunchTemplateEnaSrdSpecification(v **types.LaunchTemplateEnaSrdSpecification, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LaunchTemplateEnaSrdSpecification + if *v == nil { + sv = &types.LaunchTemplateEnaSrdSpecification{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("enaSrdEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.EnaSrdEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("enaSrdUdpSpecification", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentLaunchTemplateEnaSrdUdpSpecification(&sv.EnaSrdUdpSpecification, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentLaunchTemplateEnaSrdUdpSpecification(v **types.LaunchTemplateEnaSrdUdpSpecification, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LaunchTemplateEnaSrdUdpSpecification + if *v == nil { + sv = &types.LaunchTemplateEnaSrdUdpSpecification{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("enaSrdUdpEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.EnaSrdUdpEnabled = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeDocumentLaunchTemplateEnclaveOptions(v **types.LaunchTemplateEnclaveOptions, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -92758,6 +93100,12 @@ func awsEc2query_deserializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecif sv.DeviceIndex = ptr.Int32(int32(i64)) } + case strings.EqualFold("enaSrdSpecification", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentLaunchTemplateEnaSrdSpecification(&sv.EnaSrdSpecification, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("groupSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsEc2query_deserializeDocumentGroupIdStringList(&sv.Groups, nodeDecoder); err != nil { diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 06f6cb9c2ab..b6ac361ab71 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -40255,6 +40255,25 @@ func awsEc2query_serializeDocumentEnaSrdSpecification(v *types.EnaSrdSpecificati return nil } +func awsEc2query_serializeDocumentEnaSrdSpecificationRequest(v *types.EnaSrdSpecificationRequest, value query.Value) error { + object := value.Object() + _ = object + + if v.EnaSrdEnabled != nil { + objectKey := object.Key("EnaSrdEnabled") + objectKey.Boolean(*v.EnaSrdEnabled) + } + + if v.EnaSrdUdpSpecification != nil { + objectKey := object.Key("EnaSrdUdpSpecification") + if err := awsEc2query_serializeDocumentEnaSrdUdpSpecificationRequest(v.EnaSrdUdpSpecification, objectKey); err != nil { + return err + } + } + + return nil +} + func awsEc2query_serializeDocumentEnaSrdUdpSpecification(v *types.EnaSrdUdpSpecification, value query.Value) error { object := value.Object() _ = object @@ -40267,6 +40286,18 @@ func awsEc2query_serializeDocumentEnaSrdUdpSpecification(v *types.EnaSrdUdpSpeci return nil } +func awsEc2query_serializeDocumentEnaSrdUdpSpecificationRequest(v *types.EnaSrdUdpSpecificationRequest, value query.Value) error { + object := value.Object() + _ = object + + if v.EnaSrdUdpEnabled != nil { + objectKey := object.Key("EnaSrdUdpEnabled") + objectKey.Boolean(*v.EnaSrdUdpEnabled) + } + + return nil +} + func awsEc2query_serializeDocumentEnclaveOptionsRequest(v *types.EnclaveOptionsRequest, value query.Value) error { object := value.Object() _ = object @@ -41381,6 +41412,13 @@ func awsEc2query_serializeDocumentInstanceNetworkInterfaceSpecification(v *types objectKey.Integer(*v.DeviceIndex) } + if v.EnaSrdSpecification != nil { + objectKey := object.Key("EnaSrdSpecification") + if err := awsEc2query_serializeDocumentEnaSrdSpecificationRequest(v.EnaSrdSpecification, objectKey); err != nil { + return err + } + } + if v.Groups != nil { objectKey := object.FlatKey("SecurityGroupId") if err := awsEc2query_serializeDocumentSecurityGroupIdStringList(v.Groups, objectKey); err != nil { @@ -42560,6 +42598,13 @@ func awsEc2query_serializeDocumentLaunchTemplateInstanceNetworkInterfaceSpecific objectKey.Integer(*v.DeviceIndex) } + if v.EnaSrdSpecification != nil { + objectKey := object.Key("EnaSrdSpecification") + if err := awsEc2query_serializeDocumentEnaSrdSpecificationRequest(v.EnaSrdSpecification, objectKey); err != nil { + return err + } + } + if v.Groups != nil { objectKey := object.FlatKey("SecurityGroupId") if err := awsEc2query_serializeDocumentSecurityGroupIdStringList(v.Groups, objectKey); err != nil { diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index d595ec9e931..3abd1b3128f 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -612,22 +612,33 @@ type AthenaIntegration struct { noSmithyDocumentSerde } -// Describes the ENA Express configuration for the network interface that's -// attached to the instance. +// ENA Express uses Amazon Web Services Scalable Reliable Datagram (SRD) +// technology to increase the maximum bandwidth used per stream and minimize tail +// latency of network traffic between EC2 instances. With ENA Express, you can +// communicate between two EC2 instances in the same subnet within the same +// account, or in different accounts. Both sending and receiving instances must +// have ENA Express enabled. To improve the reliability of network packet delivery, +// ENA Express reorders network packets on the receiving end by default. However, +// some UDP-based applications are designed to handle network packets that are out +// of order to reduce the overhead for packet delivery at the network layer. When +// ENA Express is enabled, you can specify whether UDP network traffic uses it. type AttachmentEnaSrdSpecification struct { - // Indicates whether ENA Express is enabled for the network interface that's - // attached to the instance. + // Indicates whether ENA Express is enabled for the network interface. EnaSrdEnabled *bool - // ENA Express configuration for UDP network traffic. + // Configures ENA Express for UDP network traffic. EnaSrdUdpSpecification *AttachmentEnaSrdUdpSpecification noSmithyDocumentSerde } -// Describes the ENA Express configuration for UDP traffic on the network -// interface that's attached to the instance. +// ENA Express is compatible with both TCP and UDP transport protocols. When it's +// enabled, TCP traffic automatically uses it. However, some UDP-based applications +// are designed to handle network packets that are out of order, without a need for +// retransmission, such as live video broadcasting or other near-real-time +// applications. For UDP traffic, you can specify whether to use ENA Express, based +// on your application environment needs. type AttachmentEnaSrdUdpSpecification struct { // Indicates whether UDP traffic to and from the instance uses ENA Express. To @@ -3408,7 +3419,20 @@ type EnaSrdSpecification struct { noSmithyDocumentSerde } -// ENA Express is compatible with both TCP and UDP transport protocols. When it’s +// Launch instances with ENA Express settings configured from your launch template. +type EnaSrdSpecificationRequest struct { + + // Specifies whether ENA Express is enabled for the network interface when you + // launch an instance from your launch template. + EnaSrdEnabled *bool + + // Contains ENA Express settings for UDP network traffic in your launch template. + EnaSrdUdpSpecification *EnaSrdUdpSpecificationRequest + + noSmithyDocumentSerde +} + +// ENA Express is compatible with both TCP and UDP transport protocols. When it's // enabled, TCP traffic automatically uses it. However, some UDP-based applications // are designed to handle network packets that are out of order, without a need for // retransmission, such as live video broadcasting or other near-real-time @@ -3416,8 +3440,20 @@ type EnaSrdSpecification struct { // on your application environment needs. type EnaSrdUdpSpecification struct { - // Indicates whether UDP traffic uses ENA Express. To specify this setting, you - // must first enable ENA Express. + // Indicates whether UDP traffic to and from the instance uses ENA Express. To + // specify this setting, you must first enable ENA Express. + EnaSrdUdpEnabled *bool + + noSmithyDocumentSerde +} + +// Configures ENA Express for UDP network traffic from your launch template. +type EnaSrdUdpSpecificationRequest struct { + + // Indicates whether UDP traffic uses ENA Express for your instance. To ensure + // that UDP traffic can use ENA Express when you launch an instance, you must also + // set EnaSrdEnabled in the EnaSrdSpecificationRequest to true in your launch + // template. EnaSrdUdpEnabled *bool noSmithyDocumentSerde @@ -5654,6 +5690,42 @@ type Instance struct { noSmithyDocumentSerde } +// ENA Express uses Amazon Web Services Scalable Reliable Datagram (SRD) +// technology to increase the maximum bandwidth used per stream and minimize tail +// latency of network traffic between EC2 instances. With ENA Express, you can +// communicate between two EC2 instances in the same subnet within the same +// account, or in different accounts. Both sending and receiving instances must +// have ENA Express enabled. To improve the reliability of network packet delivery, +// ENA Express reorders network packets on the receiving end by default. However, +// some UDP-based applications are designed to handle network packets that are out +// of order to reduce the overhead for packet delivery at the network layer. When +// ENA Express is enabled, you can specify whether UDP network traffic uses it. +type InstanceAttachmentEnaSrdSpecification struct { + + // Indicates whether ENA Express is enabled for the network interface. + EnaSrdEnabled *bool + + // Configures ENA Express for UDP network traffic. + EnaSrdUdpSpecification *InstanceAttachmentEnaSrdUdpSpecification + + noSmithyDocumentSerde +} + +// ENA Express is compatible with both TCP and UDP transport protocols. When it's +// enabled, TCP traffic automatically uses it. However, some UDP-based applications +// are designed to handle network packets that are out of order, without a need for +// retransmission, such as live video broadcasting or other near-real-time +// applications. For UDP traffic, you can specify whether to use ENA Express, based +// on your application environment needs. +type InstanceAttachmentEnaSrdUdpSpecification struct { + + // Indicates whether UDP traffic to and from the instance uses ENA Express. To + // specify this setting, you must first enable ENA Express. + EnaSrdUdpEnabled *bool + + noSmithyDocumentSerde +} + // Describes a block device mapping. type InstanceBlockDeviceMapping struct { @@ -6171,6 +6243,10 @@ type InstanceNetworkInterfaceAttachment struct { // The index of the device on the instance for the network interface attachment. DeviceIndex *int32 + // Contains the ENA Express settings for the network interface that's attached to + // the instance. + EnaSrdSpecification *InstanceAttachmentEnaSrdSpecification + // The index of the network card. NetworkCardIndex *int32 @@ -6211,6 +6287,10 @@ type InstanceNetworkInterfaceSpecification struct { // when launching an instance, you must specify the device index. DeviceIndex *int32 + // Specifies the ENA Express settings for the network interface that's attached to + // the instance. + EnaSrdSpecification *EnaSrdSpecificationRequest + // The IDs of the security groups for the network interface. Applies only if // creating a network interface when launching an instance. Groups []string @@ -8373,6 +8453,42 @@ type LaunchTemplateElasticInferenceAcceleratorResponse struct { noSmithyDocumentSerde } +// ENA Express uses Amazon Web Services Scalable Reliable Datagram (SRD) +// technology to increase the maximum bandwidth used per stream and minimize tail +// latency of network traffic between EC2 instances. With ENA Express, you can +// communicate between two EC2 instances in the same subnet within the same +// account, or in different accounts. Both sending and receiving instances must +// have ENA Express enabled. To improve the reliability of network packet delivery, +// ENA Express reorders network packets on the receiving end by default. However, +// some UDP-based applications are designed to handle network packets that are out +// of order to reduce the overhead for packet delivery at the network layer. When +// ENA Express is enabled, you can specify whether UDP network traffic uses it. +type LaunchTemplateEnaSrdSpecification struct { + + // Indicates whether ENA Express is enabled for the network interface. + EnaSrdEnabled *bool + + // Configures ENA Express for UDP network traffic. + EnaSrdUdpSpecification *LaunchTemplateEnaSrdUdpSpecification + + noSmithyDocumentSerde +} + +// ENA Express is compatible with both TCP and UDP transport protocols. When it's +// enabled, TCP traffic automatically uses it. However, some UDP-based applications +// are designed to handle network packets that are out of order, without a need for +// retransmission, such as live video broadcasting or other near-real-time +// applications. For UDP traffic, you can specify whether to use ENA Express, based +// on your application environment needs. +type LaunchTemplateEnaSrdUdpSpecification struct { + + // Indicates whether UDP traffic to and from the instance uses ENA Express. To + // specify this setting, you must first enable ENA Express. + EnaSrdUdpEnabled *bool + + noSmithyDocumentSerde +} + // Indicates whether the instance is enabled for Amazon Web Services Nitro // Enclaves. type LaunchTemplateEnclaveOptions struct { @@ -8599,6 +8715,10 @@ type LaunchTemplateInstanceNetworkInterfaceSpecification struct { // The device index for the network interface attachment. DeviceIndex *int32 + // Contains the ENA Express settings for instances launched from your launch + // template. + EnaSrdSpecification *LaunchTemplateEnaSrdSpecification + // The IDs of one or more security groups. Groups []string @@ -8676,6 +8796,9 @@ type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct { // The device index for the network interface attachment. DeviceIndex *int32 + // Configure ENA Express settings for your launch template. + EnaSrdSpecification *EnaSrdSpecificationRequest + // The IDs of one or more security groups. Groups []string @@ -9035,9 +9158,9 @@ type LaunchTemplateTagSpecificationRequest struct { // The type of resource to tag. Valid Values lists all resource types for Amazon // EC2 that can be tagged. When you create a launch template, you can specify tags // for the following resource types only: instance | volume | elastic-gpu | - // network-interface | spot-instances-request . If the instance does include the - // resource type that you specify, the instance launch fails. For example, not all - // instance types include an Elastic GPU. To tag a resource after it has been + // network-interface | spot-instances-request . If the instance does not include + // the resource type that you specify, the instance launch fails. For example, not + // all instance types include an Elastic GPU. To tag a resource after it has been // created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html) // . ResourceType ResourceType @@ -11851,13 +11974,11 @@ type RequestLaunchTemplateData struct { // One or more security group IDs. You can create a security group using // CreateSecurityGroup (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html) - // . You cannot specify both a security group ID and security name in the same - // request. + // . SecurityGroupIds []string // One or more security group names. For a nondefault VPC, you must use security - // group IDs instead. You cannot specify both a security group ID and security name - // in the same request. + // group IDs instead. SecurityGroups []string // The tags to apply to the resources that are created during instance launch. You diff --git a/service/fms/api_op_DeletePolicy.go b/service/fms/api_op_DeletePolicy.go index 03e6614bf16..f722f86229b 100644 --- a/service/fms/api_op_DeletePolicy.go +++ b/service/fms/api_op_DeletePolicy.go @@ -49,13 +49,16 @@ type DeletePolicyInput struct { // - Disassociates the security group from in-scope resources // - Deletes the security group if it was created through Firewall Manager and // if it's no longer associated with any resources through another policy - // After the cleanup, in-scope resources are no longer protected by web ACLs in - // this policy. Protection of out-of-scope resources remains unchanged. Scope is - // determined by tags that you create and accounts that you associate with the - // policy. When creating the policy, if you specify that only resources in specific - // accounts or with specific tags are in scope of the policy, those accounts and - // resources are handled by the policy. All others are out of scope. If you don't - // specify tags or accounts, all resources are in scope. + // For security group common policies, even if set to False , Firewall Manager + // deletes all security groups created by Firewall Manager that aren't associated + // with any other resources through another policy. After the cleanup, in-scope + // resources are no longer protected by web ACLs in this policy. Protection of + // out-of-scope resources remains unchanged. Scope is determined by tags that you + // create and accounts that you associate with the policy. When creating the + // policy, if you specify that only resources in specific accounts or with specific + // tags are in scope of the policy, those accounts and resources are handled by the + // policy. All others are out of scope. If you don't specify tags or accounts, all + // resources are in scope. DeleteAllPolicyResources bool noSmithyDocumentSerde diff --git a/service/fms/api_op_GetViolationDetails.go b/service/fms/api_op_GetViolationDetails.go index 4e60e518383..485beb61310 100644 --- a/service/fms/api_op_GetViolationDetails.go +++ b/service/fms/api_op_GetViolationDetails.go @@ -40,8 +40,13 @@ type GetViolationDetailsInput struct { // This member is required. MemberAccount *string - // The ID of the Firewall Manager policy that you want the details for. This - // currently only supports security group content audit policies. + // The ID of the Firewall Manager policy that you want the details for. You can + // get violation details for the following policy types: + // - DNS Firewall + // - Imported Network Firewall + // - Network Firewall + // - Security group content audit + // - Third-party firewall // // This member is required. PolicyId *string diff --git a/service/fms/api_op_PutPolicy.go b/service/fms/api_op_PutPolicy.go index 8817d1f56ef..b3d25251c8b 100644 --- a/service/fms/api_op_PutPolicy.go +++ b/service/fms/api_op_PutPolicy.go @@ -16,26 +16,34 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates an Firewall Manager policy. Firewall Manager provides the following -// types of policies: -// - An WAF policy (type WAFV2), which defines rule groups to run first in the -// corresponding WAF web ACL and rule groups to run last in the web ACL. -// - An WAF Classic policy (type WAF), which defines a rule group. -// - A Shield Advanced policy, which applies Shield Advanced protection to +// Creates an Firewall Manager policy. A Firewall Manager policy is specific to +// the individual policy type. If you want to enforce multiple policy types across +// accounts, you can create multiple policies. You can create more than one policy +// for each type. If you add a new account to an organization that you created with +// Organizations, Firewall Manager automatically applies the policy to the +// resources in that account that are within scope of the policy. Firewall Manager +// provides the following types of policies: +// - Shield Advanced policy - This policy applies Shield Advanced protection to // specified accounts and resources. -// - A security group policy, which manages VPC security groups across your -// Amazon Web Services organization. -// - An Network Firewall policy, which provides firewall rules to filter network -// traffic in specified Amazon VPCs. -// - A DNS Firewall policy, which provides Route 53 Resolver DNS Firewall rules -// to filter DNS queries for specified VPCs. -// -// Each policy is specific to one of the types. If you want to enforce more than -// one policy type across accounts, create multiple policies. You can create -// multiple policies for each type. You must be subscribed to Shield Advanced to -// create a Shield Advanced policy. For more information about subscribing to -// Shield Advanced, see CreateSubscription (https://docs.aws.amazon.com/waf/latest/DDOSAPIReference/API_CreateSubscription.html) -// . +// - Security Groups policy - This type of policy gives you control over +// security groups that are in use throughout your organization in Organizations +// and lets you enforce a baseline set of rules across your organization. +// - Network Firewall policy - This policy applies Network Firewall protection +// to your organization's VPCs. +// - DNS Firewall policy - This policy applies Amazon Route 53 Resolver DNS +// Firewall protections to your organization's VPCs. +// - Third-party firewall policy - This policy applies third-party firewall +// protections. Third-party firewalls are available by subscription through the +// Amazon Web Services Marketplace console at Amazon Web Services Marketplace (https://aws.amazon.com/marketplace) +// . +// - Palo Alto Networks Cloud NGFW policy - This policy applies Palo Alto +// Networks Cloud Next Generation Firewall (NGFW) protections and Palo Alto +// Networks Cloud NGFW rulestacks to your organization's VPCs. +// - Fortigate CNF policy - This policy applies Fortigate Cloud Native Firewall +// (CNF) protections. Fortigate CNF is a cloud-centered solution that blocks +// Zero-Day threats and secures cloud infrastructures with industry-leading +// advanced threat prevention, smart web application firewalls (WAF), and API +// protection. func (c *Client) PutPolicy(ctx context.Context, params *PutPolicyInput, optFns ...func(*Options)) (*PutPolicyOutput, error) { if params == nil { params = &PutPolicyInput{} diff --git a/service/fms/types/types.go b/service/fms/types/types.go index 6553272e542..684900aff43 100644 --- a/service/fms/types/types.go +++ b/service/fms/types/types.go @@ -1007,16 +1007,20 @@ type Policy struct { // The type of resource protected by or in scope of the policy. This is in the // format shown in the Amazon Web Services Resource Types Reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) // . To apply this policy to multiple resource types, specify a resource type of - // ResourceTypeList and then specify the resource types in a ResourceTypeList . For - // WAF and Shield Advanced, resource types include - // AWS::ElasticLoadBalancingV2::LoadBalancer , - // AWS::ElasticLoadBalancing::LoadBalancer , AWS::EC2::EIP , and - // AWS::CloudFront::Distribution . For a security group common policy, valid values - // are AWS::EC2::NetworkInterface and AWS::EC2::Instance . For a security group - // content audit policy, valid values are AWS::EC2::SecurityGroup , - // AWS::EC2::NetworkInterface , and AWS::EC2::Instance . For a security group usage - // audit policy, the value is AWS::EC2::SecurityGroup . For an Network Firewall - // policy or DNS Firewall policy, the value is AWS::EC2::VPC . + // ResourceTypeList and then specify the resource types in a ResourceTypeList . The + // following are valid resource types for each Firewall Manager policy type: + // - Amazon Web Services WAF Classic - AWS::ApiGateway::Stage , + // AWS::CloudFront::Distribution , and AWS::ElasticLoadBalancingV2::LoadBalancer + // . + // - WAF - AWS::ApiGateway::Stage , AWS::ElasticLoadBalancingV2::LoadBalancer , + // and AWS::CloudFront::Distribution . + // - DNS Firewall, Network Firewall, and third-party firewall - AWS::EC2::VPC . + // - Shield Advanced - AWS::ElasticLoadBalancingV2::LoadBalancer , + // AWS::ElasticLoadBalancing::LoadBalancer , AWS::EC2::EIP , and + // AWS::CloudFront::Distribution . + // - Security group content audit - AWS::EC2::SecurityGroup , + // AWS::EC2::NetworkInterface , and AWS::EC2::Instance . + // - Security group usage audit - AWS::EC2::SecurityGroup . // // This member is required. ResourceType *string @@ -1768,14 +1772,6 @@ type SecurityServicePolicyData struct { // "{\"type\":\"NETWORK_FIREWALL\",\"networkFirewallStatelessRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-east-1:123456789011:stateless-rulegroup/test\",\"priority\":1}],\"networkFirewallStatelessDefaultActions\":[\"aws:forward_to_sfe\",\"customActionName\"],\"networkFirewallStatelessFragmentDefaultActions\":[\"aws:forward_to_sfe\",\"fragmentcustomactionname\"],\"networkFirewallStatelessCustomActions\":[{\"actionName\":\"customActionName\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"metricdimensionvalue\"}]}}},{\"actionName\":\"fragmentcustomactionname\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"fragmentmetricdimensionvalue\"}]}}}],\"networkFirewallStatefulRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-east-1:123456789011:stateful-rulegroup/test\"}],\"networkFirewallOrchestrationConfig\":{\"firewallCreationConfig\":{\"endpointLocation\":{\"availabilityZoneConfigList\":[{\"availabilityZoneName\":\"us-east-1a\",\"allowedIPV4CidrList\":[\"10.0.0.0/28\"]},{\"availabilityZoneName\":\"us-east-1b\",\"allowedIPV4CidrList\":[\"10.0.0.0/28\"]}]}},\"singleFirewallEndpointPerVPC\":false,\"allowedIPV4CidrList\":null,\"routeManagementAction\":\"MONITOR\",\"routeManagementTargetTypes\":[\"InternetGateway\"],\"routeManagementConfig\":{\"allowCrossAZTrafficIfNoEndpoint\":true}},\"networkFirewallLoggingConfiguration\":{\"logDestinationConfigs\":[{\"logDestinationType\":\"S3\",\"logType\":\"ALERT\",\"logDestination\":{\"bucketName\":\"s3-bucket-name\"}},{\"logDestinationType\":\"S3\",\"logType\":\"FLOW\",\"logDestination\":{\"bucketName\":\"s3-bucket-name\"}}],\"overrideExistingConfig\":boolean}}" // To use the distributed deployment model, you must set PolicyOption (https://docs.aws.amazon.com/fms/2018-01-01/APIReference/API_PolicyOption.html) // to NULL . - // - Example: THIRD_PARTY_FIREWALL "{ "type":"THIRD_PARTY_FIREWALL", - // "thirdPartyFirewall":"PALO_ALTO_NETWORKS_CLOUD_NGFW", - // "thirdPartyFirewallConfig":{ "thirdPartyFirewallPolicyList":["global-1"] }, - // "firewallDeploymentModel":{ "distributedFirewallDeploymentModel":{ - // "distributedFirewallOrchestrationConfig":{ "firewallCreationConfig":{ - // "endpointLocation":{ "availabilityZoneConfigList":[ { - // "availabilityZoneName":"${AvailabilityZone}" } ] } }, "allowedIPV4CidrList":[ ] - // } } } }" // - Example: SECURITY_GROUPS_COMMON // "{\"type\":\"SECURITY_GROUPS_COMMON\",\"revertManualSecurityGroupChanges\":false,\"exclusiveResourceSecurityGroupManagement\":false, // \"applyToAllEC2InstanceENIs\":false,\"securityGroups\":[{\"id\":\" @@ -1804,11 +1800,29 @@ type SecurityServicePolicyData struct { // policy security group. // - Example: SECURITY_GROUPS_USAGE_AUDIT // "{\"type\":\"SECURITY_GROUPS_USAGE_AUDIT\",\"deleteUnusedSecurityGroups\":true,\"coalesceRedundantSecurityGroups\":true}" + // - Example: SHIELD_ADVANCED with web ACL management + // "{\"type\":\"SHIELD_ADVANCED\",\"optimizeUnassociatedWebACL\":true}" If you + // set optimizeUnassociatedWebACL to true , Firewall Manager creates web ACLs in + // accounts within the policy scope if the web ACLs will be used by at least one + // resource. Firewall Manager creates web ACLs in the accounts within policy scope + // only if the web ACLs will be used by at least one resource. If at any time an + // account comes into policy scope, Firewall Manager automatically creates a web + // ACL in the account if at least one resource will use the web ACL. Upon + // enablement, Firewall Manager performs a one-time cleanup of unused web ACLs in + // your account. The cleanup process can take several hours. If a resource leaves + // policy scope after Firewall Manager creates a web ACL, Firewall Manager doesn't + // disassociate the resource from the web ACL. If you want Firewall Manager to + // clean up the web ACL, you must first manually disassociate the resources from + // the web ACL, and then enable the manage unused web ACLs option in your policy. + // If you set optimizeUnassociatedWebACL to false , and Firewall Manager + // automatically creates an empty web ACL in each account that's within policy + // scope. // - Specification for SHIELD_ADVANCED for Amazon CloudFront distributions // "{\"type\":\"SHIELD_ADVANCED\",\"automaticResponseConfiguration\": // {\"automaticResponseStatus\":\"ENABLED|IGNORED|DISABLED\", // \"automaticResponseAction\":\"BLOCK|COUNT\"}, - // \"overrideCustomerWebaclClassic\":true|false}" For example: + // \"overrideCustomerWebaclClassic\":true|false, + // \"optimizeUnassociatedWebACL\":true|false}" For example: // "{\"type\":\"SHIELD_ADVANCED\",\"automaticResponseConfiguration\": // {\"automaticResponseStatus\":\"ENABLED\", // \"automaticResponseAction\":\"COUNT\"}}" The default value for @@ -1817,16 +1831,40 @@ type SecurityServicePolicyData struct { // value for overrideCustomerWebaclClassic is false . For other resource types // that you can protect with a Shield Advanced policy, this ManagedServiceData // configuration is an empty string. - // - Example: WAFV2 - Account takeover prevention and Bot Control managed rule - // groups, and rule action override - // "{\"type\":\"WAFV2\",\"preProcessRuleGroups\":[{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"versionEnabled\":null,\"version\":null,\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesATPRuleSet\",\"managedRuleGroupConfigs\":[{\"awsmanagedRulesATPRuleSet\":{\"loginPath\":\"/loginpath\",\"requestInspection\":{\"payloadType\":\"FORM_ENCODED|JSON\",\"usernameField\":{\"identifier\":\"/form/username\"},\"passwordField\":{\"identifier\":\"/form/password\"}}}}]},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[],\"sampledRequestsEnabled\":true},{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"versionEnabled\":null,\"version\":null,\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesBotControlRuleSet\",\"managedRuleGroupConfigs\":[{\"awsmanagedRulesBotControlRuleSet\":{\"inspectionLevel\":\"TARGETED|COMMON\"}}]},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[],\"sampledRequestsEnabled\":true,\"ruleActionOverrides\":[{\"name\":\"Rule1\",\"actionToUse\":{\"allow|block|count|captcha|challenge\":{}}},{\"name\":\"Rule2\",\"actionToUse\":{\"allow|block|count|captcha|challenge\":{}}}]}],\"postProcessRuleGroups\":[],\"defaultAction\":{\"type\":\"ALLOW\"},\"customRequestHandling\":null,\"customResponse\":null,\"overrideCustomerWebACLAssociation\":false,\"loggingConfiguration\":null,\"sampledRequestsEnabledForDefaultActions\":true}" + // - Example: THIRD_PARTY_FIREWALL Replace THIRD_PARTY_FIREWALL_NAME with the + // name of the third-party firewall. "{ "type":"THIRD_PARTY_FIREWALL", + // "thirdPartyFirewall":"THIRD_PARTY_FIREWALL_NAME", "thirdPartyFirewallConfig":{ + // "thirdPartyFirewallPolicyList":["global-1"] }, "firewallDeploymentModel":{ + // "distributedFirewallDeploymentModel":{ + // "distributedFirewallOrchestrationConfig":{ "firewallCreationConfig":{ + // "endpointLocation":{ "availabilityZoneConfigList":[ { + // "availabilityZoneName":"${AvailabilityZone}" } ] } }, "allowedIPV4CidrList":[ ] + // } } } }" + // - Example: WAFV2 - Account takeover prevention, Bot Control managed rule + // groups, optimize unassociated web ACL, and rule action override + // "{\"type\":\"WAFV2\",\"preProcessRuleGroups\":[{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"versionEnabled\":null,\"version\":null,\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesATPRuleSet\",\"managedRuleGroupConfigs\":[{\"awsmanagedRulesATPRuleSet\":{\"loginPath\":\"/loginpath\",\"requestInspection\":{\"payloadType\":\"FORM_ENCODED|JSON\",\"usernameField\":{\"identifier\":\"/form/username\"},\"passwordField\":{\"identifier\":\"/form/password\"}}}}]},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[],\"sampledRequestsEnabled\":true},{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"versionEnabled\":null,\"version\":null,\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesBotControlRuleSet\",\"managedRuleGroupConfigs\":[{\"awsmanagedRulesBotControlRuleSet\":{\"inspectionLevel\":\"TARGETED|COMMON\"}}]},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[],\"sampledRequestsEnabled\":true,\"ruleActionOverrides\":[{\"name\":\"Rule1\",\"actionToUse\":{\"allow|block|count|captcha|challenge\":{}}},{\"name\":\"Rule2\",\"actionToUse\":{\"allow|block|count|captcha|challenge\":{}}}]}],\"postProcessRuleGroups\":[],\"defaultAction\":{\"type\":\"ALLOW\"},\"customRequestHandling\":null,\"customResponse\":null,\"overrideCustomerWebACLAssociation\":false,\"loggingConfiguration\":null,\"sampledRequestsEnabledForDefaultActions\":true,\"optimizeUnassociatedWebACL\":true}" + // - Bot Control - For information about AWSManagedRulesBotControlRuleSet managed + // rule groups, see AWSManagedRulesBotControlRuleSet (https://docs.aws.amazon.com/waf/latest/APIReference/API_AWSManagedRulesBotControlRuleSet.html) + // in the WAF API Reference. // - Fraud Control account takeover prevention (ATP) - For information about the // properties available for AWSManagedRulesATPRuleSet managed rule groups, see // AWSManagedRulesATPRuleSet (https://docs.aws.amazon.com/waf/latest/APIReference/API_AWSManagedRulesATPRuleSet.html) // in the WAF API Reference. - // - Bot Control - For information about AWSManagedRulesBotControlRuleSet managed - // rule groups, see AWSManagedRulesBotControlRuleSet (https://docs.aws.amazon.com/waf/latest/APIReference/API_AWSManagedRulesBotControlRuleSet.html) - // in the WAF API Reference. + // - Optimize unassociated web ACL - If you set optimizeUnassociatedWebACL to + // true , Firewall Manager creates web ACLs in accounts within the policy scope + // if the web ACLs will be used by at least one resource. Firewall Manager creates + // web ACLs in the accounts within policy scope only if the web ACLs will be used + // by at least one resource. If at any time an account comes into policy scope, + // Firewall Manager automatically creates a web ACL in the account if at least one + // resource will use the web ACL. Upon enablement, Firewall Manager performs a + // one-time cleanup of unused web ACLs in your account. The cleanup process can + // take several hours. If a resource leaves policy scope after Firewall Manager + // creates a web ACL, Firewall Manager disassociates the resource from the web ACL, + // but won't clean up the unused web ACL. Firewall Manager only cleans up unused + // web ACLs when you first enable management of unused web ACLs in a policy. If you + // set optimizeUnassociatedWebACL to false Firewall Manager doesn't manage unused + // web ACLs, and Firewall Manager automatically creates an empty web ACL in each + // account that's within policy scope. // - Rule action overrides - Firewall Manager supports rule action overrides // only for managed rule groups. To configure a RuleActionOverrides add the Name // of the rule to override, and ActionToUse , which is the new action to use for @@ -1834,15 +1872,21 @@ type SecurityServicePolicyData struct { // RuleActionOverride (https://docs.aws.amazon.com/waf/latest/APIReference/API_RuleActionOverride.html) // in the WAF API Reference. // - Example: WAFV2 - CAPTCHA and Challenge configs - // "{\"type\":\"WAFV2\",\"preProcessRuleGroups\":[{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"versionEnabled\":null,\"version\":null,\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesAdminProtectionRuleSet\"},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[],\"sampledRequestsEnabled\":true}],\"postProcessRuleGroups\":[],\"defaultAction\":{\"type\":\"ALLOW\"},\"customRequestHandling\":null,\"customResponse\":null,\"overrideCustomerWebACLAssociation\":false,\"loggingConfiguration\":null,\"sampledRequestsEnabledForDefaultActions\":true,\"captchaConfig\":{\"immunityTimeProperty\":{\"immunityTime\":500}},\"challengeConfig\":{\"immunityTimeProperty\":{\"immunityTime\":800}},\"tokenDomains\":[\"google.com\",\"amazon.com\"]}" - // If you update the policy's values for captchaConfig , challengeConfig , or - // tokenDomains , Firewall Manager will overwrite your local web ACLs to contain - // the new value(s). However, if you don't update the policy's captchaConfig , + // "{\"type\":\"WAFV2\",\"preProcessRuleGroups\":[{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"versionEnabled\":null,\"version\":null,\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesAdminProtectionRuleSet\"},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[],\"sampledRequestsEnabled\":true}],\"postProcessRuleGroups\":[],\"defaultAction\":{\"type\":\"ALLOW\"},\"customRequestHandling\":null,\"customResponse\":null,\"overrideCustomerWebACLAssociation\":false,\"loggingConfiguration\":null,\"sampledRequestsEnabledForDefaultActions\":true,\"captchaConfig\":{\"immunityTimeProperty\":{\"immunityTime\":500}},\"challengeConfig\":{\"immunityTimeProperty\":{\"immunityTime\":800}},\"tokenDomains\":[\"google.com\",\"amazon.com\"],\"associationConfig\":{\"requestBody\":{\"CLOUDFRONT\":{\"defaultSizeInspectionLimit\":\"KB_16\"}}}}" + // - CAPTCHA and Challenge configs - If you update the policy's values for + // associationConfig , captchaConfig , challengeConfig , or tokenDomains , + // Firewall Manager will overwrite your local web ACLs to contain the new value(s). + // However, if you don't update the policy's associationConfig , captchaConfig , // challengeConfig , or tokenDomains values, the values in your local web ACLs - // will remain unchanged. For information about CAPTCHA and Challenge configs, see - // CaptchaConfig (https://docs.aws.amazon.com/waf/latest/APIReference/API_CaptchaConfig.html) + // will remain unchanged. For information about association configs, see + // AssociationConfig (https://docs.aws.amazon.com/waf/latest/APIReference/API_AssociationConfig.html) + // . For information about CAPTCHA and Challenge configs, see CaptchaConfig (https://docs.aws.amazon.com/waf/latest/APIReference/API_CaptchaConfig.html) // and ChallengeConfig (https://docs.aws.amazon.com/waf/latest/APIReference/API_ChallengeConfig.html) // in the WAF API Reference. + // - defaultSizeInspectionLimit - Specifies the maximum size of the web request + // body component that an associated Amazon CloudFront distribution should send to + // WAF for inspection. For more information, see DefaultSizeInspectionLimit (https://docs.aws.amazon.com/waf/latest/APIReference/API_RequestBodyAssociatedResourceTypeConfig.html#WAF-Type-RequestBodyAssociatedResourceTypeConfig-DefaultSizeInspectionLimit) + // in the WAF API Reference. // - Example: WAFV2 - Firewall Manager support for WAF managed rule group // versioning // "{\"type\":\"WAFV2\",\"preProcessRuleGroups\":[{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"versionEnabled\":true,\"version\":\"Version_2.0\",\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesCommonRuleSet\"},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[{\"name\":\"NoUserAgent_HEADER\"}]}],\"postProcessRuleGroups\":[],\"defaultAction\":{\"type\":\"ALLOW\"},\"overrideCustomerWebACLAssociation\":false,\"loggingConfiguration\":{\"logDestinationConfigs\":[\"arn:aws:firehose:us-west-2:12345678912:deliverystream/aws-waf-logs-fms-admin-destination\"],\"redactedFields\":[{\"redactedFieldType\":\"SingleHeader\",\"redactedFieldValue\":\"Cookies\"},{\"redactedFieldType\":\"Method\"}]}}" diff --git a/service/marketplaceentitlementservice/api_op_GetEntitlements.go b/service/marketplaceentitlementservice/api_op_GetEntitlements.go index dcf1cce76e1..3e099e95033 100644 --- a/service/marketplaceentitlementservice/api_op_GetEntitlements.go +++ b/service/marketplaceentitlementservice/api_op_GetEntitlements.go @@ -155,6 +155,97 @@ func (c *Client) addOperationGetEntitlementsMiddlewares(stack *middleware.Stack, return nil } +// GetEntitlementsAPIClient is a client that implements the GetEntitlements +// operation. +type GetEntitlementsAPIClient interface { + GetEntitlements(context.Context, *GetEntitlementsInput, ...func(*Options)) (*GetEntitlementsOutput, error) +} + +var _ GetEntitlementsAPIClient = (*Client)(nil) + +// GetEntitlementsPaginatorOptions is the paginator options for GetEntitlements +type GetEntitlementsPaginatorOptions struct { + // The maximum number of items to retrieve from the GetEntitlements operation. For + // pagination, use the NextToken field in subsequent calls to GetEntitlements. + 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 +} + +// GetEntitlementsPaginator is a paginator for GetEntitlements +type GetEntitlementsPaginator struct { + options GetEntitlementsPaginatorOptions + client GetEntitlementsAPIClient + params *GetEntitlementsInput + nextToken *string + firstPage bool +} + +// NewGetEntitlementsPaginator returns a new GetEntitlementsPaginator +func NewGetEntitlementsPaginator(client GetEntitlementsAPIClient, params *GetEntitlementsInput, optFns ...func(*GetEntitlementsPaginatorOptions)) *GetEntitlementsPaginator { + if params == nil { + params = &GetEntitlementsInput{} + } + + options := GetEntitlementsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetEntitlementsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetEntitlementsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetEntitlements page. +func (p *GetEntitlementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetEntitlementsOutput, 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.GetEntitlements(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_opGetEntitlements(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/marketplaceentitlementservice/endpoints.go b/service/marketplaceentitlementservice/endpoints.go index ea6513c777d..5190de751df 100644 --- a/service/marketplaceentitlementservice/endpoints.go +++ b/service/marketplaceentitlementservice/endpoints.go @@ -430,7 +430,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://entitlement.marketplace-fips.") diff --git a/service/mediaconvert/deserializers.go b/service/mediaconvert/deserializers.go index e3f44b5fc70..fdfc69fe523 100644 --- a/service/mediaconvert/deserializers.go +++ b/service/mediaconvert/deserializers.go @@ -4636,6 +4636,42 @@ func awsRestjson1_deserializeDocument__listOfAllowedRenditionSize(v *[]types.All return nil } +func awsRestjson1_deserializeDocument__listOfAudioChannelTag(v *[]types.AudioChannelTag, 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.AudioChannelTag + if *v == nil { + cv = []types.AudioChannelTag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AudioChannelTag + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AudioChannelTag to be of type string, got %T instead", value) + } + col = types.AudioChannelTag(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocument__listOfAudioDescription(v *[]types.AudioDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6440,6 +6476,11 @@ func awsRestjson1_deserializeDocumentAudioChannelTaggingSettings(v **types.Audio sv.ChannelTag = types.AudioChannelTag(jtv) } + case "channelTags": + if err := awsRestjson1_deserializeDocument__listOfAudioChannelTag(&sv.ChannelTags, value); err != nil { + return err + } + default: _, _ = key, value @@ -15652,6 +15693,19 @@ func awsRestjson1_deserializeDocumentJobSettings(v **types.JobSettings, value in return err } + case "followSource": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin1Max150 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FollowSource = ptr.Int32(int32(i64)) + } + case "inputs": if err := awsRestjson1_deserializeDocument__listOfInput(&sv.Inputs, value); err != nil { return err @@ -15905,6 +15959,19 @@ func awsRestjson1_deserializeDocumentJobTemplateSettings(v **types.JobTemplateSe return err } + case "followSource": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integerMin1Max150 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FollowSource = ptr.Int32(int32(i64)) + } + case "inputs": if err := awsRestjson1_deserializeDocument__listOfInputTemplate(&sv.Inputs, value); err != nil { return err diff --git a/service/mediaconvert/serializers.go b/service/mediaconvert/serializers.go index 79a6f284208..8c7705923e8 100644 --- a/service/mediaconvert/serializers.go +++ b/service/mediaconvert/serializers.go @@ -2408,6 +2408,17 @@ func awsRestjson1_serializeDocument__listOfAllowedRenditionSize(v []types.Allowe return nil } +func awsRestjson1_serializeDocument__listOfAudioChannelTag(v []types.AudioChannelTag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocument__listOfAudioDescription(v []types.AudioDescription, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2969,6 +2980,13 @@ func awsRestjson1_serializeDocumentAudioChannelTaggingSettings(v *types.AudioCha ok.String(string(v.ChannelTag)) } + if v.ChannelTags != nil { + ok := object.Key("channelTags") + if err := awsRestjson1_serializeDocument__listOfAudioChannelTag(v.ChannelTags, ok); err != nil { + return err + } + } + return nil } @@ -7081,6 +7099,11 @@ func awsRestjson1_serializeDocumentJobSettings(v *types.JobSettings, value smith } } + if v.FollowSource != nil { + ok := object.Key("followSource") + ok.Integer(*v.FollowSource) + } + if v.Inputs != nil { ok := object.Key("inputs") if err := awsRestjson1_serializeDocument__listOfInput(v.Inputs, ok); err != nil { @@ -7170,6 +7193,11 @@ func awsRestjson1_serializeDocumentJobTemplateSettings(v *types.JobTemplateSetti } } + if v.FollowSource != nil { + ok := object.Key("followSource") + ok.Integer(*v.FollowSource) + } + if v.Inputs != nil { ok := object.Key("inputs") if err := awsRestjson1_serializeDocument__listOfInputTemplate(v.Inputs, ok); err != nil { diff --git a/service/mediaconvert/types/enums.go b/service/mediaconvert/types/enums.go index 0ed1b766b78..bb9278cc599 100644 --- a/service/mediaconvert/types/enums.go +++ b/service/mediaconvert/types/enums.go @@ -7585,6 +7585,9 @@ type ScalingBehavior string const ( ScalingBehaviorDefault ScalingBehavior = "DEFAULT" ScalingBehaviorStretchToOutput ScalingBehavior = "STRETCH_TO_OUTPUT" + ScalingBehaviorFit ScalingBehavior = "FIT" + ScalingBehaviorFitNoUpscale ScalingBehavior = "FIT_NO_UPSCALE" + ScalingBehaviorFill ScalingBehavior = "FILL" ) // Values returns all known values for ScalingBehavior. Note that this can be @@ -7594,6 +7597,9 @@ func (ScalingBehavior) Values() []ScalingBehavior { return []ScalingBehavior{ "DEFAULT", "STRETCH_TO_OUTPUT", + "FIT", + "FIT_NO_UPSCALE", + "FILL", } } diff --git a/service/mediaconvert/types/types.go b/service/mediaconvert/types/types.go index 3b9a19c7ba5..2843779a915 100644 --- a/service/mediaconvert/types/types.go +++ b/service/mediaconvert/types/types.go @@ -187,7 +187,7 @@ type AiffSettings struct { // and even numbers up to 64. For example, 1, 2, 4, 6, and so on, up to 64. Channels *int32 - // Sample rate in hz. + // Sample rate in Hz. SampleRate *int32 noSmithyDocumentSerde @@ -236,20 +236,28 @@ type AncillarySourceSettings struct { noSmithyDocumentSerde } -// When you mimic a multi-channel audio layout with multiple mono-channel tracks, -// you can tag each channel layout manually. For example, you would tag the tracks -// that contain your left, right, and center audio with Left (L), Right (R), and -// Center (C), respectively. When you don't specify a value, MediaConvert labels -// your track as Center (C) by default. To use audio layout tagging, your output -// must be in a QuickTime (.mov) container; your audio codec must be AAC, WAV, or -// AIFF; and you must set up your audio track to have only one channel. +// Specify the QuickTime audio channel layout tags for the audio channels in this +// audio track. When you don't specify a value, MediaConvert labels your track as +// Center (C) by default. To use Audio layout tagging, your output must be in a +// QuickTime (MOV) container and your audio codec must be AAC, WAV, or AIFF. type AudioChannelTaggingSettings struct { - // You can add a tag for this mono-channel audio track to mimic its placement in a - // multi-channel layout. For example, if this track is the left surround channel, - // choose Left surround (LS). + // Specify the QuickTime audio channel layout tags for the audio channels in this + // audio track. Enter channel layout tags in the same order as your output's audio + // channel order. For example, if your output audio track has a left and a right + // channel, enter Left (L) for the first channel and Right (R) for the second. If + // your output has multiple single-channel audio tracks, enter a single channel + // layout tag for each track. ChannelTag AudioChannelTag + // Specify the QuickTime audio channel layout tags for the audio channels in this + // audio track. Enter channel layout tags in the same order as your output's audio + // channel order. For example, if your output audio track has a left and a right + // channel, enter Left (L) for the first channel and Right (R) for the second. If + // your output has multiple single-channel audio tracks, enter a single channel + // layout tag for each track. + ChannelTags []AudioChannelTag + noSmithyDocumentSerde } @@ -320,13 +328,10 @@ type AudioCodecSettings struct { // groups, one audio tab can correspond to a group of output audio tracks. type AudioDescription struct { - // When you mimic a multi-channel audio layout with multiple mono-channel tracks, - // you can tag each channel layout manually. For example, you would tag the tracks - // that contain your left, right, and center audio with Left (L), Right (R), and - // Center (C), respectively. When you don't specify a value, MediaConvert labels - // your track as Center (C) by default. To use audio layout tagging, your output - // must be in a QuickTime (.mov) container; your audio codec must be AAC, WAV, or - // AIFF; and you must set up your audio track to have only one channel. + // Specify the QuickTime audio channel layout tags for the audio channels in this + // audio track. When you don't specify a value, MediaConvert labels your track as + // Center (C) by default. To use Audio layout tagging, your output must be in a + // QuickTime (MOV) container and your audio codec must be AAC, WAV, or AIFF. AudioChannelTaggingSettings *AudioChannelTaggingSettings // Advanced audio normalization settings. Ignore these settings unless you need to @@ -2904,9 +2909,9 @@ type ExtendedDataServices struct { // Settings for F4v container type F4vSettings struct { - // If set to PROGRESSIVE_DOWNLOAD, the MOOV atom is relocated to the beginning of - // the archive as required for progressive downloading. Otherwise it is placed - // normally at the end. + // To place the MOOV atom at the beginning of your output, which is useful for + // progressive downloading: Leave blank or choose Progressive download. To place + // the MOOV at the end of your output: Choose Normal. MoovPlacement F4vMoovPlacement noSmithyDocumentSerde @@ -2995,7 +3000,7 @@ type FlacSettings struct { // valid values are between 1 and 8. Channels *int32 - // Sample rate in hz. + // Sample rate in Hz. SampleRate *int32 noSmithyDocumentSerde @@ -5001,6 +5006,16 @@ type JobSettings struct { // Content Advisory. ExtendedDataServices *ExtendedDataServices + // Specify the input that MediaConvert references for your default output + // settings. MediaConvert uses this input's Resolution, Frame rate, and Pixel + // aspect ratio for all outputs that you don't manually specify different output + // settings for. Enabling this setting will disable "Follow source" for all other + // inputs. If MediaConvert cannot follow your source, for example if you specify an + // audio-only input, MediaConvert uses the first followable input instead. In your + // JSON job specification, enter an integer from 1 to 150 corresponding to the + // order of your inputs. + FollowSource *int32 + // Use Inputs to define source file used in the transcode job. There can be // multiple inputs add in a job. These inputs will be concantenated together to // create the output. @@ -5137,6 +5152,16 @@ type JobTemplateSettings struct { // Content Advisory. ExtendedDataServices *ExtendedDataServices + // Specify the input that MediaConvert references for your default output + // settings. MediaConvert uses this input's Resolution, Frame rate, and Pixel + // aspect ratio for all outputs that you don't manually specify different output + // settings for. Enabling this setting will disable "Follow source" for all other + // inputs. If MediaConvert cannot follow your source, for example if you specify an + // audio-only input, MediaConvert uses the first followable input instead. In your + // JSON job specification, enter an integer from 1 to 150 corresponding to the + // order of your inputs. + FollowSource *int32 + // Use Inputs to define the source file used in the transcode job. There can only // be one input in a job template. Using the API, you can include multiple inputs // when referencing a job template. @@ -5787,7 +5812,7 @@ type Mp2Settings struct { // 2. In the API, valid values are 1 and 2. Channels *int32 - // Sample rate in hz. + // Sample rate in Hz. SampleRate *int32 noSmithyDocumentSerde @@ -5809,7 +5834,7 @@ type Mp3Settings struct { // bitrate (CBR) or a variable bitrate (VBR). RateControlMode Mp3RateControlMode - // Sample rate in hz. + // Sample rate in Hz. SampleRate *int32 // Required when you set Bitrate control mode to VBR. Specify the audio quality of @@ -5855,9 +5880,9 @@ type Mp4Settings struct { // Inserts a free-space box immediately after the moov box. FreeSpaceBox Mp4FreeSpaceBox - // If set to PROGRESSIVE_DOWNLOAD, the MOOV atom is relocated to the beginning of - // the archive as required for progressive downloading. Otherwise it is placed - // normally at the end. + // To place the MOOV atom at the beginning of your output, which is useful for + // progressive downloading: Leave blank or choose Progressive download. To place + // the MOOV at the end of your output: Choose Normal. MoovPlacement Mp4MoovPlacement // Overrides the "Major Brand" field in the output file. Usually not necessary to @@ -6570,7 +6595,7 @@ type OpusSettings struct { // values are 1 and 2. Channels *int32 - // Optional. Sample rate in hz. Valid values are 16000, 24000, and 48000. The + // Optional. Sample rate in Hz. Valid values are 16000, 24000, and 48000. The // default value is 48000. SampleRate *int32 @@ -7685,11 +7710,9 @@ type VideoDescription struct { // to remove all input AFD values from this output. RespondToAfd RespondToAfd - // Specify how the service handles outputs that have a different aspect ratio from - // the input aspect ratio. Choose Stretch to output to have the service stretch - // your video image to fit. Keep the setting Default to have the service letterbox - // your video instead. This setting overrides any value that you specify for the - // setting Selection placement in this output. + // Specify the video Scaling behavior when your output has a different resolution + // than your input. For more information, see + // https://docs.aws.amazon.com/mediaconvert/latest/ug/video-scaling.html ScalingBehavior ScalingBehavior // Use Sharpness setting to specify the strength of anti-aliasing. This setting @@ -7737,7 +7760,8 @@ type VideoDetail struct { noSmithyDocumentSerde } -// Overlay one or more videos on top of your input video. +// Overlay one or more videos on top of your input video. For more information, +// see https://docs.aws.amazon.com/mediaconvert/latest/ug/video-overlays.html type VideoOverlay struct { // Enter the end timecode in the underlying input video for this overlay. Your @@ -7782,11 +7806,11 @@ type VideoOverlayInput struct { // start and end timecode. InputClippings []VideoOverlayInputClipping - // Specify the starting timecode for your video overlay. To use the timecode - // present in your video overlay: Choose Embedded. To use a zerobased timecode: - // Choose Start at 0. To choose a timecode: Choose Specified start. When you do, - // enter the starting timecode in Start timecode. If you don't specify a value for - // Timecode source, MediaConvert uses Embedded by default. + // Specify the timecode source for your video overlay input clips. To use the + // timecode present in your video overlay: Choose Embedded. To use a zerobased + // timecode: Choose Start at 0. To choose a timecode: Choose Specified start. When + // you do, enter the starting timecode in Start timecode. If you don't specify a + // value for Timecode source, MediaConvert uses Embedded by default. TimecodeSource InputTimecodeSource // Specify the starting timecode for this video overlay. To use this setting, you diff --git a/service/rds/api_op_CreateCustomDBEngineVersion.go b/service/rds/api_op_CreateCustomDBEngineVersion.go index e4b6a1ff96f..f66936db2b2 100644 --- a/service/rds/api_op_CreateCustomDBEngineVersion.go +++ b/service/rds/api_op_CreateCustomDBEngineVersion.go @@ -220,8 +220,8 @@ type CreateCustomDBEngineVersionOutput struct { // version. SupportsGlobalDatabases *bool - // Indicates whether the DB engine version supports Aurora zero-ETL integrations - // with Amazon Redshift. + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. SupportsIntegrations *bool // Indicates whether the DB engine version supports forwarding write operations diff --git a/service/rds/api_op_CreateIntegration.go b/service/rds/api_op_CreateIntegration.go index e22125f3b97..4a30a5b5d08 100644 --- a/service/rds/api_op_CreateIntegration.go +++ b/service/rds/api_op_CreateIntegration.go @@ -17,9 +17,7 @@ import ( "time" ) -// Creates a zero-ETL integration with Amazon Redshift. For more information, see -// Working with Amazon Aurora zero-ETL integrations with Amazon Redshift (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/zero-etl.html) -// in the Amazon Aurora User Guide. +// Creates a zero-ETL integration with Amazon Redshift. func (c *Client) CreateIntegration(ctx context.Context, params *CreateIntegrationInput, optFns ...func(*Options)) (*CreateIntegrationOutput, error) { if params == nil { params = &CreateIntegrationInput{} @@ -42,8 +40,8 @@ type CreateIntegrationInput struct { // This member is required. IntegrationName *string - // The Amazon Resource Name (ARN) of the Aurora DB cluster to use as the source - // for replication. + // The Amazon Resource Name (ARN) of the database to use as the source for + // replication. // // This member is required. SourceArn *string @@ -62,7 +60,7 @@ type CreateIntegrationInput struct { // The Amazon Web Services Key Management System (Amazon Web Services KMS) key // identifier for the key to use to encrypt the integration. If you don't specify - // an encryption key, Aurora uses a default Amazon Web Services owned key. + // an encryption key, RDS uses a default Amazon Web Services owned key. KMSKeyId *string // A list of tags. For more information, see Tagging Amazon RDS Resources (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html) @@ -72,9 +70,7 @@ type CreateIntegrationInput struct { noSmithyDocumentSerde } -// An Aurora zero-ETL integration with Amazon Redshift. For more information, see -// Working with Amazon Aurora zero-ETL integrations with Amazon Redshift (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/zero-etl.html) -// in the Amazon Aurora User Guide. +// A zero-ETL integration with Amazon Redshift. type CreateIntegrationOutput struct { // The encryption context for the integration. For more information, see @@ -98,7 +94,7 @@ type CreateIntegrationOutput struct { // identifier for the key used to to encrypt the integration. KMSKeyId *string - // The Amazon Resource Name (ARN) of the Aurora DB cluster used as the source for + // The Amazon Resource Name (ARN) of the database used as the source for // replication. SourceArn *string diff --git a/service/rds/api_op_DeleteCustomDBEngineVersion.go b/service/rds/api_op_DeleteCustomDBEngineVersion.go index ff47cf08f15..32f641ae298 100644 --- a/service/rds/api_op_DeleteCustomDBEngineVersion.go +++ b/service/rds/api_op_DeleteCustomDBEngineVersion.go @@ -173,8 +173,8 @@ type DeleteCustomDBEngineVersionOutput struct { // version. SupportsGlobalDatabases *bool - // Indicates whether the DB engine version supports Aurora zero-ETL integrations - // with Amazon Redshift. + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. SupportsIntegrations *bool // Indicates whether the DB engine version supports forwarding write operations diff --git a/service/rds/api_op_DeleteIntegration.go b/service/rds/api_op_DeleteIntegration.go index 911ba4cf184..9079ab6525e 100644 --- a/service/rds/api_op_DeleteIntegration.go +++ b/service/rds/api_op_DeleteIntegration.go @@ -17,9 +17,7 @@ import ( "time" ) -// Deletes a zero-ETL integration with Amazon Redshift. For more information, see -// Deleting Amazon Aurora zero-ETL integrations with Amazon Redshift (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/zero-etl.deleting.html) -// in the Amazon Aurora User Guide +// Deletes a zero-ETL integration with Amazon Redshift. func (c *Client) DeleteIntegration(ctx context.Context, params *DeleteIntegrationInput, optFns ...func(*Options)) (*DeleteIntegrationOutput, error) { if params == nil { params = &DeleteIntegrationInput{} @@ -45,9 +43,7 @@ type DeleteIntegrationInput struct { noSmithyDocumentSerde } -// An Aurora zero-ETL integration with Amazon Redshift. For more information, see -// Working with Amazon Aurora zero-ETL integrations with Amazon Redshift (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/zero-etl.html) -// in the Amazon Aurora User Guide. +// A zero-ETL integration with Amazon Redshift. type DeleteIntegrationOutput struct { // The encryption context for the integration. For more information, see @@ -71,7 +67,7 @@ type DeleteIntegrationOutput struct { // identifier for the key used to to encrypt the integration. KMSKeyId *string - // The Amazon Resource Name (ARN) of the Aurora DB cluster used as the source for + // The Amazon Resource Name (ARN) of the database used as the source for // replication. SourceArn *string diff --git a/service/rds/api_op_DescribeIntegrations.go b/service/rds/api_op_DescribeIntegrations.go index b20866dd2f7..444983655d8 100644 --- a/service/rds/api_op_DescribeIntegrations.go +++ b/service/rds/api_op_DescribeIntegrations.go @@ -16,10 +16,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describe one or more zero-ETL integration with Amazon Redshift. For more -// information, see Viewing and monitoring Amazon Aurora zero-ETL integrations -// with Amazon Redshift (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/zero-etl.describingmonitoring.html) -// in the Amazon Aurora User Guide +// Describe one or more zero-ETL integrations with Amazon Redshift. func (c *Client) DescribeIntegrations(ctx context.Context, params *DescribeIntegrationsInput, optFns ...func(*Options)) (*DescribeIntegrationsOutput, error) { if params == nil { params = &DescribeIntegrationsInput{} diff --git a/service/rds/api_op_ModifyCustomDBEngineVersion.go b/service/rds/api_op_ModifyCustomDBEngineVersion.go index c2f77add138..e59a7e88399 100644 --- a/service/rds/api_op_ModifyCustomDBEngineVersion.go +++ b/service/rds/api_op_ModifyCustomDBEngineVersion.go @@ -183,8 +183,8 @@ type ModifyCustomDBEngineVersionOutput struct { // version. SupportsGlobalDatabases *bool - // Indicates whether the DB engine version supports Aurora zero-ETL integrations - // with Amazon Redshift. + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. SupportsIntegrations *bool // Indicates whether the DB engine version supports forwarding write operations diff --git a/service/rds/types/types.go b/service/rds/types/types.go index e399440f559..cbd369e4030 100644 --- a/service/rds/types/types.go +++ b/service/rds/types/types.go @@ -1273,8 +1273,8 @@ type DBEngineVersion struct { // version. SupportsGlobalDatabases *bool - // Indicates whether the DB engine version supports Aurora zero-ETL integrations - // with Amazon Redshift. + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. SupportsIntegrations *bool // Indicates whether the DB engine version supports forwarding write operations @@ -2840,9 +2840,7 @@ type GlobalClusterMember struct { noSmithyDocumentSerde } -// An Aurora zero-ETL integration with Amazon Redshift. For more information, see -// Working with Amazon Aurora zero-ETL integrations with Amazon Redshift (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/zero-etl.html) -// in the Amazon Aurora User Guide. +// A zero-ETL integration with Amazon Redshift. type Integration struct { // The encryption context for the integration. For more information, see @@ -2866,7 +2864,7 @@ type Integration struct { // identifier for the key used to to encrypt the integration. KMSKeyId *string - // The Amazon Resource Name (ARN) of the Aurora DB cluster used as the source for + // The Amazon Resource Name (ARN) of the database used as the source for // replication. SourceArn *string @@ -4082,8 +4080,8 @@ type UpgradeTarget struct { // version. SupportsGlobalDatabases *bool - // Indicates whether the DB engine version supports Aurora zero-ETL integrations - // with Amazon Redshift. + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. SupportsIntegrations *bool // Indicates whether the target engine version supports forwarding write