From cecf9b853819e8a9620a6ef662e1143c312d8b35 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Mon, 25 Nov 2024 19:39:02 +0000 Subject: [PATCH] Regenerated Clients --- .../21537aa6d4d647d89f2da00c3e6ba23b.json | 8 + .../bdbd39bb1d60408ca26d8cec1cb878e7.json | 8 + .../fed8615a52bf40e786a350b2a8504a80.json | 8 + service/directconnect/deserializers.go | 63 ++ service/directconnect/types/types.go | 20 + ...op_CreateDirectConnectGatewayAttachment.go | 212 +++++++ ...pi_op_GetDirectConnectGatewayAttachment.go | 159 +++++ ...op_UpdateDirectConnectGatewayAttachment.go | 164 ++++++ service/networkmanager/deserializers.go | 548 ++++++++++++++++++ service/networkmanager/generated.json | 3 + service/networkmanager/serializers.go | 283 +++++++++ ...eateDirectConnectGatewayAttachment.go.snap | 42 ++ ..._GetDirectConnectGatewayAttachment.go.snap | 41 ++ ...dateDirectConnectGatewayAttachment.go.snap | 41 ++ service/networkmanager/snapshot_test.go | 72 +++ service/networkmanager/types/enums.go | 24 +- service/networkmanager/types/types.go | 20 +- service/networkmanager/validators.go | 123 ++++ service/s3/api_op_CompleteMultipartUpload.go | 18 + service/s3/api_op_PutBucketVersioning.go | 6 +- service/s3/api_op_PutObject.go | 17 + service/s3/serializers.go | 10 + 22 files changed, 1879 insertions(+), 11 deletions(-) create mode 100644 .changelog/21537aa6d4d647d89f2da00c3e6ba23b.json create mode 100644 .changelog/bdbd39bb1d60408ca26d8cec1cb878e7.json create mode 100644 .changelog/fed8615a52bf40e786a350b2a8504a80.json create mode 100644 service/networkmanager/api_op_CreateDirectConnectGatewayAttachment.go create mode 100644 service/networkmanager/api_op_GetDirectConnectGatewayAttachment.go create mode 100644 service/networkmanager/api_op_UpdateDirectConnectGatewayAttachment.go create mode 100644 service/networkmanager/snapshot/api_op_CreateDirectConnectGatewayAttachment.go.snap create mode 100644 service/networkmanager/snapshot/api_op_GetDirectConnectGatewayAttachment.go.snap create mode 100644 service/networkmanager/snapshot/api_op_UpdateDirectConnectGatewayAttachment.go.snap diff --git a/.changelog/21537aa6d4d647d89f2da00c3e6ba23b.json b/.changelog/21537aa6d4d647d89f2da00c3e6ba23b.json new file mode 100644 index 00000000000..2f90cdc020b --- /dev/null +++ b/.changelog/21537aa6d4d647d89f2da00c3e6ba23b.json @@ -0,0 +1,8 @@ +{ + "id": "21537aa6-d4d6-47d8-9f2d-a00c3e6ba23b", + "type": "feature", + "description": "Amazon Simple Storage Service / Features: Add support for ETag based conditional writes in PutObject and CompleteMultiPartUpload APIs to prevent unintended object modifications.", + "modules": [ + "service/s3" + ] +} \ No newline at end of file diff --git a/.changelog/bdbd39bb1d60408ca26d8cec1cb878e7.json b/.changelog/bdbd39bb1d60408ca26d8cec1cb878e7.json new file mode 100644 index 00000000000..098f400afec --- /dev/null +++ b/.changelog/bdbd39bb1d60408ca26d8cec1cb878e7.json @@ -0,0 +1,8 @@ +{ + "id": "bdbd39bb-1d60-408c-a26d-8cec1cb878e7", + "type": "feature", + "description": "Update DescribeDirectConnectGatewayAssociations API to return associated core network information if a Direct Connect gateway is attached to a Cloud WAN core network.", + "modules": [ + "service/directconnect" + ] +} \ No newline at end of file diff --git a/.changelog/fed8615a52bf40e786a350b2a8504a80.json b/.changelog/fed8615a52bf40e786a350b2a8504a80.json new file mode 100644 index 00000000000..60a4b748cc7 --- /dev/null +++ b/.changelog/fed8615a52bf40e786a350b2a8504a80.json @@ -0,0 +1,8 @@ +{ + "id": "fed8615a-52bf-40e7-86a3-50b2a8504a80", + "type": "feature", + "description": "This release adds native Direct Connect integration on Cloud WAN enabling customers to directly attach their Direct Connect gateways to Cloud WAN without the need for an intermediate Transit Gateway.", + "modules": [ + "service/networkmanager" + ] +} \ No newline at end of file diff --git a/service/directconnect/deserializers.go b/service/directconnect/deserializers.go index bd661e43a9d..1965e52db0f 100644 --- a/service/directconnect/deserializers.go +++ b/service/directconnect/deserializers.go @@ -7452,6 +7452,64 @@ func awsAwsjson11_deserializeDocumentAgreementList(v *[]types.CustomerAgreement, return nil } +func awsAwsjson11_deserializeDocumentAssociatedCoreNetwork(v **types.AssociatedCoreNetwork, 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.AssociatedCoreNetwork + if *v == nil { + sv = &types.AssociatedCoreNetwork{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "attachmentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CoreNetworkAttachmentId to be of type string, got %T instead", value) + } + sv.AttachmentId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CoreNetworkIdentifier to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "ownerAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OwnerAccount to be of type string, got %T instead", value) + } + sv.OwnerAccount = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentAssociatedGateway(v **types.AssociatedGateway, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8257,6 +8315,11 @@ func awsAwsjson11_deserializeDocumentDirectConnectGatewayAssociation(v **types.D return err } + case "associatedCoreNetwork": + if err := awsAwsjson11_deserializeDocumentAssociatedCoreNetwork(&sv.AssociatedCoreNetwork, value); err != nil { + return err + } + case "associatedGateway": if err := awsAwsjson11_deserializeDocumentAssociatedGateway(&sv.AssociatedGateway, value); err != nil { return err diff --git a/service/directconnect/types/types.go b/service/directconnect/types/types.go index 130d7521052..70be42efea5 100644 --- a/service/directconnect/types/types.go +++ b/service/directconnect/types/types.go @@ -7,6 +7,22 @@ import ( "time" ) +// The Amazon Web Services Cloud WAN core network that the Direct Connect +// attachment is associated with. +type AssociatedCoreNetwork struct { + + // the ID of the Direct Connect attachment + AttachmentId *string + + // The ID of the Cloud WAN core network. + Id *string + + // The account owner of the Cloud WAN core network. + OwnerAccount *string + + noSmithyDocumentSerde +} + // Information about the associated gateway. type AssociatedGateway struct { @@ -240,6 +256,10 @@ type DirectConnectGatewayAssociation struct { // The Amazon VPC prefixes to advertise to the Direct Connect gateway. AllowedPrefixesToDirectConnectGateway []RouteFilterPrefix + // The ID of the Cloud WAN core network associated with the Direct Connect + // attachment. + AssociatedCoreNetwork *AssociatedCoreNetwork + // Information about the associated gateway. AssociatedGateway *AssociatedGateway diff --git a/service/networkmanager/api_op_CreateDirectConnectGatewayAttachment.go b/service/networkmanager/api_op_CreateDirectConnectGatewayAttachment.go new file mode 100644 index 00000000000..8eaf919c7ee --- /dev/null +++ b/service/networkmanager/api_op_CreateDirectConnectGatewayAttachment.go @@ -0,0 +1,212 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Amazon Web Services Direct Connect gateway attachment +func (c *Client) CreateDirectConnectGatewayAttachment(ctx context.Context, params *CreateDirectConnectGatewayAttachmentInput, optFns ...func(*Options)) (*CreateDirectConnectGatewayAttachmentOutput, error) { + if params == nil { + params = &CreateDirectConnectGatewayAttachmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDirectConnectGatewayAttachment", params, optFns, c.addOperationCreateDirectConnectGatewayAttachmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDirectConnectGatewayAttachmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDirectConnectGatewayAttachmentInput struct { + + // The ID of the Cloud WAN core network that the Direct Connect gateway attachment + // should be attached to. + // + // This member is required. + CoreNetworkId *string + + // The ARN of the Direct Connect gateway attachment. + // + // This member is required. + DirectConnectGatewayArn *string + + // One or more core network edge locations that the Direct Connect gateway + // attachment is associated with. + // + // This member is required. + EdgeLocations []string + + // client token + ClientToken *string + + // The key value tags to apply to the Direct Connect gateway attachment during + // creation. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateDirectConnectGatewayAttachmentOutput struct { + + // Describes the details of a CreateDirectConnectGatewayAttachment request. + DirectConnectGatewayAttachment *types.DirectConnectGatewayAttachment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDirectConnectGatewayAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDirectConnectGatewayAttachment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDirectConnectGatewayAttachment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDirectConnectGatewayAttachment"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateDirectConnectGatewayAttachmentMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateDirectConnectGatewayAttachmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDirectConnectGatewayAttachment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateDirectConnectGatewayAttachment struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateDirectConnectGatewayAttachment) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateDirectConnectGatewayAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateDirectConnectGatewayAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDirectConnectGatewayAttachmentInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateDirectConnectGatewayAttachmentMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDirectConnectGatewayAttachment{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateDirectConnectGatewayAttachment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDirectConnectGatewayAttachment", + } +} diff --git a/service/networkmanager/api_op_GetDirectConnectGatewayAttachment.go b/service/networkmanager/api_op_GetDirectConnectGatewayAttachment.go new file mode 100644 index 00000000000..fc547d88ccc --- /dev/null +++ b/service/networkmanager/api_op_GetDirectConnectGatewayAttachment.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a specific Amazon Web Services Direct Connect gateway +// attachment. +func (c *Client) GetDirectConnectGatewayAttachment(ctx context.Context, params *GetDirectConnectGatewayAttachmentInput, optFns ...func(*Options)) (*GetDirectConnectGatewayAttachmentOutput, error) { + if params == nil { + params = &GetDirectConnectGatewayAttachmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDirectConnectGatewayAttachment", params, optFns, c.addOperationGetDirectConnectGatewayAttachmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDirectConnectGatewayAttachmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDirectConnectGatewayAttachmentInput struct { + + // The ID of the Direct Connect gateway attachment that you want to see details + // about. + // + // This member is required. + AttachmentId *string + + noSmithyDocumentSerde +} + +type GetDirectConnectGatewayAttachmentOutput struct { + + // Shows details about the Direct Connect gateway attachment. + DirectConnectGatewayAttachment *types.DirectConnectGatewayAttachment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDirectConnectGatewayAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDirectConnectGatewayAttachment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDirectConnectGatewayAttachment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDirectConnectGatewayAttachment"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetDirectConnectGatewayAttachmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDirectConnectGatewayAttachment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDirectConnectGatewayAttachment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetDirectConnectGatewayAttachment", + } +} diff --git a/service/networkmanager/api_op_UpdateDirectConnectGatewayAttachment.go b/service/networkmanager/api_op_UpdateDirectConnectGatewayAttachment.go new file mode 100644 index 00000000000..9f8418c39d9 --- /dev/null +++ b/service/networkmanager/api_op_UpdateDirectConnectGatewayAttachment.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the edge locations associated with an Amazon Web Services Direct +// Connect gateway attachment. +func (c *Client) UpdateDirectConnectGatewayAttachment(ctx context.Context, params *UpdateDirectConnectGatewayAttachmentInput, optFns ...func(*Options)) (*UpdateDirectConnectGatewayAttachmentOutput, error) { + if params == nil { + params = &UpdateDirectConnectGatewayAttachmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDirectConnectGatewayAttachment", params, optFns, c.addOperationUpdateDirectConnectGatewayAttachmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDirectConnectGatewayAttachmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDirectConnectGatewayAttachmentInput struct { + + // The ID of the Direct Connect gateway attachment for the updated edge locations. + // + // This member is required. + AttachmentId *string + + // One or more edge locations to update for the Direct Connect gateway attachment. + // The updated array of edge locations overwrites the previous array of locations. + // EdgeLocations is only used for Direct Connect gateway attachments. Do + EdgeLocations []string + + noSmithyDocumentSerde +} + +type UpdateDirectConnectGatewayAttachmentOutput struct { + + // Returns details of the Direct Connect gateway attachment with the updated edge + // locations. + DirectConnectGatewayAttachment *types.DirectConnectGatewayAttachment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateDirectConnectGatewayAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDirectConnectGatewayAttachment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDirectConnectGatewayAttachment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateDirectConnectGatewayAttachment"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateDirectConnectGatewayAttachmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDirectConnectGatewayAttachment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateDirectConnectGatewayAttachment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateDirectConnectGatewayAttachment", + } +} diff --git a/service/networkmanager/deserializers.go b/service/networkmanager/deserializers.go index ed22c0c1c30..090d6ce65ca 100644 --- a/service/networkmanager/deserializers.go +++ b/service/networkmanager/deserializers.go @@ -1718,6 +1718,173 @@ func awsRestjson1_deserializeOpDocumentCreateDeviceOutput(v **CreateDeviceOutput return nil } +type awsRestjson1_deserializeOpCreateDirectConnectGatewayAttachment struct { +} + +func (*awsRestjson1_deserializeOpCreateDirectConnectGatewayAttachment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDirectConnectGatewayAttachment) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorCreateDirectConnectGatewayAttachment(response, &metadata) + } + output := &CreateDirectConnectGatewayAttachmentOutput{} + 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_deserializeOpDocumentCreateDirectConnectGatewayAttachmentOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateDirectConnectGatewayAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateDirectConnectGatewayAttachmentOutput(v **CreateDirectConnectGatewayAttachmentOutput, 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 *CreateDirectConnectGatewayAttachmentOutput + if *v == nil { + sv = &CreateDirectConnectGatewayAttachmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DirectConnectGatewayAttachment": + if err := awsRestjson1_deserializeDocumentDirectConnectGatewayAttachment(&sv.DirectConnectGatewayAttachment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateGlobalNetwork struct { } @@ -7474,6 +7641,170 @@ func awsRestjson1_deserializeOpDocumentGetDevicesOutput(v **GetDevicesOutput, va return nil } +type awsRestjson1_deserializeOpGetDirectConnectGatewayAttachment struct { +} + +func (*awsRestjson1_deserializeOpGetDirectConnectGatewayAttachment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDirectConnectGatewayAttachment) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetDirectConnectGatewayAttachment(response, &metadata) + } + output := &GetDirectConnectGatewayAttachmentOutput{} + 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_deserializeOpDocumentGetDirectConnectGatewayAttachmentOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetDirectConnectGatewayAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDirectConnectGatewayAttachmentOutput(v **GetDirectConnectGatewayAttachmentOutput, 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 *GetDirectConnectGatewayAttachmentOutput + if *v == nil { + sv = &GetDirectConnectGatewayAttachmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DirectConnectGatewayAttachment": + if err := awsRestjson1_deserializeDocumentDirectConnectGatewayAttachment(&sv.DirectConnectGatewayAttachment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpGetLinkAssociations struct { } @@ -13212,6 +13543,173 @@ func awsRestjson1_deserializeOpDocumentUpdateDeviceOutput(v **UpdateDeviceOutput return nil } +type awsRestjson1_deserializeOpUpdateDirectConnectGatewayAttachment struct { +} + +func (*awsRestjson1_deserializeOpUpdateDirectConnectGatewayAttachment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateDirectConnectGatewayAttachment) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateDirectConnectGatewayAttachment(response, &metadata) + } + output := &UpdateDirectConnectGatewayAttachmentOutput{} + 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_deserializeOpDocumentUpdateDirectConnectGatewayAttachmentOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateDirectConnectGatewayAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateDirectConnectGatewayAttachmentOutput(v **UpdateDirectConnectGatewayAttachmentOutput, 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 *UpdateDirectConnectGatewayAttachmentOutput + if *v == nil { + sv = &UpdateDirectConnectGatewayAttachmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DirectConnectGatewayAttachment": + if err := awsRestjson1_deserializeDocumentDirectConnectGatewayAttachment(&sv.DirectConnectGatewayAttachment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpUpdateGlobalNetwork struct { } @@ -14606,6 +15104,11 @@ func awsRestjson1_deserializeDocumentAttachment(v **types.Attachment, value inte sv.EdgeLocation = ptr.String(jtv) } + case "EdgeLocations": + if err := awsRestjson1_deserializeDocumentExternalRegionCodeList(&sv.EdgeLocations, value); err != nil { + return err + } + case "LastModificationErrors": if err := awsRestjson1_deserializeDocumentAttachmentErrorList(&sv.LastModificationErrors, value); err != nil { return err @@ -17633,6 +18136,51 @@ func awsRestjson1_deserializeDocumentDeviceList(v *[]types.Device, value interfa return nil } +func awsRestjson1_deserializeDocumentDirectConnectGatewayAttachment(v **types.DirectConnectGatewayAttachment, 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.DirectConnectGatewayAttachment + if *v == nil { + sv = &types.DirectConnectGatewayAttachment{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Attachment": + if err := awsRestjson1_deserializeDocumentAttachment(&sv.Attachment, value); err != nil { + return err + } + + case "DirectConnectGatewayArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DirectConnectGatewayArn to be of type string, got %T instead", value) + } + sv.DirectConnectGatewayArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentEdgeOverride(v **types.EdgeOverride, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/networkmanager/generated.json b/service/networkmanager/generated.json index 3031becc635..4f900721ace 100644 --- a/service/networkmanager/generated.json +++ b/service/networkmanager/generated.json @@ -18,6 +18,7 @@ "api_op_CreateConnection.go", "api_op_CreateCoreNetwork.go", "api_op_CreateDevice.go", + "api_op_CreateDirectConnectGatewayAttachment.go", "api_op_CreateGlobalNetwork.go", "api_op_CreateLink.go", "api_op_CreateSite.go", @@ -53,6 +54,7 @@ "api_op_GetCoreNetworkPolicy.go", "api_op_GetCustomerGatewayAssociations.go", "api_op_GetDevices.go", + "api_op_GetDirectConnectGatewayAttachment.go", "api_op_GetLinkAssociations.go", "api_op_GetLinks.go", "api_op_GetNetworkResourceCounts.go", @@ -88,6 +90,7 @@ "api_op_UpdateConnection.go", "api_op_UpdateCoreNetwork.go", "api_op_UpdateDevice.go", + "api_op_UpdateDirectConnectGatewayAttachment.go", "api_op_UpdateGlobalNetwork.go", "api_op_UpdateLink.go", "api_op_UpdateNetworkResourceMetadata.go", diff --git a/service/networkmanager/serializers.go b/service/networkmanager/serializers.go index 2c70a015b33..ab8bb4ca6e4 100644 --- a/service/networkmanager/serializers.go +++ b/service/networkmanager/serializers.go @@ -1093,6 +1093,111 @@ func awsRestjson1_serializeOpDocumentCreateDeviceInput(v *CreateDeviceInput, val return nil } +type awsRestjson1_serializeOpCreateDirectConnectGatewayAttachment struct { +} + +func (*awsRestjson1_serializeOpCreateDirectConnectGatewayAttachment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDirectConnectGatewayAttachment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateDirectConnectGatewayAttachmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/direct-connect-gateway-attachments") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateDirectConnectGatewayAttachmentInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateDirectConnectGatewayAttachmentInput(v *CreateDirectConnectGatewayAttachmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDirectConnectGatewayAttachmentInput(v *CreateDirectConnectGatewayAttachmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.CoreNetworkId != nil { + ok := object.Key("CoreNetworkId") + ok.String(*v.CoreNetworkId) + } + + if v.DirectConnectGatewayArn != nil { + ok := object.Key("DirectConnectGatewayArn") + ok.String(*v.DirectConnectGatewayArn) + } + + if v.EdgeLocations != nil { + ok := object.Key("EdgeLocations") + if err := awsRestjson1_serializeDocumentExternalRegionCodeList(v.EdgeLocations, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateGlobalNetwork struct { } @@ -4015,6 +4120,77 @@ func awsRestjson1_serializeOpHttpBindingsGetDevicesInput(v *GetDevicesInput, enc return nil } +type awsRestjson1_serializeOpGetDirectConnectGatewayAttachment struct { +} + +func (*awsRestjson1_serializeOpGetDirectConnectGatewayAttachment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDirectConnectGatewayAttachment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetDirectConnectGatewayAttachmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/direct-connect-gateway-attachments/{AttachmentId}") + 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_serializeOpHttpBindingsGetDirectConnectGatewayAttachmentInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetDirectConnectGatewayAttachmentInput(v *GetDirectConnectGatewayAttachmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AttachmentId == nil || len(*v.AttachmentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AttachmentId must not be empty")} + } + if v.AttachmentId != nil { + if err := encoder.SetURI("AttachmentId").String(*v.AttachmentId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetLinkAssociations struct { } @@ -7137,6 +7313,102 @@ func awsRestjson1_serializeOpDocumentUpdateDeviceInput(v *UpdateDeviceInput, val return nil } +type awsRestjson1_serializeOpUpdateDirectConnectGatewayAttachment struct { +} + +func (*awsRestjson1_serializeOpUpdateDirectConnectGatewayAttachment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateDirectConnectGatewayAttachment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateDirectConnectGatewayAttachmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/direct-connect-gateway-attachments/{AttachmentId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + 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_serializeOpHttpBindingsUpdateDirectConnectGatewayAttachmentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateDirectConnectGatewayAttachmentInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateDirectConnectGatewayAttachmentInput(v *UpdateDirectConnectGatewayAttachmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AttachmentId == nil || len(*v.AttachmentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AttachmentId must not be empty")} + } + if v.AttachmentId != nil { + if err := encoder.SetURI("AttachmentId").String(*v.AttachmentId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateDirectConnectGatewayAttachmentInput(v *UpdateDirectConnectGatewayAttachmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EdgeLocations != nil { + ok := object.Key("EdgeLocations") + if err := awsRestjson1_serializeDocumentExternalRegionCodeList(v.EdgeLocations, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateGlobalNetwork struct { } @@ -7789,6 +8061,17 @@ func awsRestjson1_serializeDocumentCoreNetworkSegmentEdgeIdentifier(v *types.Cor return nil } +func awsRestjson1_serializeDocumentExternalRegionCodeList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsRestjson1_serializeDocumentFilterMap(v map[string][]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/networkmanager/snapshot/api_op_CreateDirectConnectGatewayAttachment.go.snap b/service/networkmanager/snapshot/api_op_CreateDirectConnectGatewayAttachment.go.snap new file mode 100644 index 00000000000..7eb1abb6b3d --- /dev/null +++ b/service/networkmanager/snapshot/api_op_CreateDirectConnectGatewayAttachment.go.snap @@ -0,0 +1,42 @@ +CreateDirectConnectGatewayAttachment + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/networkmanager/snapshot/api_op_GetDirectConnectGatewayAttachment.go.snap b/service/networkmanager/snapshot/api_op_GetDirectConnectGatewayAttachment.go.snap new file mode 100644 index 00000000000..20ea8fcb798 --- /dev/null +++ b/service/networkmanager/snapshot/api_op_GetDirectConnectGatewayAttachment.go.snap @@ -0,0 +1,41 @@ +GetDirectConnectGatewayAttachment + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/networkmanager/snapshot/api_op_UpdateDirectConnectGatewayAttachment.go.snap b/service/networkmanager/snapshot/api_op_UpdateDirectConnectGatewayAttachment.go.snap new file mode 100644 index 00000000000..4f78edd46c4 --- /dev/null +++ b/service/networkmanager/snapshot/api_op_UpdateDirectConnectGatewayAttachment.go.snap @@ -0,0 +1,41 @@ +UpdateDirectConnectGatewayAttachment + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/networkmanager/snapshot_test.go b/service/networkmanager/snapshot_test.go index e8bed0f08a2..3288ca66486 100644 --- a/service/networkmanager/snapshot_test.go +++ b/service/networkmanager/snapshot_test.go @@ -182,6 +182,18 @@ func TestCheckSnapshot_CreateDevice(t *testing.T) { } } +func TestCheckSnapshot_CreateDirectConnectGatewayAttachment(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateDirectConnectGatewayAttachment(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateDirectConnectGatewayAttachment") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateGlobalNetwork(t *testing.T) { svc := New(Options{}) _, err := svc.CreateGlobalNetwork(context.Background(), nil, func(o *Options) { @@ -602,6 +614,18 @@ func TestCheckSnapshot_GetDevices(t *testing.T) { } } +func TestCheckSnapshot_GetDirectConnectGatewayAttachment(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetDirectConnectGatewayAttachment(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetDirectConnectGatewayAttachment") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetLinkAssociations(t *testing.T) { svc := New(Options{}) _, err := svc.GetLinkAssociations(context.Background(), nil, func(o *Options) { @@ -1022,6 +1046,18 @@ func TestCheckSnapshot_UpdateDevice(t *testing.T) { } } +func TestCheckSnapshot_UpdateDirectConnectGatewayAttachment(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateDirectConnectGatewayAttachment(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateDirectConnectGatewayAttachment") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateGlobalNetwork(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateGlobalNetwork(context.Background(), nil, func(o *Options) { @@ -1201,6 +1237,18 @@ func TestUpdateSnapshot_CreateDevice(t *testing.T) { } } +func TestUpdateSnapshot_CreateDirectConnectGatewayAttachment(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateDirectConnectGatewayAttachment(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateDirectConnectGatewayAttachment") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateGlobalNetwork(t *testing.T) { svc := New(Options{}) _, err := svc.CreateGlobalNetwork(context.Background(), nil, func(o *Options) { @@ -1621,6 +1669,18 @@ func TestUpdateSnapshot_GetDevices(t *testing.T) { } } +func TestUpdateSnapshot_GetDirectConnectGatewayAttachment(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetDirectConnectGatewayAttachment(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetDirectConnectGatewayAttachment") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetLinkAssociations(t *testing.T) { svc := New(Options{}) _, err := svc.GetLinkAssociations(context.Background(), nil, func(o *Options) { @@ -2041,6 +2101,18 @@ func TestUpdateSnapshot_UpdateDevice(t *testing.T) { } } +func TestUpdateSnapshot_UpdateDirectConnectGatewayAttachment(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateDirectConnectGatewayAttachment(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateDirectConnectGatewayAttachment") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateGlobalNetwork(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateGlobalNetwork(context.Background(), nil, func(o *Options) { diff --git a/service/networkmanager/types/enums.go b/service/networkmanager/types/enums.go index 68d763b1099..d3d1698b619 100644 --- a/service/networkmanager/types/enums.go +++ b/service/networkmanager/types/enums.go @@ -6,14 +6,17 @@ type AttachmentErrorCode string // Enum values for AttachmentErrorCode const ( - AttachmentErrorCodeVpcNotFound AttachmentErrorCode = "VPC_NOT_FOUND" - AttachmentErrorCodeSubnetNotFound AttachmentErrorCode = "SUBNET_NOT_FOUND" - AttachmentErrorCodeSubnetDuplicatedInAvailabilityZone AttachmentErrorCode = "SUBNET_DUPLICATED_IN_AVAILABILITY_ZONE" - AttachmentErrorCodeSubnetNoFreeAddresses AttachmentErrorCode = "SUBNET_NO_FREE_ADDRESSES" - AttachmentErrorCodeSubnetUnsupportedAvailabilityZone AttachmentErrorCode = "SUBNET_UNSUPPORTED_AVAILABILITY_ZONE" - AttachmentErrorCodeSubnetNoIpv6Cidrs AttachmentErrorCode = "SUBNET_NO_IPV6_CIDRS" - AttachmentErrorCodeVpnConnectionNotFound AttachmentErrorCode = "VPN_CONNECTION_NOT_FOUND" - AttachmentErrorCodeMaximumNoEncapLimitExceeded AttachmentErrorCode = "MAXIMUM_NO_ENCAP_LIMIT_EXCEEDED" + AttachmentErrorCodeVpcNotFound AttachmentErrorCode = "VPC_NOT_FOUND" + AttachmentErrorCodeSubnetNotFound AttachmentErrorCode = "SUBNET_NOT_FOUND" + AttachmentErrorCodeSubnetDuplicatedInAvailabilityZone AttachmentErrorCode = "SUBNET_DUPLICATED_IN_AVAILABILITY_ZONE" + AttachmentErrorCodeSubnetNoFreeAddresses AttachmentErrorCode = "SUBNET_NO_FREE_ADDRESSES" + AttachmentErrorCodeSubnetUnsupportedAvailabilityZone AttachmentErrorCode = "SUBNET_UNSUPPORTED_AVAILABILITY_ZONE" + AttachmentErrorCodeSubnetNoIpv6Cidrs AttachmentErrorCode = "SUBNET_NO_IPV6_CIDRS" + AttachmentErrorCodeVpnConnectionNotFound AttachmentErrorCode = "VPN_CONNECTION_NOT_FOUND" + AttachmentErrorCodeMaximumNoEncapLimitExceeded AttachmentErrorCode = "MAXIMUM_NO_ENCAP_LIMIT_EXCEEDED" + AttachmentErrorCodeDirectConnectGatewayNotFound AttachmentErrorCode = "DIRECT_CONNECT_GATEWAY_NOT_FOUND" + AttachmentErrorCodeDirectConnectGatewayExistingAttachments AttachmentErrorCode = "DIRECT_CONNECT_GATEWAY_EXISTING_ATTACHMENTS" + AttachmentErrorCodeDirectConnectGatewayNoPrivateVif AttachmentErrorCode = "DIRECT_CONNECT_GATEWAY_NO_PRIVATE_VIF" ) // Values returns all known values for AttachmentErrorCode. Note that this can be @@ -30,6 +33,9 @@ func (AttachmentErrorCode) Values() []AttachmentErrorCode { "SUBNET_NO_IPV6_CIDRS", "VPN_CONNECTION_NOT_FOUND", "MAXIMUM_NO_ENCAP_LIMIT_EXCEEDED", + "DIRECT_CONNECT_GATEWAY_NOT_FOUND", + "DIRECT_CONNECT_GATEWAY_EXISTING_ATTACHMENTS", + "DIRECT_CONNECT_GATEWAY_NO_PRIVATE_VIF", } } @@ -73,6 +79,7 @@ const ( AttachmentTypeConnect AttachmentType = "CONNECT" AttachmentTypeSiteToSiteVpn AttachmentType = "SITE_TO_SITE_VPN" AttachmentTypeVpc AttachmentType = "VPC" + AttachmentTypeDirectConnectGateway AttachmentType = "DIRECT_CONNECT_GATEWAY" AttachmentTypeTransitGatewayRouteTable AttachmentType = "TRANSIT_GATEWAY_ROUTE_TABLE" ) @@ -85,6 +92,7 @@ func (AttachmentType) Values() []AttachmentType { "CONNECT", "SITE_TO_SITE_VPN", "VPC", + "DIRECT_CONNECT_GATEWAY", "TRANSIT_GATEWAY_ROUTE_TABLE", } } diff --git a/service/networkmanager/types/types.go b/service/networkmanager/types/types.go index cf7514462c2..f2615b76293 100644 --- a/service/networkmanager/types/types.go +++ b/service/networkmanager/types/types.go @@ -41,9 +41,15 @@ type Attachment struct { // The timestamp when the attachment was created. CreatedAt *time.Time - // The Region where the edge is located. + // The Region where the edge is located. This is returned for all attachment types + // except a Direct Connect gateway attachment, which instead returns EdgeLocations . EdgeLocation *string + // The edge locations that the Direct Connect gateway is associated with. This is + // returned only for Direct Connect gateway attachments. All other attachment types + // retrun EdgeLocation . + EdgeLocations []string + // Describes the error associated with the attachment request. LastModificationErrors []AttachmentError @@ -746,6 +752,18 @@ type Device struct { noSmithyDocumentSerde } +// Describes a Direct Connect gateway attachment. +type DirectConnectGatewayAttachment struct { + + // Describes a core network attachment. + Attachment *Attachment + + // The Direct Connect gateway attachment ARN. + DirectConnectGatewayArn *string + + noSmithyDocumentSerde +} + // Describes the edge that's used for the override. type EdgeOverride struct { diff --git a/service/networkmanager/validators.go b/service/networkmanager/validators.go index 8b470f89dfd..05407f2afde 100644 --- a/service/networkmanager/validators.go +++ b/service/networkmanager/validators.go @@ -209,6 +209,26 @@ func (m *validateOpCreateDevice) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpCreateDirectConnectGatewayAttachment struct { +} + +func (*validateOpCreateDirectConnectGatewayAttachment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDirectConnectGatewayAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDirectConnectGatewayAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDirectConnectGatewayAttachmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateLink struct { } @@ -869,6 +889,26 @@ func (m *validateOpGetDevices) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpGetDirectConnectGatewayAttachment struct { +} + +func (*validateOpGetDirectConnectGatewayAttachment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDirectConnectGatewayAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDirectConnectGatewayAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDirectConnectGatewayAttachmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetLinkAssociations struct { } @@ -1469,6 +1509,26 @@ func (m *validateOpUpdateDevice) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpUpdateDirectConnectGatewayAttachment struct { +} + +func (*validateOpUpdateDirectConnectGatewayAttachment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDirectConnectGatewayAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDirectConnectGatewayAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDirectConnectGatewayAttachmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateGlobalNetwork struct { } @@ -1609,6 +1669,10 @@ func addOpCreateDeviceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDevice{}, middleware.After) } +func addOpCreateDirectConnectGatewayAttachmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDirectConnectGatewayAttachment{}, middleware.After) +} + func addOpCreateLinkValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateLink{}, middleware.After) } @@ -1741,6 +1805,10 @@ func addOpGetDevicesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDevices{}, middleware.After) } +func addOpGetDirectConnectGatewayAttachmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDirectConnectGatewayAttachment{}, middleware.After) +} + func addOpGetLinkAssociationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetLinkAssociations{}, middleware.After) } @@ -1861,6 +1929,10 @@ func addOpUpdateDeviceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDevice{}, middleware.After) } +func addOpUpdateDirectConnectGatewayAttachmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDirectConnectGatewayAttachment{}, middleware.After) +} + func addOpUpdateGlobalNetworkValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateGlobalNetwork{}, middleware.After) } @@ -2073,6 +2145,27 @@ func validateOpCreateDeviceInput(v *CreateDeviceInput) error { } } +func validateOpCreateDirectConnectGatewayAttachmentInput(v *CreateDirectConnectGatewayAttachmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDirectConnectGatewayAttachmentInput"} + if v.CoreNetworkId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CoreNetworkId")) + } + if v.DirectConnectGatewayArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DirectConnectGatewayArn")) + } + if v.EdgeLocations == nil { + invalidParams.Add(smithy.NewErrParamRequired("EdgeLocations")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateLinkInput(v *CreateLinkInput) error { if v == nil { return nil @@ -2631,6 +2724,21 @@ func validateOpGetDevicesInput(v *GetDevicesInput) error { } } +func validateOpGetDirectConnectGatewayAttachmentInput(v *GetDirectConnectGatewayAttachmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDirectConnectGatewayAttachmentInput"} + if v.AttachmentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttachmentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetLinkAssociationsInput(v *GetLinkAssociationsInput) error { if v == nil { return nil @@ -3117,6 +3225,21 @@ func validateOpUpdateDeviceInput(v *UpdateDeviceInput) error { } } +func validateOpUpdateDirectConnectGatewayAttachmentInput(v *UpdateDirectConnectGatewayAttachmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDirectConnectGatewayAttachmentInput"} + if v.AttachmentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttachmentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateGlobalNetworkInput(v *UpdateGlobalNetworkInput) error { if v == nil { return nil diff --git a/service/s3/api_op_CompleteMultipartUpload.go b/service/s3/api_op_CompleteMultipartUpload.go index 84279309232..26f4ac1e518 100644 --- a/service/s3/api_op_CompleteMultipartUpload.go +++ b/service/s3/api_op_CompleteMultipartUpload.go @@ -244,6 +244,24 @@ type CompleteMultipartUploadInput struct { // status code 403 Forbidden (access denied). ExpectedBucketOwner *string + // Uploads the object only if the ETag (entity tag) value provided during the + // WRITE operation matches the ETag of the object in S3. If the ETag values do not + // match, the operation returns a 412 Precondition Failed error. + // + // If a conflicting operation occurs during the upload S3 returns a 409 + // ConditionalRequestConflict response. On a 409 failure you should fetch the + // object's ETag, re-initiate the multipart upload with CreateMultipartUpload , and + // re-upload each part. + // + // Expects the ETag value as a string. + // + // For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 + // User Guide. + // + // [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 + IfMatch *string + // Uploads the object only if the object key name does not already exist in the // bucket specified. Otherwise, Amazon S3 returns a 412 Precondition Failed error. // diff --git a/service/s3/api_op_PutBucketVersioning.go b/service/s3/api_op_PutBucketVersioning.go index cdb199cfaf3..fdff8fced53 100644 --- a/service/s3/api_op_PutBucketVersioning.go +++ b/service/s3/api_op_PutBucketVersioning.go @@ -18,8 +18,10 @@ import ( // This operation is not supported for directory buckets. // // When you enable versioning on a bucket for the first time, it might take a -// short amount of time for the change to be fully propagated. We recommend that -// you wait for 15 minutes after enabling versioning before issuing write +// short amount of time for the change to be fully propagated. While this change is +// propagating, you may encounter intermittent HTTP 404 NoSuchKey errors for +// requests to objects created or updated after enabling versioning. We recommend +// that you wait for 15 minutes after enabling versioning before issuing write // operations ( PUT or DELETE ) on objects in the bucket. // // Sets the versioning state of an existing bucket. diff --git a/service/s3/api_op_PutObject.go b/service/s3/api_op_PutObject.go index c47c8729560..ee314855beb 100644 --- a/service/s3/api_op_PutObject.go +++ b/service/s3/api_op_PutObject.go @@ -381,6 +381,23 @@ type PutObjectInput struct { // - This functionality is not supported for Amazon S3 on Outposts. GrantWriteACP *string + // Uploads the object only if the ETag (entity tag) value provided during the + // WRITE operation matches the ETag of the object in S3. If the ETag values do not + // match, the operation returns a 412 Precondition Failed error. + // + // If a conflicting operation occurs during the upload S3 returns a 409 + // ConditionalRequestConflict response. On a 409 failure you should fetch the + // object's ETag and retry the upload. + // + // Expects the ETag value as a string. + // + // For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 + // User Guide. + // + // [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 + IfMatch *string + // Uploads the object only if the object key name does not already exist in the // bucket specified. Otherwise, Amazon S3 returns a 412 Precondition Failed error. // diff --git a/service/s3/serializers.go b/service/s3/serializers.go index eecad22df8d..2c73b3a7e23 100644 --- a/service/s3/serializers.go +++ b/service/s3/serializers.go @@ -217,6 +217,11 @@ func awsRestxml_serializeOpHttpBindingsCompleteMultipartUploadInput(v *CompleteM encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } + if v.IfMatch != nil { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + if v.IfNoneMatch != nil { locationName := "If-None-Match" encoder.SetHeader(locationName).String(*v.IfNoneMatch) @@ -7571,6 +7576,11 @@ func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder encoder.SetHeader(locationName).String(*v.GrantWriteACP) } + if v.IfMatch != nil { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + if v.IfNoneMatch != nil { locationName := "If-None-Match" encoder.SetHeader(locationName).String(*v.IfNoneMatch)