From c6f23b11bf0cf0118ab21bf446677eeee2ae8b65 Mon Sep 17 00:00:00 2001 From: AWS SDK Rust Bot Date: Mon, 25 Nov 2024 19:33:58 +0000 Subject: [PATCH] Update SDK models --- Cargo.toml | 4 +- aws-models/direct-connect.json | 52 +++ aws-models/networkmanager.json | 298 +++++++++++- aws-models/s3.json | 16 +- .../cross_service/detect_faces/Cargo.toml | 2 +- .../cross_service/detect_labels/Cargo.toml | 2 +- .../photo_asset_management/Cargo.toml | 2 +- examples/cross_service/telephone/Cargo.toml | 2 +- examples/examples/concurrency/Cargo.toml | 2 +- .../custom-root-certificates/Cargo.toml | 2 +- examples/examples/glue/Cargo.toml | 2 +- examples/examples/iam/Cargo.toml | 2 +- examples/examples/lambda/Cargo.toml | 2 +- examples/examples/localstack/Cargo.toml | 2 +- examples/examples/s3/Cargo.toml | 2 +- examples/examples/sdk-config/Cargo.toml | 2 +- .../sending-presigned-requests/Cargo.toml | 2 +- examples/examples/testing/Cargo.toml | 2 +- examples/lambda/calculator/Cargo.toml | 2 +- sdk/directconnect/Cargo.toml | 2 +- sdk/directconnect/README.md | 2 +- sdk/directconnect/src/lib.rs | 2 +- sdk/directconnect/src/protocol_serde.rs | 2 + .../shape_associated_core_network.rs | 54 +++ ...hape_direct_connect_gateway_association.rs | 5 + sdk/directconnect/src/types.rs | 4 + .../src/types/_associated_core_network.rs | 94 ++++ .../_direct_connect_gateway_association.rs | 22 + sdk/directconnect/src/types/builders.rs | 2 + sdk/networkmanager/Cargo.toml | 2 +- sdk/networkmanager/README.md | 2 +- sdk/networkmanager/src/client.rs | 6 + ...reate_direct_connect_gateway_attachment.rs | 21 + .../get_direct_connect_gateway_attachment.rs | 15 + ...pdate_direct_connect_gateway_attachment.rs | 18 + sdk/networkmanager/src/error_meta.rs | 153 +++++++ sdk/networkmanager/src/lib.rs | 2 +- sdk/networkmanager/src/operation.rs | 9 + ...reate_direct_connect_gateway_attachment.rs | 426 +++++++++++++++++ ...direct_connect_gateway_attachment_input.rs | 162 +++++++ ...irect_connect_gateway_attachment_output.rs | 66 +++ .../builders.rs | 194 ++++++++ .../get_direct_connect_gateway_attachment.rs | 412 +++++++++++++++++ ...direct_connect_gateway_attachment_input.rs | 57 +++ ...irect_connect_gateway_attachment_output.rs | 66 +++ .../builders.rs | 125 +++++ ...pdate_direct_connect_gateway_attachment.rs | 428 ++++++++++++++++++ ...direct_connect_gateway_attachment_input.rs | 87 ++++ ...irect_connect_gateway_attachment_output.rs | 66 +++ .../builders.rs | 147 ++++++ sdk/networkmanager/src/protocol_serde.rs | 16 +- .../src/protocol_serde/shape_attachment.rs | 5 + ...reate_direct_connect_gateway_attachment.rs | 213 +++++++++ ...direct_connect_gateway_attachment_input.rs | 37 ++ ...shape_direct_connect_gateway_attachment.rs | 43 ++ ...e_get_direct_connect_gateway_attachment.rs | 176 +++++++ ...pdate_direct_connect_gateway_attachment.rs | 213 +++++++++ ...direct_connect_gateway_attachment_input.rs | 16 + sdk/networkmanager/src/types.rs | 4 + sdk/networkmanager/src/types/_attachment.rs | 40 +- .../src/types/_attachment_error_code.rs | 21 + .../src/types/_attachment_type.rs | 14 +- .../_direct_connect_gateway_attachment.rs | 72 +++ sdk/networkmanager/src/types/builders.rs | 2 + sdk/s3/Cargo.toml | 2 +- sdk/s3/README.md | 2 +- .../src/client/complete_multipart_upload.rs | 1 + sdk/s3/src/client/put_object.rs | 1 + sdk/s3/src/lib.rs | 2 +- .../_complete_multipart_upload_input.rs | 39 ++ .../complete_multipart_upload/builders.rs | 23 + .../put_bucket_versioning/builders.rs | 2 +- .../operation/put_object/_put_object_input.rs | 39 ++ sdk/s3/src/operation/put_object/builders.rs | 23 + .../shape_complete_multipart_upload.rs | 63 +-- sdk/s3/src/protocol_serde/shape_put_object.rs | 141 +++--- tests/no-default-features/Cargo.toml | 2 +- versions.toml | 46 +- 78 files changed, 4148 insertions(+), 163 deletions(-) create mode 100644 sdk/directconnect/src/protocol_serde/shape_associated_core_network.rs create mode 100644 sdk/directconnect/src/types/_associated_core_network.rs create mode 100644 sdk/networkmanager/src/client/create_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/client/get_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/client/update_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/_create_direct_connect_gateway_attachment_input.rs create mode 100644 sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/_create_direct_connect_gateway_attachment_output.rs create mode 100644 sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/builders.rs create mode 100644 sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/_get_direct_connect_gateway_attachment_input.rs create mode 100644 sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/_get_direct_connect_gateway_attachment_output.rs create mode 100644 sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/builders.rs create mode 100644 sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/_update_direct_connect_gateway_attachment_input.rs create mode 100644 sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/_update_direct_connect_gateway_attachment_output.rs create mode 100644 sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/builders.rs create mode 100644 sdk/networkmanager/src/protocol_serde/shape_create_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/protocol_serde/shape_create_direct_connect_gateway_attachment_input.rs create mode 100644 sdk/networkmanager/src/protocol_serde/shape_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/protocol_serde/shape_get_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/protocol_serde/shape_update_direct_connect_gateway_attachment.rs create mode 100644 sdk/networkmanager/src/protocol_serde/shape_update_direct_connect_gateway_attachment_input.rs create mode 100644 sdk/networkmanager/src/types/_direct_connect_gateway_attachment.rs diff --git a/Cargo.toml b/Cargo.toml index f0ebce79b500..b16e0e02482a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [workspace] resolver = "2" exclude = [ - "examples/lambda", "examples/webassembly", - "examples/cross_service", "examples/test-utils", "examples/examples", + "examples/cross_service", + "examples/lambda", "tests/webassembly", "tests/no-default-features" ] diff --git a/aws-models/direct-connect.json b/aws-models/direct-connect.json index 62a44e160343..20932898b8ec 100644 --- a/aws-models/direct-connect.json +++ b/aws-models/direct-connect.json @@ -658,6 +658,32 @@ "smithy.api#input": {} } }, + "com.amazonaws.directconnect#AssociatedCoreNetwork": { + "type": "structure", + "members": { + "id": { + "target": "com.amazonaws.directconnect#CoreNetworkIdentifier", + "traits": { + "smithy.api#documentation": "

The ID of the Cloud WAN core network.

" + } + }, + "ownerAccount": { + "target": "com.amazonaws.directconnect#OwnerAccount", + "traits": { + "smithy.api#documentation": "

The account owner of the Cloud WAN core network.

" + } + }, + "attachmentId": { + "target": "com.amazonaws.directconnect#CoreNetworkAttachmentId", + "traits": { + "smithy.api#documentation": "

the ID of the Direct Connect attachment

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The Amazon Web Services Cloud WAN core network that the Direct Connect attachment is associated with.

" + } + }, "com.amazonaws.directconnect#AssociatedGateway": { "type": "structure", "members": { @@ -1366,6 +1392,26 @@ } } }, + "com.amazonaws.directconnect#CoreNetworkAttachmentId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 12, + "max": 28 + }, + "smithy.api#pattern": "^attachment-([0-9a-f]{1,17})$" + } + }, + "com.amazonaws.directconnect#CoreNetworkIdentifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 14, + "max": 30 + }, + "smithy.api#pattern": "^core-network-([0-9a-f]{1,17})$" + } + }, "com.amazonaws.directconnect#Count": { "type": "integer", "traits": { @@ -3456,6 +3502,12 @@ "smithy.api#documentation": "

The Amazon VPC prefixes to advertise to the Direct Connect gateway.

" } }, + "associatedCoreNetwork": { + "target": "com.amazonaws.directconnect#AssociatedCoreNetwork", + "traits": { + "smithy.api#documentation": "

The ID of the Cloud WAN core network associated with the Direct Connect attachment.

" + } + }, "virtualGatewayId": { "target": "com.amazonaws.directconnect#VirtualGatewayId", "traits": { diff --git a/aws-models/networkmanager.json b/aws-models/networkmanager.json index 42f5b4a8174a..8000d04bff42 100644 --- a/aws-models/networkmanager.json +++ b/aws-models/networkmanager.json @@ -582,7 +582,13 @@ "EdgeLocation": { "target": "com.amazonaws.networkmanager#ExternalRegionCode", "traits": { - "smithy.api#documentation": "

The Region where the edge is located.

" + "smithy.api#documentation": "

The Region where the edge is located. This is returned for all attachment types except a Direct Connect gateway attachment, which instead returns EdgeLocations.

" + } + }, + "EdgeLocations": { + "target": "com.amazonaws.networkmanager#ExternalRegionCodeList", + "traits": { + "smithy.api#documentation": "

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.

" } }, "ResourceArn": { @@ -732,6 +738,24 @@ "traits": { "smithy.api#enumValue": "MAXIMUM_NO_ENCAP_LIMIT_EXCEEDED" } + }, + "DIRECT_CONNECT_GATEWAY_NOT_FOUND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIRECT_CONNECT_GATEWAY_NOT_FOUND" + } + }, + "DIRECT_CONNECT_GATEWAY_EXISTING_ATTACHMENTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIRECT_CONNECT_GATEWAY_EXISTING_ATTACHMENTS" + } + }, + "DIRECT_CONNECT_GATEWAY_NO_PRIVATE_VIF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIRECT_CONNECT_GATEWAY_NO_PRIVATE_VIF" + } } } }, @@ -843,6 +867,12 @@ "smithy.api#enumValue": "VPC" } }, + "DIRECT_CONNECT_GATEWAY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIRECT_CONNECT_GATEWAY" + } + }, "TRANSIT_GATEWAY_ROUTE_TABLE": { "target": "smithy.api#Unit", "traits": { @@ -2992,6 +3022,99 @@ "smithy.api#output": {} } }, + "com.amazonaws.networkmanager#CreateDirectConnectGatewayAttachment": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmanager#CreateDirectConnectGatewayAttachmentRequest" + }, + "output": { + "target": "com.amazonaws.networkmanager#CreateDirectConnectGatewayAttachmentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.networkmanager#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmanager#ConflictException" + }, + { + "target": "com.amazonaws.networkmanager#InternalServerException" + }, + { + "target": "com.amazonaws.networkmanager#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmanager#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmanager#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates an Amazon Web Services Direct Connect gateway attachment

", + "smithy.api#http": { + "method": "POST", + "uri": "/direct-connect-gateway-attachments", + "code": 200 + } + } + }, + "com.amazonaws.networkmanager#CreateDirectConnectGatewayAttachmentRequest": { + "type": "structure", + "members": { + "CoreNetworkId": { + "target": "com.amazonaws.networkmanager#CoreNetworkId", + "traits": { + "smithy.api#documentation": "

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.

", + "smithy.api#required": {} + } + }, + "DirectConnectGatewayArn": { + "target": "com.amazonaws.networkmanager#DirectConnectGatewayArn", + "traits": { + "smithy.api#documentation": "

The ARN of the Direct Connect gateway attachment.

", + "smithy.api#required": {} + } + }, + "EdgeLocations": { + "target": "com.amazonaws.networkmanager#ExternalRegionCodeList", + "traits": { + "smithy.api#documentation": "

One or more core network edge locations that the Direct Connect gateway attachment is associated with.

", + "smithy.api#required": {} + } + }, + "Tags": { + "target": "com.amazonaws.networkmanager#TagList", + "traits": { + "smithy.api#documentation": "

The key value tags to apply to the Direct Connect gateway attachment during creation.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.networkmanager#ClientToken", + "traits": { + "smithy.api#documentation": "

client token

", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmanager#CreateDirectConnectGatewayAttachmentResponse": { + "type": "structure", + "members": { + "DirectConnectGatewayAttachment": { + "target": "com.amazonaws.networkmanager#DirectConnectGatewayAttachment", + "traits": { + "smithy.api#documentation": "

Describes the details of a CreateDirectConnectGatewayAttachment request.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.networkmanager#CreateGlobalNetwork": { "type": "operation", "input": { @@ -4792,6 +4915,33 @@ } } }, + "com.amazonaws.networkmanager#DirectConnectGatewayArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 500 + }, + "smithy.api#pattern": "^arn:[^:]{1,63}:directconnect::[^:]{0,63}:dx-gateway\\/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$" + } + }, + "com.amazonaws.networkmanager#DirectConnectGatewayAttachment": { + "type": "structure", + "members": { + "Attachment": { + "target": "com.amazonaws.networkmanager#Attachment" + }, + "DirectConnectGatewayArn": { + "target": "com.amazonaws.networkmanager#DirectConnectGatewayArn", + "traits": { + "smithy.api#documentation": "

The Direct Connect gateway attachment ARN.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes a Direct Connect gateway attachment.

" + } + }, "com.amazonaws.networkmanager#DisassociateConnectPeer": { "type": "operation", "input": { @@ -6140,6 +6290,70 @@ "smithy.api#output": {} } }, + "com.amazonaws.networkmanager#GetDirectConnectGatewayAttachment": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmanager#GetDirectConnectGatewayAttachmentRequest" + }, + "output": { + "target": "com.amazonaws.networkmanager#GetDirectConnectGatewayAttachmentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.networkmanager#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmanager#InternalServerException" + }, + { + "target": "com.amazonaws.networkmanager#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmanager#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmanager#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about a specific Amazon Web Services Direct Connect gateway attachment.

", + "smithy.api#http": { + "method": "GET", + "uri": "/direct-connect-gateway-attachments/{AttachmentId}", + "code": 200 + } + } + }, + "com.amazonaws.networkmanager#GetDirectConnectGatewayAttachmentRequest": { + "type": "structure", + "members": { + "AttachmentId": { + "target": "com.amazonaws.networkmanager#AttachmentId", + "traits": { + "smithy.api#documentation": "

The ID of the Direct Connect gateway attachment that you want to see details about.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmanager#GetDirectConnectGatewayAttachmentResponse": { + "type": "structure", + "members": { + "DirectConnectGatewayAttachment": { + "target": "com.amazonaws.networkmanager#DirectConnectGatewayAttachment", + "traits": { + "smithy.api#documentation": "

Shows details about the Direct Connect gateway attachment.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.networkmanager#GetLinkAssociations": { "type": "operation", "input": { @@ -8719,6 +8933,9 @@ { "target": "com.amazonaws.networkmanager#CreateDevice" }, + { + "target": "com.amazonaws.networkmanager#CreateDirectConnectGatewayAttachment" + }, { "target": "com.amazonaws.networkmanager#CreateGlobalNetwork" }, @@ -8824,6 +9041,9 @@ { "target": "com.amazonaws.networkmanager#GetDevices" }, + { + "target": "com.amazonaws.networkmanager#GetDirectConnectGatewayAttachment" + }, { "target": "com.amazonaws.networkmanager#GetLinkAssociations" }, @@ -8929,6 +9149,9 @@ { "target": "com.amazonaws.networkmanager#UpdateDevice" }, + { + "target": "com.amazonaws.networkmanager#UpdateDirectConnectGatewayAttachment" + }, { "target": "com.amazonaws.networkmanager#UpdateGlobalNetwork" }, @@ -12606,6 +12829,79 @@ "smithy.api#output": {} } }, + "com.amazonaws.networkmanager#UpdateDirectConnectGatewayAttachment": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmanager#UpdateDirectConnectGatewayAttachmentRequest" + }, + "output": { + "target": "com.amazonaws.networkmanager#UpdateDirectConnectGatewayAttachmentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.networkmanager#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmanager#ConflictException" + }, + { + "target": "com.amazonaws.networkmanager#InternalServerException" + }, + { + "target": "com.amazonaws.networkmanager#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmanager#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmanager#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates the edge locations associated with an Amazon Web Services Direct Connect gateway attachment.

", + "smithy.api#http": { + "method": "PATCH", + "uri": "/direct-connect-gateway-attachments/{AttachmentId}", + "code": 200 + } + } + }, + "com.amazonaws.networkmanager#UpdateDirectConnectGatewayAttachmentRequest": { + "type": "structure", + "members": { + "AttachmentId": { + "target": "com.amazonaws.networkmanager#AttachmentId", + "traits": { + "smithy.api#documentation": "

The ID of the Direct Connect gateway attachment for the updated edge locations.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "EdgeLocations": { + "target": "com.amazonaws.networkmanager#ExternalRegionCodeList", + "traits": { + "smithy.api#documentation": "

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

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmanager#UpdateDirectConnectGatewayAttachmentResponse": { + "type": "structure", + "members": { + "DirectConnectGatewayAttachment": { + "target": "com.amazonaws.networkmanager#DirectConnectGatewayAttachment", + "traits": { + "smithy.api#documentation": "

Returns details of the Direct Connect gateway attachment with the updated edge locations.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.networkmanager#UpdateGlobalNetwork": { "type": "operation", "input": { diff --git a/aws-models/s3.json b/aws-models/s3.json index dbd1d52d435d..307ac393f313 100644 --- a/aws-models/s3.json +++ b/aws-models/s3.json @@ -18559,6 +18559,13 @@ "smithy.api#httpHeader": "x-amz-expected-bucket-owner" } }, + "IfMatch": { + "target": "com.amazonaws.s3#IfMatch", + "traits": { + "smithy.api#documentation": "

Uploads the object only if the ETag (entity tag) value provided during the WRITE\n operation matches the ETag of the object in S3. If the ETag values do not match, the\n operation returns a 412 Precondition Failed error.

\n

If a conflicting operation occurs during the upload S3 returns a 409\n ConditionalRequestConflict response. On a 409 failure you should fetch the object's ETag, re-initiate the\n multipart upload with CreateMultipartUpload, and re-upload each part.

\n

Expects the ETag value as a string.

\n

For more information about conditional requests, see RFC 7232, or Conditional requests in the Amazon S3 User Guide.

", + "smithy.api#httpHeader": "If-Match" + } + }, "IfNoneMatch": { "target": "com.amazonaws.s3#IfNoneMatch", "traits": { @@ -31038,7 +31045,7 @@ "requestAlgorithmMember": "ChecksumAlgorithm", "requestChecksumRequired": true }, - "smithy.api#documentation": "\n

This operation is not supported for directory buckets.

\n
\n \n

When you enable versioning on a bucket for the first time, it might take a short\n amount of time for the change to be fully propagated. We recommend that you wait for 15\n minutes after enabling versioning before issuing write operations (PUT or\n DELETE) on objects in the bucket.

\n
\n

Sets the versioning state of an existing bucket.

\n

You can set the versioning state with one of the following values:

\n

\n Enabled—Enables versioning for the objects in the\n bucket. All objects added to the bucket receive a unique version ID.

\n

\n Suspended—Disables versioning for the objects in the\n bucket. All objects added to the bucket receive the version ID null.

\n

If the versioning state has never been set on a bucket, it has no versioning state; a\n GetBucketVersioning request does not return a versioning state value.

\n

In order to enable MFA Delete, you must be the bucket owner. If you are the bucket owner\n and want to enable MFA Delete in the bucket versioning configuration, you must include the\n x-amz-mfa request header and the Status and the\n MfaDelete request elements in a request to set the versioning state of the\n bucket.

\n \n

If you have an object expiration lifecycle configuration in your non-versioned bucket\n and you want to maintain the same permanent delete behavior when you enable versioning,\n you must add a noncurrent expiration policy. The noncurrent expiration lifecycle\n configuration will manage the deletes of the noncurrent object versions in the\n version-enabled bucket. (A version-enabled bucket maintains one current and zero or more\n noncurrent object versions.) For more information, see Lifecycle and Versioning.

\n
\n

The following operations are related to PutBucketVersioning:

\n ", + "smithy.api#documentation": "\n

This operation is not supported for directory buckets.

\n
\n \n

When you enable versioning on a bucket for the first time, it might take a short\n amount of time for the change to be fully propagated. While this change is propagating,\n you may encounter intermittent HTTP 404 NoSuchKey errors for requests to\n objects created or updated after enabling versioning. We recommend that you wait for 15\n minutes after enabling versioning before issuing write operations (PUT or\n DELETE) on objects in the bucket.

\n
\n

Sets the versioning state of an existing bucket.

\n

You can set the versioning state with one of the following values:

\n

\n Enabled—Enables versioning for the objects in the\n bucket. All objects added to the bucket receive a unique version ID.

\n

\n Suspended—Disables versioning for the objects in the\n bucket. All objects added to the bucket receive the version ID null.

\n

If the versioning state has never been set on a bucket, it has no versioning state; a\n GetBucketVersioning request does not return a versioning state value.

\n

In order to enable MFA Delete, you must be the bucket owner. If you are the bucket owner\n and want to enable MFA Delete in the bucket versioning configuration, you must include the\n x-amz-mfa request header and the Status and the\n MfaDelete request elements in a request to set the versioning state of the\n bucket.

\n \n

If you have an object expiration lifecycle configuration in your non-versioned bucket\n and you want to maintain the same permanent delete behavior when you enable versioning,\n you must add a noncurrent expiration policy. The noncurrent expiration lifecycle\n configuration will manage the deletes of the noncurrent object versions in the\n version-enabled bucket. (A version-enabled bucket maintains one current and zero or more\n noncurrent object versions.) For more information, see Lifecycle and Versioning.

\n
\n

The following operations are related to PutBucketVersioning:

\n ", "smithy.api#examples": [ { "title": "Set versioning configuration on a bucket", @@ -31952,6 +31959,13 @@ "smithy.api#httpHeader": "Expires" } }, + "IfMatch": { + "target": "com.amazonaws.s3#IfMatch", + "traits": { + "smithy.api#documentation": "

Uploads the object only if the ETag (entity tag) value provided during the WRITE\n operation matches the ETag of the object in S3. If the ETag values do not match, the\n operation returns a 412 Precondition Failed error.

\n

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.

\n

Expects the ETag value as a string.

\n

For more information about conditional requests, see RFC 7232, or Conditional requests in the Amazon S3 User Guide.

", + "smithy.api#httpHeader": "If-Match" + } + }, "IfNoneMatch": { "target": "com.amazonaws.s3#IfNoneMatch", "traits": { diff --git a/examples/cross_service/detect_faces/Cargo.toml b/examples/cross_service/detect_faces/Cargo.toml index 221bb72b588f..c3c89615c2f5 100644 --- a/examples/cross_service/detect_faces/Cargo.toml +++ b/examples/cross_service/detect_faces/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] aws-config= { version = "1.5.10", path = "../../../sdk/aws-config" } aws-sdk-rekognition= { version = "1.52.0", path = "../../../sdk/rekognition" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } aws-smithy-types= { version = "1.2.9", path = "../../../sdk/aws-smithy-types", features = ["rt-tokio"] } [dependencies.tokio] diff --git a/examples/cross_service/detect_labels/Cargo.toml b/examples/cross_service/detect_labels/Cargo.toml index a2023826cb1a..27ba91453187 100644 --- a/examples/cross_service/detect_labels/Cargo.toml +++ b/examples/cross_service/detect_labels/Cargo.toml @@ -10,7 +10,7 @@ kamadak-exif = "0.5.4" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config" } aws-sdk-dynamodb= { version = "1.54.0", path = "../../../sdk/dynamodb" } aws-sdk-rekognition= { version = "1.52.0", path = "../../../sdk/rekognition" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } aws-smithy-types= { version = "1.2.9", path = "../../../sdk/aws-smithy-types", features = ["rt-tokio"] } aws-types= { version = "1.3.3", path = "../../../sdk/aws-types" } diff --git a/examples/cross_service/photo_asset_management/Cargo.toml b/examples/cross_service/photo_asset_management/Cargo.toml index 80c00b926a39..53bd5bfc2ed5 100644 --- a/examples/cross_service/photo_asset_management/Cargo.toml +++ b/examples/cross_service/photo_asset_management/Cargo.toml @@ -33,7 +33,7 @@ tracing = "0.1.37" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config" } aws-sdk-dynamodb= { version = "1.54.0", path = "../../../sdk/dynamodb" } aws-sdk-rekognition= { version = "1.52.0", path = "../../../sdk/rekognition" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } aws-sdk-sns= { version = "1.50.1", path = "../../../sdk/sns" } aws-smithy-runtime= { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime" } aws-smithy-types-convert= { version = "0.60.8", path = "../../../sdk/aws-smithy-types-convert", features = ["convert-chrono"] } diff --git a/examples/cross_service/telephone/Cargo.toml b/examples/cross_service/telephone/Cargo.toml index ee06cf193302..2c647c13bd08 100644 --- a/examples/cross_service/telephone/Cargo.toml +++ b/examples/cross_service/telephone/Cargo.toml @@ -13,7 +13,7 @@ reqwest = "0.11.4" serde_json = "1.0" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config" } aws-sdk-polly= { version = "1.51.1", path = "../../../sdk/polly" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } aws-sdk-transcribe= { version = "1.50.0", path = "../../../sdk/transcribe" } aws-smithy-types= { version = "1.2.9", path = "../../../sdk/aws-smithy-types", features = ["rt-tokio"] } diff --git a/examples/examples/concurrency/Cargo.toml b/examples/examples/concurrency/Cargo.toml index 8158affb6ec6..4849de58f596 100644 --- a/examples/examples/concurrency/Cargo.toml +++ b/examples/examples/concurrency/Cargo.toml @@ -26,5 +26,5 @@ features = ["env-filter"] [dev-dependencies] fastrand = "1.8.0" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } aws-sdk-sqs= { version = "1.49.0", path = "../../../sdk/sqs" } diff --git a/examples/examples/custom-root-certificates/Cargo.toml b/examples/examples/custom-root-certificates/Cargo.toml index 06e6dffbe367..acbaaba6e131 100644 --- a/examples/examples/custom-root-certificates/Cargo.toml +++ b/examples/examples/custom-root-certificates/Cargo.toml @@ -10,7 +10,7 @@ publish = false [dependencies] rustls = "0.21.9" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3", default-features = false } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3", default-features = false } aws-smithy-runtime= { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime", features = ["tls-rustls"] } [dependencies.tokio] diff --git a/examples/examples/glue/Cargo.toml b/examples/examples/glue/Cargo.toml index d70fe91263ac..ba93431638a9 100644 --- a/examples/examples/glue/Cargo.toml +++ b/examples/examples/glue/Cargo.toml @@ -20,7 +20,7 @@ futures = "0.3.25" tracing-bunyan-formatter = "0.3.4" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-sdk-glue= { version = "1.70.0", path = "../../../sdk/glue" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } aws-http= { version = "0.60.6", path = "../../../sdk/aws-http" } aws-smithy-types= { version = "1.2.9", path = "../../../sdk/aws-smithy-types" } aws-types= { version = "1.3.3", path = "../../../sdk/aws-types" } diff --git a/examples/examples/iam/Cargo.toml b/examples/examples/iam/Cargo.toml index e6d1be052975..016cd362b890 100644 --- a/examples/examples/iam/Cargo.toml +++ b/examples/examples/iam/Cargo.toml @@ -24,7 +24,7 @@ lazy_static = "1.4.0" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-credential-types= { version = "1.2.1", path = "../../../sdk/aws-credential-types", features = ["hardcoded-credentials"] } aws-sdk-iam= { version = "1.52.0", path = "../../../sdk/iam" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } aws-sdk-sts= { version = "1.50.0", path = "../../../sdk/sts" } [dependencies.sdk-examples-test-utils] diff --git a/examples/examples/lambda/Cargo.toml b/examples/examples/lambda/Cargo.toml index eac89a651746..425daca8dbc5 100644 --- a/examples/examples/lambda/Cargo.toml +++ b/examples/examples/lambda/Cargo.toml @@ -15,7 +15,7 @@ aws-config= { version = "1.5.10", path = "../../../sdk/aws-config", features = [ aws-sdk-ec2= { version = "1.92.0", path = "../../../sdk/ec2" } aws-sdk-iam= { version = "1.52.0", path = "../../../sdk/iam" } aws-sdk-lambda= { version = "1.59.0", path = "../../../sdk/lambda" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } aws-smithy-types= { version = "1.2.9", path = "../../../sdk/aws-smithy-types" } aws-types= { version = "1.3.3", path = "../../../sdk/aws-types" } diff --git a/examples/examples/localstack/Cargo.toml b/examples/examples/localstack/Cargo.toml index 6866c829cdaf..fd452d8f8e3f 100644 --- a/examples/examples/localstack/Cargo.toml +++ b/examples/examples/localstack/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] aws-config= { version = "1.5.10", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } [dependencies.tokio] version = "1" diff --git a/examples/examples/s3/Cargo.toml b/examples/examples/s3/Cargo.toml index 928ad03af043..32030998ecd1 100644 --- a/examples/examples/s3/Cargo.toml +++ b/examples/examples/s3/Cargo.toml @@ -24,7 +24,7 @@ tracing = "0.1.37" serde_json = "1" chrono = "0.4.38" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3", features = ["rt-tokio"] } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3", features = ["rt-tokio"] } aws-smithy-runtime= { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime" } aws-smithy-runtime-api= { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime-api", features = ["client"] } aws-smithy-types= { version = "1.2.9", path = "../../../sdk/aws-smithy-types", features = ["http-body-0-4-x"] } diff --git a/examples/examples/sdk-config/Cargo.toml b/examples/examples/sdk-config/Cargo.toml index 93a740c5f843..14b209bc209b 100644 --- a/examples/examples/sdk-config/Cargo.toml +++ b/examples/examples/sdk-config/Cargo.toml @@ -12,7 +12,7 @@ async_once = "0.2.6" tracing = "0.1.37" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-credential-types= { version = "1.2.1", path = "../../../sdk/aws-credential-types" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } [dependencies.tokio] version = "1.20.1" diff --git a/examples/examples/sending-presigned-requests/Cargo.toml b/examples/examples/sending-presigned-requests/Cargo.toml index c6f89892d000..f196cd79bcd6 100644 --- a/examples/examples/sending-presigned-requests/Cargo.toml +++ b/examples/examples/sending-presigned-requests/Cargo.toml @@ -10,7 +10,7 @@ publish = false hyper-tls = "0.6.0" reqwest = "0.12.9" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3", features = ["http-1x"] } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3", features = ["http-1x"] } [dependencies.clap] version = "4.5.20" diff --git a/examples/examples/testing/Cargo.toml b/examples/examples/testing/Cargo.toml index 2290db0b7cd8..f98b7645de07 100644 --- a/examples/examples/testing/Cargo.toml +++ b/examples/examples/testing/Cargo.toml @@ -17,7 +17,7 @@ mockall = "0.11.4" serde_json = "1" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-credential-types= { version = "1.2.1", path = "../../../sdk/aws-credential-types", features = ["hardcoded-credentials"] } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } aws-smithy-types= { version = "1.2.9", path = "../../../sdk/aws-smithy-types" } aws-smithy-runtime= { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime", features = ["test-util"] } aws-smithy-runtime-api= { version = "1.7.3", path = "../../../sdk/aws-smithy-runtime-api", features = ["test-util"] } diff --git a/examples/lambda/calculator/Cargo.toml b/examples/lambda/calculator/Cargo.toml index a68eff5a4fb8..cd6ca5543fe3 100644 --- a/examples/lambda/calculator/Cargo.toml +++ b/examples/lambda/calculator/Cargo.toml @@ -16,7 +16,7 @@ serde = "1.0.164" aws-config= { version = "1.5.10", path = "../../../sdk/aws-config" } aws-sdk-ec2= { version = "1.92.0", path = "../../../sdk/ec2" } aws-sdk-lambda= { version = "1.59.0", path = "../../../sdk/lambda" } -aws-sdk-s3= { version = "1.62.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.63.0", path = "../../../sdk/s3" } [dependencies.clap] version = "~4.4" diff --git a/sdk/directconnect/Cargo.toml b/sdk/directconnect/Cargo.toml index 550f0aa30003..e77d3b71e669 100644 --- a/sdk/directconnect/Cargo.toml +++ b/sdk/directconnect/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-directconnect" -version = "1.50.0" +version = "1.51.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS Direct Connect" edition = "2021" diff --git a/sdk/directconnect/README.md b/sdk/directconnect/README.md index 2b90ac6a6c87..aa5c0c4eb517 100644 --- a/sdk/directconnect/README.md +++ b/sdk/directconnect/README.md @@ -14,7 +14,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-directconnect = "1.50.0" +aws-sdk-directconnect = "1.51.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/directconnect/src/lib.rs b/sdk/directconnect/src/lib.rs index 56a82a6c881e..e435507ad815 100644 --- a/sdk/directconnect/src/lib.rs +++ b/sdk/directconnect/src/lib.rs @@ -31,7 +31,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-directconnect = "1.50.0" +//! aws-sdk-directconnect = "1.51.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/directconnect/src/protocol_serde.rs b/sdk/directconnect/src/protocol_serde.rs index 2c0e75a08754..51f18803cd6a 100644 --- a/sdk/directconnect/src/protocol_serde.rs +++ b/sdk/directconnect/src/protocol_serde.rs @@ -351,6 +351,8 @@ pub(crate) mod shape_virtual_interface_test_history; pub(crate) mod shape_virtual_interface_test_history_list; +pub(crate) mod shape_associated_core_network; + pub(crate) mod shape_associated_gateway; pub(crate) mod shape_bgp_peer; diff --git a/sdk/directconnect/src/protocol_serde/shape_associated_core_network.rs b/sdk/directconnect/src/protocol_serde/shape_associated_core_network.rs new file mode 100644 index 000000000000..00b50491ae77 --- /dev/null +++ b/sdk/directconnect/src/protocol_serde/shape_associated_core_network.rs @@ -0,0 +1,54 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_associated_core_network<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::AssociatedCoreNetworkBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "id" => { + builder = builder.set_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "ownerAccount" => { + builder = builder.set_owner_account( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "attachmentId" => { + builder = builder.set_attachment_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/directconnect/src/protocol_serde/shape_direct_connect_gateway_association.rs b/sdk/directconnect/src/protocol_serde/shape_direct_connect_gateway_association.rs index 339f380f8b7a..b9265b701d7f 100644 --- a/sdk/directconnect/src/protocol_serde/shape_direct_connect_gateway_association.rs +++ b/sdk/directconnect/src/protocol_serde/shape_direct_connect_gateway_association.rs @@ -60,6 +60,11 @@ where crate::protocol_serde::shape_route_filter_prefix_list::de_route_filter_prefix_list(tokens)?, ); } + "associatedCoreNetwork" => { + builder = builder.set_associated_core_network( + crate::protocol_serde::shape_associated_core_network::de_associated_core_network(tokens)?, + ); + } "virtualGatewayId" => { builder = builder.set_virtual_gateway_id( ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? diff --git a/sdk/directconnect/src/types.rs b/sdk/directconnect/src/types.rs index 1aa35bb77897..335d4bc5c7bc 100644 --- a/sdk/directconnect/src/types.rs +++ b/sdk/directconnect/src/types.rs @@ -25,6 +25,8 @@ pub use crate::types::_lag_state::LagState; pub use crate::types::_direct_connect_gateway_association::DirectConnectGatewayAssociation; +pub use crate::types::_associated_core_network::AssociatedCoreNetwork; + pub use crate::types::_associated_gateway::AssociatedGateway; pub use crate::types::_gateway_type::GatewayType; @@ -87,6 +89,8 @@ pub use crate::types::_new_private_virtual_interface_allocation::NewPrivateVirtu mod _address_family; +mod _associated_core_network; + mod _associated_gateway; mod _bgp_peer; diff --git a/sdk/directconnect/src/types/_associated_core_network.rs b/sdk/directconnect/src/types/_associated_core_network.rs new file mode 100644 index 000000000000..181a216fa264 --- /dev/null +++ b/sdk/directconnect/src/types/_associated_core_network.rs @@ -0,0 +1,94 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The Amazon Web Services Cloud WAN core network that the Direct Connect attachment is associated with.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct AssociatedCoreNetwork { + ///

The ID of the Cloud WAN core network.

+ pub id: ::std::option::Option<::std::string::String>, + ///

The account owner of the Cloud WAN core network.

+ pub owner_account: ::std::option::Option<::std::string::String>, + ///

the ID of the Direct Connect attachment

+ pub attachment_id: ::std::option::Option<::std::string::String>, +} +impl AssociatedCoreNetwork { + ///

The ID of the Cloud WAN core network.

+ pub fn id(&self) -> ::std::option::Option<&str> { + self.id.as_deref() + } + ///

The account owner of the Cloud WAN core network.

+ pub fn owner_account(&self) -> ::std::option::Option<&str> { + self.owner_account.as_deref() + } + ///

the ID of the Direct Connect attachment

+ pub fn attachment_id(&self) -> ::std::option::Option<&str> { + self.attachment_id.as_deref() + } +} +impl AssociatedCoreNetwork { + /// Creates a new builder-style object to manufacture [`AssociatedCoreNetwork`](crate::types::AssociatedCoreNetwork). + pub fn builder() -> crate::types::builders::AssociatedCoreNetworkBuilder { + crate::types::builders::AssociatedCoreNetworkBuilder::default() + } +} + +/// A builder for [`AssociatedCoreNetwork`](crate::types::AssociatedCoreNetwork). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct AssociatedCoreNetworkBuilder { + pub(crate) id: ::std::option::Option<::std::string::String>, + pub(crate) owner_account: ::std::option::Option<::std::string::String>, + pub(crate) attachment_id: ::std::option::Option<::std::string::String>, +} +impl AssociatedCoreNetworkBuilder { + ///

The ID of the Cloud WAN core network.

+ pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.id = ::std::option::Option::Some(input.into()); + self + } + ///

The ID of the Cloud WAN core network.

+ pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.id = input; + self + } + ///

The ID of the Cloud WAN core network.

+ pub fn get_id(&self) -> &::std::option::Option<::std::string::String> { + &self.id + } + ///

The account owner of the Cloud WAN core network.

+ pub fn owner_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.owner_account = ::std::option::Option::Some(input.into()); + self + } + ///

The account owner of the Cloud WAN core network.

+ pub fn set_owner_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.owner_account = input; + self + } + ///

The account owner of the Cloud WAN core network.

+ pub fn get_owner_account(&self) -> &::std::option::Option<::std::string::String> { + &self.owner_account + } + ///

the ID of the Direct Connect attachment

+ pub fn attachment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.attachment_id = ::std::option::Option::Some(input.into()); + self + } + ///

the ID of the Direct Connect attachment

+ pub fn set_attachment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.attachment_id = input; + self + } + ///

the ID of the Direct Connect attachment

+ pub fn get_attachment_id(&self) -> &::std::option::Option<::std::string::String> { + &self.attachment_id + } + /// Consumes the builder and constructs a [`AssociatedCoreNetwork`](crate::types::AssociatedCoreNetwork). + pub fn build(self) -> crate::types::AssociatedCoreNetwork { + crate::types::AssociatedCoreNetwork { + id: self.id, + owner_account: self.owner_account, + attachment_id: self.attachment_id, + } + } +} diff --git a/sdk/directconnect/src/types/_direct_connect_gateway_association.rs b/sdk/directconnect/src/types/_direct_connect_gateway_association.rs index 339fa5a54f74..c6b1a04b83dd 100644 --- a/sdk/directconnect/src/types/_direct_connect_gateway_association.rs +++ b/sdk/directconnect/src/types/_direct_connect_gateway_association.rs @@ -30,6 +30,8 @@ pub struct DirectConnectGatewayAssociation { pub association_id: ::std::option::Option<::std::string::String>, ///

The Amazon VPC prefixes to advertise to the Direct Connect gateway.

pub allowed_prefixes_to_direct_connect_gateway: ::std::option::Option<::std::vec::Vec>, + ///

The ID of the Cloud WAN core network associated with the Direct Connect attachment.

+ pub associated_core_network: ::std::option::Option, ///

The ID of the virtual private gateway. Applies only to private virtual interfaces.

pub virtual_gateway_id: ::std::option::Option<::std::string::String>, ///

The Amazon Web Services Region where the virtual private gateway is located.

@@ -80,6 +82,10 @@ impl DirectConnectGatewayAssociation { pub fn allowed_prefixes_to_direct_connect_gateway(&self) -> &[crate::types::RouteFilterPrefix] { self.allowed_prefixes_to_direct_connect_gateway.as_deref().unwrap_or_default() } + ///

The ID of the Cloud WAN core network associated with the Direct Connect attachment.

+ pub fn associated_core_network(&self) -> ::std::option::Option<&crate::types::AssociatedCoreNetwork> { + self.associated_core_network.as_ref() + } ///

The ID of the virtual private gateway. Applies only to private virtual interfaces.

pub fn virtual_gateway_id(&self) -> ::std::option::Option<&str> { self.virtual_gateway_id.as_deref() @@ -111,6 +117,7 @@ pub struct DirectConnectGatewayAssociationBuilder { pub(crate) associated_gateway: ::std::option::Option, pub(crate) association_id: ::std::option::Option<::std::string::String>, pub(crate) allowed_prefixes_to_direct_connect_gateway: ::std::option::Option<::std::vec::Vec>, + pub(crate) associated_core_network: ::std::option::Option, pub(crate) virtual_gateway_id: ::std::option::Option<::std::string::String>, pub(crate) virtual_gateway_region: ::std::option::Option<::std::string::String>, pub(crate) virtual_gateway_owner_account: ::std::option::Option<::std::string::String>, @@ -259,6 +266,20 @@ impl DirectConnectGatewayAssociationBuilder { pub fn get_allowed_prefixes_to_direct_connect_gateway(&self) -> &::std::option::Option<::std::vec::Vec> { &self.allowed_prefixes_to_direct_connect_gateway } + ///

The ID of the Cloud WAN core network associated with the Direct Connect attachment.

+ pub fn associated_core_network(mut self, input: crate::types::AssociatedCoreNetwork) -> Self { + self.associated_core_network = ::std::option::Option::Some(input); + self + } + ///

The ID of the Cloud WAN core network associated with the Direct Connect attachment.

+ pub fn set_associated_core_network(mut self, input: ::std::option::Option) -> Self { + self.associated_core_network = input; + self + } + ///

The ID of the Cloud WAN core network associated with the Direct Connect attachment.

+ pub fn get_associated_core_network(&self) -> &::std::option::Option { + &self.associated_core_network + } ///

The ID of the virtual private gateway. Applies only to private virtual interfaces.

pub fn virtual_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.virtual_gateway_id = ::std::option::Option::Some(input.into()); @@ -311,6 +332,7 @@ impl DirectConnectGatewayAssociationBuilder { associated_gateway: self.associated_gateway, association_id: self.association_id, allowed_prefixes_to_direct_connect_gateway: self.allowed_prefixes_to_direct_connect_gateway, + associated_core_network: self.associated_core_network, virtual_gateway_id: self.virtual_gateway_id, virtual_gateway_region: self.virtual_gateway_region, virtual_gateway_owner_account: self.virtual_gateway_owner_account, diff --git a/sdk/directconnect/src/types/builders.rs b/sdk/directconnect/src/types/builders.rs index a4f2371e00cf..80f3714e1d66 100644 --- a/sdk/directconnect/src/types/builders.rs +++ b/sdk/directconnect/src/types/builders.rs @@ -11,6 +11,8 @@ pub use crate::types::_connection::ConnectionBuilder; pub use crate::types::_direct_connect_gateway_association::DirectConnectGatewayAssociationBuilder; +pub use crate::types::_associated_core_network::AssociatedCoreNetworkBuilder; + pub use crate::types::_associated_gateway::AssociatedGatewayBuilder; pub use crate::types::_direct_connect_gateway::DirectConnectGatewayBuilder; diff --git a/sdk/networkmanager/Cargo.toml b/sdk/networkmanager/Cargo.toml index c8602cc34aeb..e134b064addb 100644 --- a/sdk/networkmanager/Cargo.toml +++ b/sdk/networkmanager/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-networkmanager" -version = "1.51.0" +version = "1.52.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS Network Manager" edition = "2021" diff --git a/sdk/networkmanager/README.md b/sdk/networkmanager/README.md index 45f10c359155..fd27ab8198c5 100644 --- a/sdk/networkmanager/README.md +++ b/sdk/networkmanager/README.md @@ -14,7 +14,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-networkmanager = "1.51.0" +aws-sdk-networkmanager = "1.52.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/networkmanager/src/client.rs b/sdk/networkmanager/src/client.rs index 7856fbdba664..0e96a46e07aa 100644 --- a/sdk/networkmanager/src/client.rs +++ b/sdk/networkmanager/src/client.rs @@ -156,6 +156,8 @@ mod create_core_network; mod create_device; +mod create_direct_connect_gateway_attachment; + mod create_global_network; mod create_link; @@ -253,6 +255,8 @@ mod get_customer_gateway_associations; mod get_devices; +mod get_direct_connect_gateway_attachment; + mod get_link_associations; mod get_links; @@ -323,6 +327,8 @@ mod update_core_network; mod update_device; +mod update_direct_connect_gateway_attachment; + mod update_global_network; mod update_link; diff --git a/sdk/networkmanager/src/client/create_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/client/create_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..c6a34b6145a1 --- /dev/null +++ b/sdk/networkmanager/src/client/create_direct_connect_gateway_attachment.rs @@ -0,0 +1,21 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`CreateDirectConnectGatewayAttachment`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`core_network_id(impl Into)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::core_network_id) / [`set_core_network_id(Option)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::set_core_network_id):
required: **true**

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.


+ /// - [`direct_connect_gateway_arn(impl Into)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::direct_connect_gateway_arn) / [`set_direct_connect_gateway_arn(Option)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::set_direct_connect_gateway_arn):
required: **true**

The ARN of the Direct Connect gateway attachment.


+ /// - [`edge_locations(impl Into)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::edge_locations) / [`set_edge_locations(Option>)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::set_edge_locations):
required: **true**

One or more core network edge locations that the Direct Connect gateway attachment is associated with.


+ /// - [`tags(Tag)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::tags) / [`set_tags(Option>)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::set_tags):
required: **false**

The key value tags to apply to the Direct Connect gateway attachment during creation.


+ /// - [`client_token(impl Into)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::set_client_token):
required: **false**

client token


+ /// - On success, responds with [`CreateDirectConnectGatewayAttachmentOutput`](crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput) with field(s): + /// - [`direct_connect_gateway_attachment(Option)`](crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput::direct_connect_gateway_attachment):

Describes the details of a CreateDirectConnectGatewayAttachment request.

+ /// - On failure, responds with [`SdkError`](crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError) + pub fn create_direct_connect_gateway_attachment( + &self, + ) -> crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder { + crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentFluentBuilder::new( + self.handle.clone(), + ) + } +} diff --git a/sdk/networkmanager/src/client/get_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/client/get_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..91c2a6179083 --- /dev/null +++ b/sdk/networkmanager/src/client/get_direct_connect_gateway_attachment.rs @@ -0,0 +1,15 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`GetDirectConnectGatewayAttachment`](crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`attachment_id(impl Into)`](crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentFluentBuilder::attachment_id) / [`set_attachment_id(Option)`](crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentFluentBuilder::set_attachment_id):
required: **true**

The ID of the Direct Connect gateway attachment that you want to see details about.


+ /// - On success, responds with [`GetDirectConnectGatewayAttachmentOutput`](crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput) with field(s): + /// - [`direct_connect_gateway_attachment(Option)`](crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput::direct_connect_gateway_attachment):

Shows details about the Direct Connect gateway attachment.

+ /// - On failure, responds with [`SdkError`](crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError) + pub fn get_direct_connect_gateway_attachment( + &self, + ) -> crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentFluentBuilder { + crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/networkmanager/src/client/update_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/client/update_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..a4fe2883a6f3 --- /dev/null +++ b/sdk/networkmanager/src/client/update_direct_connect_gateway_attachment.rs @@ -0,0 +1,18 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`UpdateDirectConnectGatewayAttachment`](crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`attachment_id(impl Into)`](crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentFluentBuilder::attachment_id) / [`set_attachment_id(Option)`](crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentFluentBuilder::set_attachment_id):
required: **true**

The ID of the Direct Connect gateway attachment for the updated edge locations.


+ /// - [`edge_locations(impl Into)`](crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentFluentBuilder::edge_locations) / [`set_edge_locations(Option>)`](crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentFluentBuilder::set_edge_locations):
required: **false**

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


+ /// - On success, responds with [`UpdateDirectConnectGatewayAttachmentOutput`](crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput) with field(s): + /// - [`direct_connect_gateway_attachment(Option)`](crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput::direct_connect_gateway_attachment):

Returns details of the Direct Connect gateway attachment with the updated edge locations.

+ /// - On failure, responds with [`SdkError`](crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError) + pub fn update_direct_connect_gateway_attachment( + &self, + ) -> crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentFluentBuilder { + crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentFluentBuilder::new( + self.handle.clone(), + ) + } +} diff --git a/sdk/networkmanager/src/error_meta.rs b/sdk/networkmanager/src/error_meta.rs index e0bb3f99ad34..d9541ba80b55 100644 --- a/sdk/networkmanager/src/error_meta.rs +++ b/sdk/networkmanager/src/error_meta.rs @@ -417,6 +417,58 @@ impl From for Error { } } } +impl + From< + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + R, + >, + > for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError) -> Self { + match err { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::AccessDeniedException(inner) => { + Error::AccessDeniedException(inner) + } + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::ConflictException(inner) => { + Error::ConflictException(inner) + } + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::ResourceNotFoundException( + inner, + ) => Error::ResourceNotFoundException(inner), + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::ThrottlingException(inner) => { + Error::ThrottlingException(inner) + } + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::ValidationException(inner) => { + Error::ValidationException(inner) + } + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::Unhandled(inner) => { + Error::Unhandled(inner) + } + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -1615,6 +1667,55 @@ impl From for Error { } } } +impl + From< + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + R, + >, + > for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError) -> Self { + match err { + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::AccessDeniedException(inner) => { + Error::AccessDeniedException(inner) + } + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::ThrottlingException(inner) => { + Error::ThrottlingException(inner) + } + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::ValidationException(inner) => { + Error::ValidationException(inner) + } + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::Unhandled(inner) => { + Error::Unhandled(inner) + } + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -2766,6 +2867,58 @@ impl From for Error { } } } +impl + From< + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + R, + >, + > for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError) -> Self { + match err { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::AccessDeniedException(inner) => { + Error::AccessDeniedException(inner) + } + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::ConflictException(inner) => { + Error::ConflictException(inner) + } + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::ResourceNotFoundException( + inner, + ) => Error::ResourceNotFoundException(inner), + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::ThrottlingException(inner) => { + Error::ThrottlingException(inner) + } + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::ValidationException(inner) => { + Error::ValidationException(inner) + } + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::Unhandled(inner) => { + Error::Unhandled(inner) + } + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, diff --git a/sdk/networkmanager/src/lib.rs b/sdk/networkmanager/src/lib.rs index 5e212cc5489a..5a00ec975a7f 100644 --- a/sdk/networkmanager/src/lib.rs +++ b/sdk/networkmanager/src/lib.rs @@ -31,7 +31,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-networkmanager = "1.51.0" +//! aws-sdk-networkmanager = "1.52.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/networkmanager/src/operation.rs b/sdk/networkmanager/src/operation.rs index d52f295ede53..f97ac6108cbd 100644 --- a/sdk/networkmanager/src/operation.rs +++ b/sdk/networkmanager/src/operation.rs @@ -31,6 +31,9 @@ pub mod create_core_network; /// Types for the `CreateDevice` operation. pub mod create_device; +/// Types for the `CreateDirectConnectGatewayAttachment` operation. +pub mod create_direct_connect_gateway_attachment; + /// Types for the `CreateGlobalNetwork` operation. pub mod create_global_network; @@ -136,6 +139,9 @@ pub mod get_customer_gateway_associations; /// Types for the `GetDevices` operation. pub mod get_devices; +/// Types for the `GetDirectConnectGatewayAttachment` operation. +pub mod get_direct_connect_gateway_attachment; + /// Types for the `GetLinkAssociations` operation. pub mod get_link_associations; @@ -241,6 +247,9 @@ pub mod update_core_network; /// Types for the `UpdateDevice` operation. pub mod update_device; +/// Types for the `UpdateDirectConnectGatewayAttachment` operation. +pub mod update_direct_connect_gateway_attachment; + /// Types for the `UpdateGlobalNetwork` operation. pub mod update_global_network; diff --git a/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..e95534e66a00 --- /dev/null +++ b/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment.rs @@ -0,0 +1,426 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `CreateDirectConnectGatewayAttachment`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateDirectConnectGatewayAttachment; +impl CreateDirectConnectGatewayAttachment { + /// Creates a new `CreateDirectConnectGatewayAttachment` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput, + ) -> ::std::result::Result< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "networkmanager", + "CreateDirectConnectGatewayAttachment", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput = + input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateDirectConnectGatewayAttachment { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateDirectConnectGatewayAttachment"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + CreateDirectConnectGatewayAttachmentRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + CreateDirectConnectGatewayAttachmentResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "CreateDirectConnectGatewayAttachment", + "networkmanager", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateDirectConnectGatewayAttachment") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(CreateDirectConnectGatewayAttachmentEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct CreateDirectConnectGatewayAttachmentResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateDirectConnectGatewayAttachmentResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_create_direct_connect_gateway_attachment::de_create_direct_connect_gateway_attachment_http_error( + status, headers, body, + ) + } else { + crate::protocol_serde::shape_create_direct_connect_gateway_attachment::de_create_direct_connect_gateway_attachment_http_response( + status, headers, body, + ) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct CreateDirectConnectGatewayAttachmentRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateDirectConnectGatewayAttachmentRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/direct-connect-gateway-attachments").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_create_direct_connect_gateway_attachment::ser_create_direct_connect_gateway_attachment_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct CreateDirectConnectGatewayAttachmentEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateDirectConnectGatewayAttachmentEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "CreateDirectConnectGatewayAttachmentEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to CreateDirectConnectGatewayAttachmentInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `CreateDirectConnectGatewayAttachmentError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum CreateDirectConnectGatewayAttachmentError { + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.

+ ConflictException(crate::types::error::ConflictException), + ///

The request has failed due to an internal error.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The specified resource could not be found.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateDirectConnectGatewayAttachmentError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl CreateDirectConnectGatewayAttachmentError { + /// Creates the `CreateDirectConnectGatewayAttachmentError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `CreateDirectConnectGatewayAttachmentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `CreateDirectConnectGatewayAttachmentError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `CreateDirectConnectGatewayAttachmentError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `CreateDirectConnectGatewayAttachmentError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `CreateDirectConnectGatewayAttachmentError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `CreateDirectConnectGatewayAttachmentError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `CreateDirectConnectGatewayAttachmentError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for CreateDirectConnectGatewayAttachmentError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for CreateDirectConnectGatewayAttachmentError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for CreateDirectConnectGatewayAttachmentError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateDirectConnectGatewayAttachmentError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateDirectConnectGatewayAttachmentError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::create_direct_connect_gateway_attachment::_create_direct_connect_gateway_attachment_output::CreateDirectConnectGatewayAttachmentOutput; + +pub use crate::operation::create_direct_connect_gateway_attachment::_create_direct_connect_gateway_attachment_input::CreateDirectConnectGatewayAttachmentInput; + +mod _create_direct_connect_gateway_attachment_input; + +mod _create_direct_connect_gateway_attachment_output; + +/// Builders +pub mod builders; diff --git a/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/_create_direct_connect_gateway_attachment_input.rs b/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/_create_direct_connect_gateway_attachment_input.rs new file mode 100644 index 000000000000..3cc0553b66da --- /dev/null +++ b/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/_create_direct_connect_gateway_attachment_input.rs @@ -0,0 +1,162 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct CreateDirectConnectGatewayAttachmentInput { + ///

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.

+ pub core_network_id: ::std::option::Option<::std::string::String>, + ///

The ARN of the Direct Connect gateway attachment.

+ pub direct_connect_gateway_arn: ::std::option::Option<::std::string::String>, + ///

One or more core network edge locations that the Direct Connect gateway attachment is associated with.

+ pub edge_locations: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

The key value tags to apply to the Direct Connect gateway attachment during creation.

+ pub tags: ::std::option::Option<::std::vec::Vec>, + ///

client token

+ pub client_token: ::std::option::Option<::std::string::String>, +} +impl CreateDirectConnectGatewayAttachmentInput { + ///

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.

+ pub fn core_network_id(&self) -> ::std::option::Option<&str> { + self.core_network_id.as_deref() + } + ///

The ARN of the Direct Connect gateway attachment.

+ pub fn direct_connect_gateway_arn(&self) -> ::std::option::Option<&str> { + self.direct_connect_gateway_arn.as_deref() + } + ///

One or more core network edge locations that the Direct Connect gateway attachment is associated with.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.edge_locations.is_none()`. + pub fn edge_locations(&self) -> &[::std::string::String] { + self.edge_locations.as_deref().unwrap_or_default() + } + ///

The key value tags to apply to the Direct Connect gateway attachment during creation.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`. + pub fn tags(&self) -> &[crate::types::Tag] { + self.tags.as_deref().unwrap_or_default() + } + ///

client token

+ pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl CreateDirectConnectGatewayAttachmentInput { + /// Creates a new builder-style object to manufacture [`CreateDirectConnectGatewayAttachmentInput`](crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput). + pub fn builder() -> crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentInputBuilder { + crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentInputBuilder::default() + } +} + +/// A builder for [`CreateDirectConnectGatewayAttachmentInput`](crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateDirectConnectGatewayAttachmentInputBuilder { + pub(crate) core_network_id: ::std::option::Option<::std::string::String>, + pub(crate) direct_connect_gateway_arn: ::std::option::Option<::std::string::String>, + pub(crate) edge_locations: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) tags: ::std::option::Option<::std::vec::Vec>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl CreateDirectConnectGatewayAttachmentInputBuilder { + ///

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.

+ /// This field is required. + pub fn core_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.core_network_id = ::std::option::Option::Some(input.into()); + self + } + ///

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.

+ pub fn set_core_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.core_network_id = input; + self + } + ///

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.

+ pub fn get_core_network_id(&self) -> &::std::option::Option<::std::string::String> { + &self.core_network_id + } + ///

The ARN of the Direct Connect gateway attachment.

+ /// This field is required. + pub fn direct_connect_gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.direct_connect_gateway_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The ARN of the Direct Connect gateway attachment.

+ pub fn set_direct_connect_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.direct_connect_gateway_arn = input; + self + } + ///

The ARN of the Direct Connect gateway attachment.

+ pub fn get_direct_connect_gateway_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.direct_connect_gateway_arn + } + /// Appends an item to `edge_locations`. + /// + /// To override the contents of this collection use [`set_edge_locations`](Self::set_edge_locations). + /// + ///

One or more core network edge locations that the Direct Connect gateway attachment is associated with.

+ pub fn edge_locations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.edge_locations.unwrap_or_default(); + v.push(input.into()); + self.edge_locations = ::std::option::Option::Some(v); + self + } + ///

One or more core network edge locations that the Direct Connect gateway attachment is associated with.

+ pub fn set_edge_locations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.edge_locations = input; + self + } + ///

One or more core network edge locations that the Direct Connect gateway attachment is associated with.

+ pub fn get_edge_locations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.edge_locations + } + /// Appends an item to `tags`. + /// + /// To override the contents of this collection use [`set_tags`](Self::set_tags). + /// + ///

The key value tags to apply to the Direct Connect gateway attachment during creation.

+ pub fn tags(mut self, input: crate::types::Tag) -> Self { + let mut v = self.tags.unwrap_or_default(); + v.push(input); + self.tags = ::std::option::Option::Some(v); + self + } + ///

The key value tags to apply to the Direct Connect gateway attachment during creation.

+ pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.tags = input; + self + } + ///

The key value tags to apply to the Direct Connect gateway attachment during creation.

+ pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.tags + } + ///

client token

+ pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

client token

+ pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

client token

+ pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`CreateDirectConnectGatewayAttachmentInput`](crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok( + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput { + core_network_id: self.core_network_id, + direct_connect_gateway_arn: self.direct_connect_gateway_arn, + edge_locations: self.edge_locations, + tags: self.tags, + client_token: self.client_token, + }, + ) + } +} diff --git a/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/_create_direct_connect_gateway_attachment_output.rs b/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/_create_direct_connect_gateway_attachment_output.rs new file mode 100644 index 000000000000..d2a5c35080a5 --- /dev/null +++ b/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/_create_direct_connect_gateway_attachment_output.rs @@ -0,0 +1,66 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct CreateDirectConnectGatewayAttachmentOutput { + ///

Describes the details of a CreateDirectConnectGatewayAttachment request.

+ pub direct_connect_gateway_attachment: ::std::option::Option, + _request_id: Option, +} +impl CreateDirectConnectGatewayAttachmentOutput { + ///

Describes the details of a CreateDirectConnectGatewayAttachment request.

+ pub fn direct_connect_gateway_attachment(&self) -> ::std::option::Option<&crate::types::DirectConnectGatewayAttachment> { + self.direct_connect_gateway_attachment.as_ref() + } +} +impl ::aws_types::request_id::RequestId for CreateDirectConnectGatewayAttachmentOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl CreateDirectConnectGatewayAttachmentOutput { + /// Creates a new builder-style object to manufacture [`CreateDirectConnectGatewayAttachmentOutput`](crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput). + pub fn builder() -> crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentOutputBuilder { + crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentOutputBuilder::default() + } +} + +/// A builder for [`CreateDirectConnectGatewayAttachmentOutput`](crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateDirectConnectGatewayAttachmentOutputBuilder { + pub(crate) direct_connect_gateway_attachment: ::std::option::Option, + _request_id: Option, +} +impl CreateDirectConnectGatewayAttachmentOutputBuilder { + ///

Describes the details of a CreateDirectConnectGatewayAttachment request.

+ pub fn direct_connect_gateway_attachment(mut self, input: crate::types::DirectConnectGatewayAttachment) -> Self { + self.direct_connect_gateway_attachment = ::std::option::Option::Some(input); + self + } + ///

Describes the details of a CreateDirectConnectGatewayAttachment request.

+ pub fn set_direct_connect_gateway_attachment(mut self, input: ::std::option::Option) -> Self { + self.direct_connect_gateway_attachment = input; + self + } + ///

Describes the details of a CreateDirectConnectGatewayAttachment request.

+ pub fn get_direct_connect_gateway_attachment(&self) -> &::std::option::Option { + &self.direct_connect_gateway_attachment + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`CreateDirectConnectGatewayAttachmentOutput`](crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput). + pub fn build(self) -> crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput { + direct_connect_gateway_attachment: self.direct_connect_gateway_attachment, + _request_id: self._request_id, + } + } +} diff --git a/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/builders.rs b/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/builders.rs new file mode 100644 index 000000000000..7bcfdb20a097 --- /dev/null +++ b/sdk/networkmanager/src/operation/create_direct_connect_gateway_attachment/builders.rs @@ -0,0 +1,194 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::create_direct_connect_gateway_attachment::_create_direct_connect_gateway_attachment_output::CreateDirectConnectGatewayAttachmentOutputBuilder; + +pub use crate::operation::create_direct_connect_gateway_attachment::_create_direct_connect_gateway_attachment_input::CreateDirectConnectGatewayAttachmentInputBuilder; + +impl crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.create_direct_connect_gateway_attachment(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `CreateDirectConnectGatewayAttachment`. +/// +///

Creates an Amazon Web Services Direct Connect gateway attachment

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct CreateDirectConnectGatewayAttachmentFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput, + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + > for CreateDirectConnectGatewayAttachmentFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput, + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl CreateDirectConnectGatewayAttachmentFluentBuilder { + /// Creates a new `CreateDirectConnectGatewayAttachmentFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the CreateDirectConnectGatewayAttachment as a reference. + pub fn as_input( + &self, + ) -> &crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachment::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachment::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput, + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.

+ pub fn core_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.core_network_id(input.into()); + self + } + ///

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.

+ pub fn set_core_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_core_network_id(input); + self + } + ///

The ID of the Cloud WAN core network that the Direct Connect gateway attachment should be attached to.

+ pub fn get_core_network_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_core_network_id() + } + ///

The ARN of the Direct Connect gateway attachment.

+ pub fn direct_connect_gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.direct_connect_gateway_arn(input.into()); + self + } + ///

The ARN of the Direct Connect gateway attachment.

+ pub fn set_direct_connect_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_direct_connect_gateway_arn(input); + self + } + ///

The ARN of the Direct Connect gateway attachment.

+ pub fn get_direct_connect_gateway_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_direct_connect_gateway_arn() + } + /// + /// Appends an item to `EdgeLocations`. + /// + /// To override the contents of this collection use [`set_edge_locations`](Self::set_edge_locations). + /// + ///

One or more core network edge locations that the Direct Connect gateway attachment is associated with.

+ pub fn edge_locations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.edge_locations(input.into()); + self + } + ///

One or more core network edge locations that the Direct Connect gateway attachment is associated with.

+ pub fn set_edge_locations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.inner = self.inner.set_edge_locations(input); + self + } + ///

One or more core network edge locations that the Direct Connect gateway attachment is associated with.

+ pub fn get_edge_locations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + self.inner.get_edge_locations() + } + /// + /// Appends an item to `Tags`. + /// + /// To override the contents of this collection use [`set_tags`](Self::set_tags). + /// + ///

The key value tags to apply to the Direct Connect gateway attachment during creation.

+ pub fn tags(mut self, input: crate::types::Tag) -> Self { + self.inner = self.inner.tags(input); + self + } + ///

The key value tags to apply to the Direct Connect gateway attachment during creation.

+ pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.inner = self.inner.set_tags(input); + self + } + ///

The key value tags to apply to the Direct Connect gateway attachment during creation.

+ pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec> { + self.inner.get_tags() + } + ///

client token

+ pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

client token

+ pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

client token

+ pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..48d5bca7a9df --- /dev/null +++ b/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment.rs @@ -0,0 +1,412 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `GetDirectConnectGatewayAttachment`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetDirectConnectGatewayAttachment; +impl GetDirectConnectGatewayAttachment { + /// Creates a new `GetDirectConnectGatewayAttachment` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentInput, + ) -> ::std::result::Result< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "networkmanager", + "GetDirectConnectGatewayAttachment", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDirectConnectGatewayAttachment { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetDirectConnectGatewayAttachment"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + GetDirectConnectGatewayAttachmentRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + GetDirectConnectGatewayAttachmentResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "GetDirectConnectGatewayAttachment", + "networkmanager", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetDirectConnectGatewayAttachment") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(GetDirectConnectGatewayAttachmentEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct GetDirectConnectGatewayAttachmentResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetDirectConnectGatewayAttachmentResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_get_direct_connect_gateway_attachment::de_get_direct_connect_gateway_attachment_http_error( + status, headers, body, + ) + } else { + crate::protocol_serde::shape_get_direct_connect_gateway_attachment::de_get_direct_connect_gateway_attachment_http_response( + status, headers, body, + ) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct GetDirectConnectGatewayAttachmentRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetDirectConnectGatewayAttachmentRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.attachment_id; + let input_1 = input_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("attachment_id", "cannot be empty or unset"))?; + let attachment_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if attachment_id.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "attachment_id", + "cannot be empty or unset", + )); + } + ::std::write!(output, "/direct-connect-gateway-attachments/{AttachmentId}", AttachmentId = attachment_id) + .expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct GetDirectConnectGatewayAttachmentEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetDirectConnectGatewayAttachmentEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "GetDirectConnectGatewayAttachmentEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to GetDirectConnectGatewayAttachmentInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `GetDirectConnectGatewayAttachmentError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum GetDirectConnectGatewayAttachmentError { + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

The request has failed due to an internal error.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The specified resource could not be found.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetDirectConnectGatewayAttachmentError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl GetDirectConnectGatewayAttachmentError { + /// Creates the `GetDirectConnectGatewayAttachmentError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `GetDirectConnectGatewayAttachmentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `GetDirectConnectGatewayAttachmentError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `GetDirectConnectGatewayAttachmentError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `GetDirectConnectGatewayAttachmentError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `GetDirectConnectGatewayAttachmentError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `GetDirectConnectGatewayAttachmentError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for GetDirectConnectGatewayAttachmentError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for GetDirectConnectGatewayAttachmentError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for GetDirectConnectGatewayAttachmentError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetDirectConnectGatewayAttachmentError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetDirectConnectGatewayAttachmentError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::get_direct_connect_gateway_attachment::_get_direct_connect_gateway_attachment_output::GetDirectConnectGatewayAttachmentOutput; + +pub use crate::operation::get_direct_connect_gateway_attachment::_get_direct_connect_gateway_attachment_input::GetDirectConnectGatewayAttachmentInput; + +mod _get_direct_connect_gateway_attachment_input; + +mod _get_direct_connect_gateway_attachment_output; + +/// Builders +pub mod builders; diff --git a/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/_get_direct_connect_gateway_attachment_input.rs b/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/_get_direct_connect_gateway_attachment_input.rs new file mode 100644 index 000000000000..ceecbfcf0137 --- /dev/null +++ b/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/_get_direct_connect_gateway_attachment_input.rs @@ -0,0 +1,57 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetDirectConnectGatewayAttachmentInput { + ///

The ID of the Direct Connect gateway attachment that you want to see details about.

+ pub attachment_id: ::std::option::Option<::std::string::String>, +} +impl GetDirectConnectGatewayAttachmentInput { + ///

The ID of the Direct Connect gateway attachment that you want to see details about.

+ pub fn attachment_id(&self) -> ::std::option::Option<&str> { + self.attachment_id.as_deref() + } +} +impl GetDirectConnectGatewayAttachmentInput { + /// Creates a new builder-style object to manufacture [`GetDirectConnectGatewayAttachmentInput`](crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentInput). + pub fn builder() -> crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentInputBuilder { + crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentInputBuilder::default() + } +} + +/// A builder for [`GetDirectConnectGatewayAttachmentInput`](crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetDirectConnectGatewayAttachmentInputBuilder { + pub(crate) attachment_id: ::std::option::Option<::std::string::String>, +} +impl GetDirectConnectGatewayAttachmentInputBuilder { + ///

The ID of the Direct Connect gateway attachment that you want to see details about.

+ /// This field is required. + pub fn attachment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.attachment_id = ::std::option::Option::Some(input.into()); + self + } + ///

The ID of the Direct Connect gateway attachment that you want to see details about.

+ pub fn set_attachment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.attachment_id = input; + self + } + ///

The ID of the Direct Connect gateway attachment that you want to see details about.

+ pub fn get_attachment_id(&self) -> &::std::option::Option<::std::string::String> { + &self.attachment_id + } + /// Consumes the builder and constructs a [`GetDirectConnectGatewayAttachmentInput`](crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok( + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentInput { + attachment_id: self.attachment_id, + }, + ) + } +} diff --git a/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/_get_direct_connect_gateway_attachment_output.rs b/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/_get_direct_connect_gateway_attachment_output.rs new file mode 100644 index 000000000000..4077d23bb121 --- /dev/null +++ b/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/_get_direct_connect_gateway_attachment_output.rs @@ -0,0 +1,66 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetDirectConnectGatewayAttachmentOutput { + ///

Shows details about the Direct Connect gateway attachment.

+ pub direct_connect_gateway_attachment: ::std::option::Option, + _request_id: Option, +} +impl GetDirectConnectGatewayAttachmentOutput { + ///

Shows details about the Direct Connect gateway attachment.

+ pub fn direct_connect_gateway_attachment(&self) -> ::std::option::Option<&crate::types::DirectConnectGatewayAttachment> { + self.direct_connect_gateway_attachment.as_ref() + } +} +impl ::aws_types::request_id::RequestId for GetDirectConnectGatewayAttachmentOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl GetDirectConnectGatewayAttachmentOutput { + /// Creates a new builder-style object to manufacture [`GetDirectConnectGatewayAttachmentOutput`](crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput). + pub fn builder() -> crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentOutputBuilder { + crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentOutputBuilder::default() + } +} + +/// A builder for [`GetDirectConnectGatewayAttachmentOutput`](crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetDirectConnectGatewayAttachmentOutputBuilder { + pub(crate) direct_connect_gateway_attachment: ::std::option::Option, + _request_id: Option, +} +impl GetDirectConnectGatewayAttachmentOutputBuilder { + ///

Shows details about the Direct Connect gateway attachment.

+ pub fn direct_connect_gateway_attachment(mut self, input: crate::types::DirectConnectGatewayAttachment) -> Self { + self.direct_connect_gateway_attachment = ::std::option::Option::Some(input); + self + } + ///

Shows details about the Direct Connect gateway attachment.

+ pub fn set_direct_connect_gateway_attachment(mut self, input: ::std::option::Option) -> Self { + self.direct_connect_gateway_attachment = input; + self + } + ///

Shows details about the Direct Connect gateway attachment.

+ pub fn get_direct_connect_gateway_attachment(&self) -> &::std::option::Option { + &self.direct_connect_gateway_attachment + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`GetDirectConnectGatewayAttachmentOutput`](crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput). + pub fn build(self) -> crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput { + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput { + direct_connect_gateway_attachment: self.direct_connect_gateway_attachment, + _request_id: self._request_id, + } + } +} diff --git a/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/builders.rs b/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/builders.rs new file mode 100644 index 000000000000..89c72068b574 --- /dev/null +++ b/sdk/networkmanager/src/operation/get_direct_connect_gateway_attachment/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::get_direct_connect_gateway_attachment::_get_direct_connect_gateway_attachment_output::GetDirectConnectGatewayAttachmentOutputBuilder; + +pub use crate::operation::get_direct_connect_gateway_attachment::_get_direct_connect_gateway_attachment_input::GetDirectConnectGatewayAttachmentInputBuilder; + +impl crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.get_direct_connect_gateway_attachment(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `GetDirectConnectGatewayAttachment`. +/// +///

Returns information about a specific Amazon Web Services Direct Connect gateway attachment.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct GetDirectConnectGatewayAttachmentFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput, + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + > for GetDirectConnectGatewayAttachmentFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput, + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl GetDirectConnectGatewayAttachmentFluentBuilder { + /// Creates a new `GetDirectConnectGatewayAttachmentFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the GetDirectConnectGatewayAttachment as a reference. + pub fn as_input(&self) -> &crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachment::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachment::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput, + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The ID of the Direct Connect gateway attachment that you want to see details about.

+ pub fn attachment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.attachment_id(input.into()); + self + } + ///

The ID of the Direct Connect gateway attachment that you want to see details about.

+ pub fn set_attachment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_attachment_id(input); + self + } + ///

The ID of the Direct Connect gateway attachment that you want to see details about.

+ pub fn get_attachment_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_attachment_id() + } +} diff --git a/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..2087dc92d38b --- /dev/null +++ b/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment.rs @@ -0,0 +1,428 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `UpdateDirectConnectGatewayAttachment`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateDirectConnectGatewayAttachment; +impl UpdateDirectConnectGatewayAttachment { + /// Creates a new `UpdateDirectConnectGatewayAttachment` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput, + ) -> ::std::result::Result< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "networkmanager", + "UpdateDirectConnectGatewayAttachment", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateDirectConnectGatewayAttachment { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateDirectConnectGatewayAttachment"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + UpdateDirectConnectGatewayAttachmentRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + UpdateDirectConnectGatewayAttachmentResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "UpdateDirectConnectGatewayAttachment", + "networkmanager", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateDirectConnectGatewayAttachment") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(UpdateDirectConnectGatewayAttachmentEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct UpdateDirectConnectGatewayAttachmentResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateDirectConnectGatewayAttachmentResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_update_direct_connect_gateway_attachment::de_update_direct_connect_gateway_attachment_http_error( + status, headers, body, + ) + } else { + crate::protocol_serde::shape_update_direct_connect_gateway_attachment::de_update_direct_connect_gateway_attachment_http_response( + status, headers, body, + ) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct UpdateDirectConnectGatewayAttachmentRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateDirectConnectGatewayAttachmentRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.attachment_id; + let input_1 = input_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("attachment_id", "cannot be empty or unset"))?; + let attachment_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if attachment_id.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "attachment_id", + "cannot be empty or unset", + )); + } + ::std::write!(output, "/direct-connect-gateway-attachments/{AttachmentId}", AttachmentId = attachment_id) + .expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_update_direct_connect_gateway_attachment::ser_update_direct_connect_gateway_attachment_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct UpdateDirectConnectGatewayAttachmentEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateDirectConnectGatewayAttachmentEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "UpdateDirectConnectGatewayAttachmentEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to UpdateDirectConnectGatewayAttachmentInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `UpdateDirectConnectGatewayAttachmentError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum UpdateDirectConnectGatewayAttachmentError { + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.

+ ConflictException(crate::types::error::ConflictException), + ///

The request has failed due to an internal error.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The specified resource could not be found.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateDirectConnectGatewayAttachmentError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl UpdateDirectConnectGatewayAttachmentError { + /// Creates the `UpdateDirectConnectGatewayAttachmentError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `UpdateDirectConnectGatewayAttachmentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `UpdateDirectConnectGatewayAttachmentError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `UpdateDirectConnectGatewayAttachmentError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `UpdateDirectConnectGatewayAttachmentError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `UpdateDirectConnectGatewayAttachmentError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `UpdateDirectConnectGatewayAttachmentError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `UpdateDirectConnectGatewayAttachmentError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for UpdateDirectConnectGatewayAttachmentError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for UpdateDirectConnectGatewayAttachmentError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateDirectConnectGatewayAttachmentError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateDirectConnectGatewayAttachmentError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateDirectConnectGatewayAttachmentError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::update_direct_connect_gateway_attachment::_update_direct_connect_gateway_attachment_output::UpdateDirectConnectGatewayAttachmentOutput; + +pub use crate::operation::update_direct_connect_gateway_attachment::_update_direct_connect_gateway_attachment_input::UpdateDirectConnectGatewayAttachmentInput; + +mod _update_direct_connect_gateway_attachment_input; + +mod _update_direct_connect_gateway_attachment_output; + +/// Builders +pub mod builders; diff --git a/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/_update_direct_connect_gateway_attachment_input.rs b/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/_update_direct_connect_gateway_attachment_input.rs new file mode 100644 index 000000000000..78d71c86eeff --- /dev/null +++ b/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/_update_direct_connect_gateway_attachment_input.rs @@ -0,0 +1,87 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateDirectConnectGatewayAttachmentInput { + ///

The ID of the Direct Connect gateway attachment for the updated edge locations.

+ pub attachment_id: ::std::option::Option<::std::string::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

+ pub edge_locations: ::std::option::Option<::std::vec::Vec<::std::string::String>>, +} +impl UpdateDirectConnectGatewayAttachmentInput { + ///

The ID of the Direct Connect gateway attachment for the updated edge locations.

+ pub fn attachment_id(&self) -> ::std::option::Option<&str> { + self.attachment_id.as_deref() + } + ///

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

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.edge_locations.is_none()`. + pub fn edge_locations(&self) -> &[::std::string::String] { + self.edge_locations.as_deref().unwrap_or_default() + } +} +impl UpdateDirectConnectGatewayAttachmentInput { + /// Creates a new builder-style object to manufacture [`UpdateDirectConnectGatewayAttachmentInput`](crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput). + pub fn builder() -> crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentInputBuilder { + crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentInputBuilder::default() + } +} + +/// A builder for [`UpdateDirectConnectGatewayAttachmentInput`](crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateDirectConnectGatewayAttachmentInputBuilder { + pub(crate) attachment_id: ::std::option::Option<::std::string::String>, + pub(crate) edge_locations: ::std::option::Option<::std::vec::Vec<::std::string::String>>, +} +impl UpdateDirectConnectGatewayAttachmentInputBuilder { + ///

The ID of the Direct Connect gateway attachment for the updated edge locations.

+ /// This field is required. + pub fn attachment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.attachment_id = ::std::option::Option::Some(input.into()); + self + } + ///

The ID of the Direct Connect gateway attachment for the updated edge locations.

+ pub fn set_attachment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.attachment_id = input; + self + } + ///

The ID of the Direct Connect gateway attachment for the updated edge locations.

+ pub fn get_attachment_id(&self) -> &::std::option::Option<::std::string::String> { + &self.attachment_id + } + /// Appends an item to `edge_locations`. + /// + /// To override the contents of this collection use [`set_edge_locations`](Self::set_edge_locations). + /// + ///

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

+ pub fn edge_locations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.edge_locations.unwrap_or_default(); + v.push(input.into()); + self.edge_locations = ::std::option::Option::Some(v); + self + } + ///

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

+ pub fn set_edge_locations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.edge_locations = input; + self + } + ///

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

+ pub fn get_edge_locations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.edge_locations + } + /// Consumes the builder and constructs a [`UpdateDirectConnectGatewayAttachmentInput`](crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok( + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput { + attachment_id: self.attachment_id, + edge_locations: self.edge_locations, + }, + ) + } +} diff --git a/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/_update_direct_connect_gateway_attachment_output.rs b/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/_update_direct_connect_gateway_attachment_output.rs new file mode 100644 index 000000000000..a2645f5310c1 --- /dev/null +++ b/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/_update_direct_connect_gateway_attachment_output.rs @@ -0,0 +1,66 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateDirectConnectGatewayAttachmentOutput { + ///

Returns details of the Direct Connect gateway attachment with the updated edge locations.

+ pub direct_connect_gateway_attachment: ::std::option::Option, + _request_id: Option, +} +impl UpdateDirectConnectGatewayAttachmentOutput { + ///

Returns details of the Direct Connect gateway attachment with the updated edge locations.

+ pub fn direct_connect_gateway_attachment(&self) -> ::std::option::Option<&crate::types::DirectConnectGatewayAttachment> { + self.direct_connect_gateway_attachment.as_ref() + } +} +impl ::aws_types::request_id::RequestId for UpdateDirectConnectGatewayAttachmentOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl UpdateDirectConnectGatewayAttachmentOutput { + /// Creates a new builder-style object to manufacture [`UpdateDirectConnectGatewayAttachmentOutput`](crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput). + pub fn builder() -> crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentOutputBuilder { + crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentOutputBuilder::default() + } +} + +/// A builder for [`UpdateDirectConnectGatewayAttachmentOutput`](crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateDirectConnectGatewayAttachmentOutputBuilder { + pub(crate) direct_connect_gateway_attachment: ::std::option::Option, + _request_id: Option, +} +impl UpdateDirectConnectGatewayAttachmentOutputBuilder { + ///

Returns details of the Direct Connect gateway attachment with the updated edge locations.

+ pub fn direct_connect_gateway_attachment(mut self, input: crate::types::DirectConnectGatewayAttachment) -> Self { + self.direct_connect_gateway_attachment = ::std::option::Option::Some(input); + self + } + ///

Returns details of the Direct Connect gateway attachment with the updated edge locations.

+ pub fn set_direct_connect_gateway_attachment(mut self, input: ::std::option::Option) -> Self { + self.direct_connect_gateway_attachment = input; + self + } + ///

Returns details of the Direct Connect gateway attachment with the updated edge locations.

+ pub fn get_direct_connect_gateway_attachment(&self) -> &::std::option::Option { + &self.direct_connect_gateway_attachment + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`UpdateDirectConnectGatewayAttachmentOutput`](crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput). + pub fn build(self) -> crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput { + direct_connect_gateway_attachment: self.direct_connect_gateway_attachment, + _request_id: self._request_id, + } + } +} diff --git a/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/builders.rs b/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/builders.rs new file mode 100644 index 000000000000..b97ca0030dcb --- /dev/null +++ b/sdk/networkmanager/src/operation/update_direct_connect_gateway_attachment/builders.rs @@ -0,0 +1,147 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::update_direct_connect_gateway_attachment::_update_direct_connect_gateway_attachment_output::UpdateDirectConnectGatewayAttachmentOutputBuilder; + +pub use crate::operation::update_direct_connect_gateway_attachment::_update_direct_connect_gateway_attachment_input::UpdateDirectConnectGatewayAttachmentInputBuilder; + +impl crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.update_direct_connect_gateway_attachment(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `UpdateDirectConnectGatewayAttachment`. +/// +///

Updates the edge locations associated with an Amazon Web Services Direct Connect gateway attachment.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct UpdateDirectConnectGatewayAttachmentFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput, + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + > for UpdateDirectConnectGatewayAttachmentFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput, + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl UpdateDirectConnectGatewayAttachmentFluentBuilder { + /// Creates a new `UpdateDirectConnectGatewayAttachmentFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the UpdateDirectConnectGatewayAttachment as a reference. + pub fn as_input( + &self, + ) -> &crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachment::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachment::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput, + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The ID of the Direct Connect gateway attachment for the updated edge locations.

+ pub fn attachment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.attachment_id(input.into()); + self + } + ///

The ID of the Direct Connect gateway attachment for the updated edge locations.

+ pub fn set_attachment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_attachment_id(input); + self + } + ///

The ID of the Direct Connect gateway attachment for the updated edge locations.

+ pub fn get_attachment_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_attachment_id() + } + /// + /// Appends an item to `EdgeLocations`. + /// + /// To override the contents of this collection use [`set_edge_locations`](Self::set_edge_locations). + /// + ///

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

+ pub fn edge_locations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.edge_locations(input.into()); + self + } + ///

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

+ pub fn set_edge_locations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.inner = self.inner.set_edge_locations(input); + self + } + ///

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

+ pub fn get_edge_locations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + self.inner.get_edge_locations() + } +} diff --git a/sdk/networkmanager/src/protocol_serde.rs b/sdk/networkmanager/src/protocol_serde.rs index 90f97c3527a5..0c231dfe1bc6 100644 --- a/sdk/networkmanager/src/protocol_serde.rs +++ b/sdk/networkmanager/src/protocol_serde.rs @@ -43,6 +43,8 @@ pub(crate) mod shape_create_core_network; pub(crate) mod shape_create_device; +pub(crate) mod shape_create_direct_connect_gateway_attachment; + pub(crate) mod shape_create_global_network; pub(crate) mod shape_create_link; @@ -113,6 +115,8 @@ pub(crate) mod shape_get_customer_gateway_associations; pub(crate) mod shape_get_devices; +pub(crate) mod shape_get_direct_connect_gateway_attachment; + pub(crate) mod shape_get_link_associations; pub(crate) mod shape_get_links; @@ -183,6 +187,8 @@ pub(crate) mod shape_update_core_network; pub(crate) mod shape_update_device; +pub(crate) mod shape_update_direct_connect_gateway_attachment; + pub(crate) mod shape_update_global_network; pub(crate) mod shape_update_link; @@ -225,6 +231,8 @@ pub(crate) mod shape_create_core_network_input; pub(crate) mod shape_create_device_input; +pub(crate) mod shape_create_direct_connect_gateway_attachment_input; + pub(crate) mod shape_create_global_network_input; pub(crate) mod shape_create_link_input; @@ -267,6 +275,8 @@ pub(crate) mod shape_update_core_network_input; pub(crate) mod shape_update_device_input; +pub(crate) mod shape_update_direct_connect_gateway_attachment_input; + pub(crate) mod shape_update_global_network_input; pub(crate) mod shape_update_link_input; @@ -329,6 +339,8 @@ pub(crate) mod shape_device; pub(crate) mod shape_device_list; +pub(crate) mod shape_direct_connect_gateway_attachment; + pub(crate) mod shape_exception_context_map; pub(crate) mod shape_global_network; @@ -425,6 +437,8 @@ pub(crate) mod shape_core_network_segment_list; pub(crate) mod shape_core_network_summary; +pub(crate) mod shape_external_region_code_list; + pub(crate) mod shape_network_resource; pub(crate) mod shape_network_resource_count; @@ -483,8 +497,6 @@ pub(crate) mod shape_route_analysis_completion; pub(crate) mod shape_connect_peer_bgp_configuration; -pub(crate) mod shape_external_region_code_list; - pub(crate) mod shape_network_route_destination; pub(crate) mod shape_path_component; diff --git a/sdk/networkmanager/src/protocol_serde/shape_attachment.rs b/sdk/networkmanager/src/protocol_serde/shape_attachment.rs index e865d9c77377..4570a743f63d 100644 --- a/sdk/networkmanager/src/protocol_serde/shape_attachment.rs +++ b/sdk/networkmanager/src/protocol_serde/shape_attachment.rs @@ -63,6 +63,11 @@ where .transpose()?, ); } + "EdgeLocations" => { + builder = builder.set_edge_locations( + crate::protocol_serde::shape_external_region_code_list::de_external_region_code_list(tokens)?, + ); + } "ResourceArn" => { builder = builder.set_resource_arn( ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? diff --git a/sdk/networkmanager/src/protocol_serde/shape_create_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/protocol_serde/shape_create_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..b50b6cbebabd --- /dev/null +++ b/sdk/networkmanager/src/protocol_serde/shape_create_direct_connect_gateway_attachment.rs @@ -0,0 +1,213 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_direct_connect_gateway_attachment_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput, + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled(generic)) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ConflictException" => { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::conflict_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "InternalServerException" => { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ResourceNotFoundException" => { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ThrottlingException" => { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ValidationException" => { + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + _ => crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_direct_connect_gateway_attachment_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentOutput, + crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = + crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentOutputBuilder::default(); + output = crate::protocol_serde::shape_create_direct_connect_gateway_attachment::de_create_direct_connect_gateway_attachment( + _response_body, + output, + ) + .map_err(crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_create_direct_connect_gateway_attachment_input( + input: &crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_create_direct_connect_gateway_attachment_input::ser_create_direct_connect_gateway_attachment_input_input( + &mut object, + input, + )?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_create_direct_connect_gateway_attachment( + value: &[u8], + mut builder: crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentOutputBuilder, +) -> Result< + crate::operation::create_direct_connect_gateway_attachment::builders::CreateDirectConnectGatewayAttachmentOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectConnectGatewayAttachment" => { + builder = builder.set_direct_connect_gateway_attachment( + crate::protocol_serde::shape_direct_connect_gateway_attachment::de_direct_connect_gateway_attachment(tokens)?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/networkmanager/src/protocol_serde/shape_create_direct_connect_gateway_attachment_input.rs b/sdk/networkmanager/src/protocol_serde/shape_create_direct_connect_gateway_attachment_input.rs new file mode 100644 index 000000000000..2c3f1bb1f580 --- /dev/null +++ b/sdk/networkmanager/src/protocol_serde/shape_create_direct_connect_gateway_attachment_input.rs @@ -0,0 +1,37 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_create_direct_connect_gateway_attachment_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::create_direct_connect_gateway_attachment::CreateDirectConnectGatewayAttachmentInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.core_network_id { + object.key("CoreNetworkId").string(var_2.as_str()); + } + if let Some(var_3) = &input.direct_connect_gateway_arn { + object.key("DirectConnectGatewayArn").string(var_3.as_str()); + } + if let Some(var_4) = &input.edge_locations { + let mut array_5 = object.key("EdgeLocations").start_array(); + for item_6 in var_4 { + { + array_5.value().string(item_6.as_str()); + } + } + array_5.finish(); + } + if let Some(var_7) = &input.tags { + let mut array_8 = object.key("Tags").start_array(); + for item_9 in var_7 { + { + #[allow(unused_mut)] + let mut object_10 = array_8.value().start_object(); + crate::protocol_serde::shape_tag::ser_tag(&mut object_10, item_9)?; + object_10.finish(); + } + } + array_8.finish(); + } + Ok(()) +} diff --git a/sdk/networkmanager/src/protocol_serde/shape_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/protocol_serde/shape_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..117ec458a929 --- /dev/null +++ b/sdk/networkmanager/src/protocol_serde/shape_direct_connect_gateway_attachment.rs @@ -0,0 +1,43 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_direct_connect_gateway_attachment<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::DirectConnectGatewayAttachmentBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Attachment" => { + builder = builder.set_attachment(crate::protocol_serde::shape_attachment::de_attachment(tokens)?); + } + "DirectConnectGatewayArn" => { + builder = builder.set_direct_connect_gateway_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/networkmanager/src/protocol_serde/shape_get_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/protocol_serde/shape_get_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..900c44652a1e --- /dev/null +++ b/sdk/networkmanager/src/protocol_serde/shape_get_direct_connect_gateway_attachment.rs @@ -0,0 +1,176 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_direct_connect_gateway_attachment_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput, + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => { + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "InternalServerException" => { + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ResourceNotFoundException" => { + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = + crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ThrottlingException" => { + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ValidationException" => { + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + _ => crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_direct_connect_gateway_attachment_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentOutput, + crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentOutputBuilder::default(); + output = crate::protocol_serde::shape_get_direct_connect_gateway_attachment::de_get_direct_connect_gateway_attachment(_response_body, output) + .map_err(crate::operation::get_direct_connect_gateway_attachment::GetDirectConnectGatewayAttachmentError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub(crate) fn de_get_direct_connect_gateway_attachment( + value: &[u8], + mut builder: crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentOutputBuilder, +) -> Result< + crate::operation::get_direct_connect_gateway_attachment::builders::GetDirectConnectGatewayAttachmentOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectConnectGatewayAttachment" => { + builder = builder.set_direct_connect_gateway_attachment( + crate::protocol_serde::shape_direct_connect_gateway_attachment::de_direct_connect_gateway_attachment(tokens)?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/networkmanager/src/protocol_serde/shape_update_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/protocol_serde/shape_update_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..3ed4caa90d63 --- /dev/null +++ b/sdk/networkmanager/src/protocol_serde/shape_update_direct_connect_gateway_attachment.rs @@ -0,0 +1,213 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_direct_connect_gateway_attachment_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput, + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled(generic)) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ConflictException" => { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::conflict_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "InternalServerException" => { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ResourceNotFoundException" => { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ThrottlingException" => { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + "ValidationException" => { + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)? + }; + tmp + }) + } + _ => crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_direct_connect_gateway_attachment_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentOutput, + crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = + crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentOutputBuilder::default(); + output = crate::protocol_serde::shape_update_direct_connect_gateway_attachment::de_update_direct_connect_gateway_attachment( + _response_body, + output, + ) + .map_err(crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_update_direct_connect_gateway_attachment_input( + input: &crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_update_direct_connect_gateway_attachment_input::ser_update_direct_connect_gateway_attachment_input_input( + &mut object, + input, + )?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_update_direct_connect_gateway_attachment( + value: &[u8], + mut builder: crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentOutputBuilder, +) -> Result< + crate::operation::update_direct_connect_gateway_attachment::builders::UpdateDirectConnectGatewayAttachmentOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectConnectGatewayAttachment" => { + builder = builder.set_direct_connect_gateway_attachment( + crate::protocol_serde::shape_direct_connect_gateway_attachment::de_direct_connect_gateway_attachment(tokens)?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/networkmanager/src/protocol_serde/shape_update_direct_connect_gateway_attachment_input.rs b/sdk/networkmanager/src/protocol_serde/shape_update_direct_connect_gateway_attachment_input.rs new file mode 100644 index 000000000000..6147584e4043 --- /dev/null +++ b/sdk/networkmanager/src/protocol_serde/shape_update_direct_connect_gateway_attachment_input.rs @@ -0,0 +1,16 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_update_direct_connect_gateway_attachment_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::update_direct_connect_gateway_attachment::UpdateDirectConnectGatewayAttachmentInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.edge_locations { + let mut array_2 = object.key("EdgeLocations").start_array(); + for item_3 in var_1 { + { + array_2.value().string(item_3.as_str()); + } + } + array_2.finish(); + } + Ok(()) +} diff --git a/sdk/networkmanager/src/types.rs b/sdk/networkmanager/src/types.rs index 779f3c71bd0d..13cc221a8c3c 100644 --- a/sdk/networkmanager/src/types.rs +++ b/sdk/networkmanager/src/types.rs @@ -39,6 +39,8 @@ pub use crate::types::_global_network::GlobalNetwork; pub use crate::types::_global_network_state::GlobalNetworkState; +pub use crate::types::_direct_connect_gateway_attachment::DirectConnectGatewayAttachment; + pub use crate::types::_device::Device; pub use crate::types::_device_state::DeviceState; @@ -315,6 +317,8 @@ mod _device; mod _device_state; +mod _direct_connect_gateway_attachment; + mod _edge_override; mod _global_network; diff --git a/sdk/networkmanager/src/types/_attachment.rs b/sdk/networkmanager/src/types/_attachment.rs index b0718fb055d4..bc8ef5c59768 100644 --- a/sdk/networkmanager/src/types/_attachment.rs +++ b/sdk/networkmanager/src/types/_attachment.rs @@ -16,8 +16,10 @@ pub struct Attachment { pub attachment_type: ::std::option::Option, ///

The state of the attachment.

pub state: ::std::option::Option, - ///

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.

pub edge_location: ::std::option::Option<::std::string::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.

+ pub edge_locations: ::std::option::Option<::std::vec::Vec<::std::string::String>>, ///

The attachment resource ARN.

pub resource_arn: ::std::option::Option<::std::string::String>, ///

The policy rule number associated with the attachment.

@@ -64,10 +66,16 @@ impl Attachment { pub fn state(&self) -> ::std::option::Option<&crate::types::AttachmentState> { self.state.as_ref() } - ///

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.

pub fn edge_location(&self) -> ::std::option::Option<&str> { self.edge_location.as_deref() } + ///

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.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.edge_locations.is_none()`. + pub fn edge_locations(&self) -> &[::std::string::String] { + self.edge_locations.as_deref().unwrap_or_default() + } ///

The attachment resource ARN.

pub fn resource_arn(&self) -> ::std::option::Option<&str> { self.resource_arn.as_deref() @@ -131,6 +139,7 @@ pub struct AttachmentBuilder { pub(crate) attachment_type: ::std::option::Option, pub(crate) state: ::std::option::Option, pub(crate) edge_location: ::std::option::Option<::std::string::String>, + pub(crate) edge_locations: ::std::option::Option<::std::vec::Vec<::std::string::String>>, pub(crate) resource_arn: ::std::option::Option<::std::string::String>, pub(crate) attachment_policy_rule_number: ::std::option::Option, pub(crate) segment_name: ::std::option::Option<::std::string::String>, @@ -227,20 +236,40 @@ impl AttachmentBuilder { pub fn get_state(&self) -> &::std::option::Option { &self.state } - ///

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.

pub fn edge_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.edge_location = ::std::option::Option::Some(input.into()); self } - ///

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.

pub fn set_edge_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.edge_location = input; self } - ///

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.

pub fn get_edge_location(&self) -> &::std::option::Option<::std::string::String> { &self.edge_location } + /// Appends an item to `edge_locations`. + /// + /// To override the contents of this collection use [`set_edge_locations`](Self::set_edge_locations). + /// + ///

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.

+ pub fn edge_locations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.edge_locations.unwrap_or_default(); + v.push(input.into()); + self.edge_locations = ::std::option::Option::Some(v); + self + } + ///

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.

+ pub fn set_edge_locations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.edge_locations = input; + self + } + ///

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.

+ pub fn get_edge_locations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.edge_locations + } ///

The attachment resource ARN.

pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.resource_arn = ::std::option::Option::Some(input.into()); @@ -406,6 +435,7 @@ impl AttachmentBuilder { attachment_type: self.attachment_type, state: self.state, edge_location: self.edge_location, + edge_locations: self.edge_locations, resource_arn: self.resource_arn, attachment_policy_rule_number: self.attachment_policy_rule_number, segment_name: self.segment_name, diff --git a/sdk/networkmanager/src/types/_attachment_error_code.rs b/sdk/networkmanager/src/types/_attachment_error_code.rs index 9d35e5f9c098..be607930f9d5 100644 --- a/sdk/networkmanager/src/types/_attachment_error_code.rs +++ b/sdk/networkmanager/src/types/_attachment_error_code.rs @@ -12,6 +12,9 @@ /// ```text /// # let attachmenterrorcode = unimplemented!(); /// match attachmenterrorcode { +/// AttachmentErrorCode::DirectConnectGatewayExistingAttachments => { /* ... */ }, +/// AttachmentErrorCode::DirectConnectGatewayNotFound => { /* ... */ }, +/// AttachmentErrorCode::DirectConnectGatewayNoPrivateVif => { /* ... */ }, /// AttachmentErrorCode::MaximumNoEncapLimitExceeded => { /* ... */ }, /// AttachmentErrorCode::SubnetDuplicatedInAvailabilityZone => { /* ... */ }, /// AttachmentErrorCode::SubnetNotFound => { /* ... */ }, @@ -47,6 +50,12 @@ ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, )] pub enum AttachmentErrorCode { + #[allow(missing_docs)] // documentation missing in model + DirectConnectGatewayExistingAttachments, + #[allow(missing_docs)] // documentation missing in model + DirectConnectGatewayNotFound, + #[allow(missing_docs)] // documentation missing in model + DirectConnectGatewayNoPrivateVif, #[allow(missing_docs)] // documentation missing in model MaximumNoEncapLimitExceeded, #[allow(missing_docs)] // documentation missing in model @@ -70,6 +79,9 @@ pub enum AttachmentErrorCode { impl ::std::convert::From<&str> for AttachmentErrorCode { fn from(s: &str) -> Self { match s { + "DIRECT_CONNECT_GATEWAY_EXISTING_ATTACHMENTS" => AttachmentErrorCode::DirectConnectGatewayExistingAttachments, + "DIRECT_CONNECT_GATEWAY_NOT_FOUND" => AttachmentErrorCode::DirectConnectGatewayNotFound, + "DIRECT_CONNECT_GATEWAY_NO_PRIVATE_VIF" => AttachmentErrorCode::DirectConnectGatewayNoPrivateVif, "MAXIMUM_NO_ENCAP_LIMIT_EXCEEDED" => AttachmentErrorCode::MaximumNoEncapLimitExceeded, "SUBNET_DUPLICATED_IN_AVAILABILITY_ZONE" => AttachmentErrorCode::SubnetDuplicatedInAvailabilityZone, "SUBNET_NOT_FOUND" => AttachmentErrorCode::SubnetNotFound, @@ -93,6 +105,9 @@ impl AttachmentErrorCode { /// Returns the `&str` value of the enum member. pub fn as_str(&self) -> &str { match self { + AttachmentErrorCode::DirectConnectGatewayExistingAttachments => "DIRECT_CONNECT_GATEWAY_EXISTING_ATTACHMENTS", + AttachmentErrorCode::DirectConnectGatewayNotFound => "DIRECT_CONNECT_GATEWAY_NOT_FOUND", + AttachmentErrorCode::DirectConnectGatewayNoPrivateVif => "DIRECT_CONNECT_GATEWAY_NO_PRIVATE_VIF", AttachmentErrorCode::MaximumNoEncapLimitExceeded => "MAXIMUM_NO_ENCAP_LIMIT_EXCEEDED", AttachmentErrorCode::SubnetDuplicatedInAvailabilityZone => "SUBNET_DUPLICATED_IN_AVAILABILITY_ZONE", AttachmentErrorCode::SubnetNotFound => "SUBNET_NOT_FOUND", @@ -107,6 +122,9 @@ impl AttachmentErrorCode { /// Returns all the `&str` representations of the enum members. pub const fn values() -> &'static [&'static str] { &[ + "DIRECT_CONNECT_GATEWAY_EXISTING_ATTACHMENTS", + "DIRECT_CONNECT_GATEWAY_NOT_FOUND", + "DIRECT_CONNECT_GATEWAY_NO_PRIVATE_VIF", "MAXIMUM_NO_ENCAP_LIMIT_EXCEEDED", "SUBNET_DUPLICATED_IN_AVAILABILITY_ZONE", "SUBNET_NOT_FOUND", @@ -138,6 +156,9 @@ impl AttachmentErrorCode { impl ::std::fmt::Display for AttachmentErrorCode { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { match self { + AttachmentErrorCode::DirectConnectGatewayExistingAttachments => write!(f, "DIRECT_CONNECT_GATEWAY_EXISTING_ATTACHMENTS"), + AttachmentErrorCode::DirectConnectGatewayNotFound => write!(f, "DIRECT_CONNECT_GATEWAY_NOT_FOUND"), + AttachmentErrorCode::DirectConnectGatewayNoPrivateVif => write!(f, "DIRECT_CONNECT_GATEWAY_NO_PRIVATE_VIF"), AttachmentErrorCode::MaximumNoEncapLimitExceeded => write!(f, "MAXIMUM_NO_ENCAP_LIMIT_EXCEEDED"), AttachmentErrorCode::SubnetDuplicatedInAvailabilityZone => write!(f, "SUBNET_DUPLICATED_IN_AVAILABILITY_ZONE"), AttachmentErrorCode::SubnetNotFound => write!(f, "SUBNET_NOT_FOUND"), diff --git a/sdk/networkmanager/src/types/_attachment_type.rs b/sdk/networkmanager/src/types/_attachment_type.rs index 04b7865db7e4..bde6b8b8acc7 100644 --- a/sdk/networkmanager/src/types/_attachment_type.rs +++ b/sdk/networkmanager/src/types/_attachment_type.rs @@ -13,6 +13,7 @@ /// # let attachmenttype = unimplemented!(); /// match attachmenttype { /// AttachmentType::Connect => { /* ... */ }, +/// AttachmentType::DirectConnectGateway => { /* ... */ }, /// AttachmentType::SiteToSiteVpn => { /* ... */ }, /// AttachmentType::TransitGatewayRouteTable => { /* ... */ }, /// AttachmentType::Vpc => { /* ... */ }, @@ -46,6 +47,8 @@ pub enum AttachmentType { #[allow(missing_docs)] // documentation missing in model Connect, #[allow(missing_docs)] // documentation missing in model + DirectConnectGateway, + #[allow(missing_docs)] // documentation missing in model SiteToSiteVpn, #[allow(missing_docs)] // documentation missing in model TransitGatewayRouteTable, @@ -59,6 +62,7 @@ impl ::std::convert::From<&str> for AttachmentType { fn from(s: &str) -> Self { match s { "CONNECT" => AttachmentType::Connect, + "DIRECT_CONNECT_GATEWAY" => AttachmentType::DirectConnectGateway, "SITE_TO_SITE_VPN" => AttachmentType::SiteToSiteVpn, "TRANSIT_GATEWAY_ROUTE_TABLE" => AttachmentType::TransitGatewayRouteTable, "VPC" => AttachmentType::Vpc, @@ -78,6 +82,7 @@ impl AttachmentType { pub fn as_str(&self) -> &str { match self { AttachmentType::Connect => "CONNECT", + AttachmentType::DirectConnectGateway => "DIRECT_CONNECT_GATEWAY", AttachmentType::SiteToSiteVpn => "SITE_TO_SITE_VPN", AttachmentType::TransitGatewayRouteTable => "TRANSIT_GATEWAY_ROUTE_TABLE", AttachmentType::Vpc => "VPC", @@ -86,7 +91,13 @@ impl AttachmentType { } /// Returns all the `&str` representations of the enum members. pub const fn values() -> &'static [&'static str] { - &["CONNECT", "SITE_TO_SITE_VPN", "TRANSIT_GATEWAY_ROUTE_TABLE", "VPC"] + &[ + "CONNECT", + "DIRECT_CONNECT_GATEWAY", + "SITE_TO_SITE_VPN", + "TRANSIT_GATEWAY_ROUTE_TABLE", + "VPC", + ] } } impl ::std::convert::AsRef for AttachmentType { @@ -110,6 +121,7 @@ impl ::std::fmt::Display for AttachmentType { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { match self { AttachmentType::Connect => write!(f, "CONNECT"), + AttachmentType::DirectConnectGateway => write!(f, "DIRECT_CONNECT_GATEWAY"), AttachmentType::SiteToSiteVpn => write!(f, "SITE_TO_SITE_VPN"), AttachmentType::TransitGatewayRouteTable => write!(f, "TRANSIT_GATEWAY_ROUTE_TABLE"), AttachmentType::Vpc => write!(f, "VPC"), diff --git a/sdk/networkmanager/src/types/_direct_connect_gateway_attachment.rs b/sdk/networkmanager/src/types/_direct_connect_gateway_attachment.rs new file mode 100644 index 000000000000..30122c226e3e --- /dev/null +++ b/sdk/networkmanager/src/types/_direct_connect_gateway_attachment.rs @@ -0,0 +1,72 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

Describes a Direct Connect gateway attachment.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DirectConnectGatewayAttachment { + ///

Describes a core network attachment.

+ pub attachment: ::std::option::Option, + ///

The Direct Connect gateway attachment ARN.

+ pub direct_connect_gateway_arn: ::std::option::Option<::std::string::String>, +} +impl DirectConnectGatewayAttachment { + ///

Describes a core network attachment.

+ pub fn attachment(&self) -> ::std::option::Option<&crate::types::Attachment> { + self.attachment.as_ref() + } + ///

The Direct Connect gateway attachment ARN.

+ pub fn direct_connect_gateway_arn(&self) -> ::std::option::Option<&str> { + self.direct_connect_gateway_arn.as_deref() + } +} +impl DirectConnectGatewayAttachment { + /// Creates a new builder-style object to manufacture [`DirectConnectGatewayAttachment`](crate::types::DirectConnectGatewayAttachment). + pub fn builder() -> crate::types::builders::DirectConnectGatewayAttachmentBuilder { + crate::types::builders::DirectConnectGatewayAttachmentBuilder::default() + } +} + +/// A builder for [`DirectConnectGatewayAttachment`](crate::types::DirectConnectGatewayAttachment). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DirectConnectGatewayAttachmentBuilder { + pub(crate) attachment: ::std::option::Option, + pub(crate) direct_connect_gateway_arn: ::std::option::Option<::std::string::String>, +} +impl DirectConnectGatewayAttachmentBuilder { + ///

Describes a core network attachment.

+ pub fn attachment(mut self, input: crate::types::Attachment) -> Self { + self.attachment = ::std::option::Option::Some(input); + self + } + ///

Describes a core network attachment.

+ pub fn set_attachment(mut self, input: ::std::option::Option) -> Self { + self.attachment = input; + self + } + ///

Describes a core network attachment.

+ pub fn get_attachment(&self) -> &::std::option::Option { + &self.attachment + } + ///

The Direct Connect gateway attachment ARN.

+ pub fn direct_connect_gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.direct_connect_gateway_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The Direct Connect gateway attachment ARN.

+ pub fn set_direct_connect_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.direct_connect_gateway_arn = input; + self + } + ///

The Direct Connect gateway attachment ARN.

+ pub fn get_direct_connect_gateway_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.direct_connect_gateway_arn + } + /// Consumes the builder and constructs a [`DirectConnectGatewayAttachment`](crate::types::DirectConnectGatewayAttachment). + pub fn build(self) -> crate::types::DirectConnectGatewayAttachment { + crate::types::DirectConnectGatewayAttachment { + attachment: self.attachment, + direct_connect_gateway_arn: self.direct_connect_gateway_arn, + } + } +} diff --git a/sdk/networkmanager/src/types/builders.rs b/sdk/networkmanager/src/types/builders.rs index a6e78d24f358..33a9274d48d5 100644 --- a/sdk/networkmanager/src/types/builders.rs +++ b/sdk/networkmanager/src/types/builders.rs @@ -25,6 +25,8 @@ pub use crate::types::_bandwidth::BandwidthBuilder; pub use crate::types::_global_network::GlobalNetworkBuilder; +pub use crate::types::_direct_connect_gateway_attachment::DirectConnectGatewayAttachmentBuilder; + pub use crate::types::_device::DeviceBuilder; pub use crate::types::_aws_location::AwsLocationBuilder; diff --git a/sdk/s3/Cargo.toml b/sdk/s3/Cargo.toml index 3a0e9316174a..6f3c6d049d0f 100644 --- a/sdk/s3/Cargo.toml +++ b/sdk/s3/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-s3" -version = "1.62.0" +version = "1.63.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for Amazon Simple Storage Service" edition = "2021" diff --git a/sdk/s3/README.md b/sdk/s3/README.md index b8af0bfefa55..68c8f9259c09 100644 --- a/sdk/s3/README.md +++ b/sdk/s3/README.md @@ -12,7 +12,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-s3 = "1.62.0" +aws-sdk-s3 = "1.63.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/s3/src/client/complete_multipart_upload.rs b/sdk/s3/src/client/complete_multipart_upload.rs index bdd9e740459d..78f46c037a25 100644 --- a/sdk/s3/src/client/complete_multipart_upload.rs +++ b/sdk/s3/src/client/complete_multipart_upload.rs @@ -13,6 +13,7 @@ impl super::Client { /// - [`checksum_sha256(impl Into)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::checksum_sha256) / [`set_checksum_sha256(Option)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::set_checksum_sha256):
required: **false**

This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.


/// - [`request_payer(RequestPayer)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::request_payer) / [`set_request_payer(Option)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::set_request_payer):
required: **false**

Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

This functionality is not supported for directory buckets.


/// - [`expected_bucket_owner(impl Into)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::set_expected_bucket_owner):
required: **false**

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).


+ /// - [`if_match(impl Into)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::if_match) / [`set_if_match(Option)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::set_if_match):
required: **false**

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.


/// - [`if_none_match(impl Into)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::if_none_match) / [`set_if_none_match(Option)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::set_if_none_match):
required: **false**

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.

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should re-initiate the multipart upload with CreateMultipartUpload and re-upload each part.

Expects the '*' (asterisk) character.

For more information about conditional requests, see RFC 7232, or Conditional requests in the Amazon S3 User Guide.


/// - [`sse_customer_algorithm(impl Into)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::sse_customer_algorithm) / [`set_sse_customer_algorithm(Option)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::set_sse_customer_algorithm):
required: **false**

The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is required only when the object was created using a checksum algorithm or if your bucket policy requires the use of SSE-C. For more information, see Protecting data using SSE-C keys in the Amazon S3 User Guide.

This functionality is not supported for directory buckets.


/// - [`sse_customer_key(impl Into)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::sse_customer_key) / [`set_sse_customer_key(Option)`](crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder::set_sse_customer_key):
required: **false**

The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the Amazon S3 User Guide.

This functionality is not supported for directory buckets.


diff --git a/sdk/s3/src/client/put_object.rs b/sdk/s3/src/client/put_object.rs index 77aefd9f6c7e..d3cb5180d8f8 100644 --- a/sdk/s3/src/client/put_object.rs +++ b/sdk/s3/src/client/put_object.rs @@ -19,6 +19,7 @@ impl super::Client { /// - [`checksum_sha1(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::checksum_sha1) / [`set_checksum_sha1(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_checksum_sha1):
required: **false**

This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.


/// - [`checksum_sha256(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::checksum_sha256) / [`set_checksum_sha256(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_checksum_sha256):
required: **false**

This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.


/// - [`expires(DateTime)`](crate::operation::put_object::builders::PutObjectFluentBuilder::expires) / [`set_expires(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_expires):
required: **false**

The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3.


+ /// - [`if_match(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::if_match) / [`set_if_match(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_if_match):
required: **false**

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.


/// - [`if_none_match(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::if_none_match) / [`set_if_none_match(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_if_none_match):
required: **false**

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.

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should retry the upload.

Expects the '*' (asterisk) character.

For more information about conditional requests, see RFC 7232, or Conditional requests in the Amazon S3 User Guide.


/// - [`grant_full_control(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::grant_full_control) / [`set_grant_full_control(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_grant_full_control):
required: **false**

Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.

  • This functionality is not supported for directory buckets.

  • This functionality is not supported for Amazon S3 on Outposts.


/// - [`grant_read(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::grant_read) / [`set_grant_read(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_grant_read):
required: **false**

Allows grantee to read the object data and its metadata.

  • This functionality is not supported for directory buckets.

  • This functionality is not supported for Amazon S3 on Outposts.


diff --git a/sdk/s3/src/lib.rs b/sdk/s3/src/lib.rs index 429d0cb66c81..efc5982b57f7 100644 --- a/sdk/s3/src/lib.rs +++ b/sdk/s3/src/lib.rs @@ -29,7 +29,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-s3 = "1.62.0" +//! aws-sdk-s3 = "1.63.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/s3/src/operation/complete_multipart_upload/_complete_multipart_upload_input.rs b/sdk/s3/src/operation/complete_multipart_upload/_complete_multipart_upload_input.rs index 056c12c29497..920e885d245c 100644 --- a/sdk/s3/src/operation/complete_multipart_upload/_complete_multipart_upload_input.rs +++ b/sdk/s3/src/operation/complete_multipart_upload/_complete_multipart_upload_input.rs @@ -30,6 +30,11 @@ pub struct CompleteMultipartUploadInput { pub request_payer: ::std::option::Option, ///

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

pub expected_bucket_owner: ::std::option::Option<::std::string::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.

+ pub if_match: ::std::option::Option<::std::string::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.

///

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should re-initiate the multipart upload with CreateMultipartUpload and re-upload each part.

///

Expects the '*' (asterisk) character.

@@ -96,6 +101,13 @@ impl CompleteMultipartUploadInput { pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> { self.expected_bucket_owner.as_deref() } + ///

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.

+ pub fn if_match(&self) -> ::std::option::Option<&str> { + self.if_match.as_deref() + } ///

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.

///

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should re-initiate the multipart upload with CreateMultipartUpload and re-upload each part.

///

Expects the '*' (asterisk) character.

@@ -135,6 +147,7 @@ impl ::std::fmt::Debug for CompleteMultipartUploadInput { formatter.field("checksum_sha256", &self.checksum_sha256); formatter.field("request_payer", &self.request_payer); formatter.field("expected_bucket_owner", &self.expected_bucket_owner); + formatter.field("if_match", &self.if_match); formatter.field("if_none_match", &self.if_none_match); formatter.field("sse_customer_algorithm", &self.sse_customer_algorithm); formatter.field("sse_customer_key", &"*** Sensitive Data Redacted ***"); @@ -163,6 +176,7 @@ pub struct CompleteMultipartUploadInputBuilder { pub(crate) checksum_sha256: ::std::option::Option<::std::string::String>, pub(crate) request_payer: ::std::option::Option, pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>, + pub(crate) if_match: ::std::option::Option<::std::string::String>, pub(crate) if_none_match: ::std::option::Option<::std::string::String>, pub(crate) sse_customer_algorithm: ::std::option::Option<::std::string::String>, pub(crate) sse_customer_key: ::std::option::Option<::std::string::String>, @@ -333,6 +347,29 @@ impl CompleteMultipartUploadInputBuilder { pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> { &self.expected_bucket_owner } + ///

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.

+ pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.if_match = ::std::option::Option::Some(input.into()); + self + } + ///

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.

+ pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.if_match = input; + self + } + ///

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.

+ pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> { + &self.if_match + } ///

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.

///

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should re-initiate the multipart upload with CreateMultipartUpload and re-upload each part.

///

Expects the '*' (asterisk) character.

@@ -434,6 +471,7 @@ impl CompleteMultipartUploadInputBuilder { checksum_sha256: self.checksum_sha256, request_payer: self.request_payer, expected_bucket_owner: self.expected_bucket_owner, + if_match: self.if_match, if_none_match: self.if_none_match, sse_customer_algorithm: self.sse_customer_algorithm, sse_customer_key: self.sse_customer_key, @@ -454,6 +492,7 @@ impl ::std::fmt::Debug for CompleteMultipartUploadInputBuilder { formatter.field("checksum_sha256", &self.checksum_sha256); formatter.field("request_payer", &self.request_payer); formatter.field("expected_bucket_owner", &self.expected_bucket_owner); + formatter.field("if_match", &self.if_match); formatter.field("if_none_match", &self.if_none_match); formatter.field("sse_customer_algorithm", &self.sse_customer_algorithm); formatter.field("sse_customer_key", &"*** Sensitive Data Redacted ***"); diff --git a/sdk/s3/src/operation/complete_multipart_upload/builders.rs b/sdk/s3/src/operation/complete_multipart_upload/builders.rs index 190127bea399..4408dde2590c 100644 --- a/sdk/s3/src/operation/complete_multipart_upload/builders.rs +++ b/sdk/s3/src/operation/complete_multipart_upload/builders.rs @@ -350,6 +350,29 @@ impl CompleteMultipartUploadFluentBuilder { pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_expected_bucket_owner() } + ///

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.

+ pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.if_match(input.into()); + self + } + ///

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.

+ pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_if_match(input); + self + } + ///

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.

+ pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_if_match() + } ///

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.

///

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should re-initiate the multipart upload with CreateMultipartUpload and re-upload each part.

///

Expects the '*' (asterisk) character.

diff --git a/sdk/s3/src/operation/put_bucket_versioning/builders.rs b/sdk/s3/src/operation/put_bucket_versioning/builders.rs index 5348abe86ee5..992987b4589d 100644 --- a/sdk/s3/src/operation/put_bucket_versioning/builders.rs +++ b/sdk/s3/src/operation/put_bucket_versioning/builders.rs @@ -25,7 +25,7 @@ impl crate::operation::put_bucket_versioning::builders::PutBucketVersioningInput /// ///

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 operations (PUT or DELETE) on objects in the bucket.

+///

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. 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.

///

You can set the versioning state with one of the following values:

diff --git a/sdk/s3/src/operation/put_object/_put_object_input.rs b/sdk/s3/src/operation/put_object/_put_object_input.rs index 5d29b4151859..d8df1ad02324 100644 --- a/sdk/s3/src/operation/put_object/_put_object_input.rs +++ b/sdk/s3/src/operation/put_object/_put_object_input.rs @@ -68,6 +68,11 @@ pub struct PutObjectInput { pub checksum_sha256: ::std::option::Option<::std::string::String>, ///

The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3.

pub expires: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

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.

+ pub if_match: ::std::option::Option<::std::string::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.

///

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should retry the upload.

///

Expects the '*' (asterisk) character.

@@ -292,6 +297,13 @@ impl PutObjectInput { pub fn expires(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { self.expires.as_ref() } + ///

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.

+ pub fn if_match(&self) -> ::std::option::Option<&str> { + self.if_match.as_deref() + } ///

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.

///

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should retry the upload.

///

Expects the '*' (asterisk) character.

@@ -482,6 +494,7 @@ impl ::std::fmt::Debug for PutObjectInput { formatter.field("checksum_sha1", &self.checksum_sha1); formatter.field("checksum_sha256", &self.checksum_sha256); formatter.field("expires", &self.expires); + formatter.field("if_match", &self.if_match); formatter.field("if_none_match", &self.if_none_match); formatter.field("grant_full_control", &self.grant_full_control); formatter.field("grant_read", &self.grant_read); @@ -535,6 +548,7 @@ pub struct PutObjectInputBuilder { pub(crate) checksum_sha1: ::std::option::Option<::std::string::String>, pub(crate) checksum_sha256: ::std::option::Option<::std::string::String>, pub(crate) expires: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) if_match: ::std::option::Option<::std::string::String>, pub(crate) if_none_match: ::std::option::Option<::std::string::String>, pub(crate) grant_full_control: ::std::option::Option<::std::string::String>, pub(crate) grant_read: ::std::option::Option<::std::string::String>, @@ -887,6 +901,29 @@ impl PutObjectInputBuilder { pub fn get_expires(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { &self.expires } + ///

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.

+ pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.if_match = ::std::option::Option::Some(input.into()); + self + } + ///

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.

+ pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.if_match = input; + self + } + ///

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.

+ pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> { + &self.if_match + } ///

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.

///

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should retry the upload.

///

Expects the '*' (asterisk) character.

@@ -1469,6 +1506,7 @@ impl PutObjectInputBuilder { checksum_sha1: self.checksum_sha1, checksum_sha256: self.checksum_sha256, expires: self.expires, + if_match: self.if_match, if_none_match: self.if_none_match, grant_full_control: self.grant_full_control, grant_read: self.grant_read, @@ -1514,6 +1552,7 @@ impl ::std::fmt::Debug for PutObjectInputBuilder { formatter.field("checksum_sha1", &self.checksum_sha1); formatter.field("checksum_sha256", &self.checksum_sha256); formatter.field("expires", &self.expires); + formatter.field("if_match", &self.if_match); formatter.field("if_none_match", &self.if_none_match); formatter.field("grant_full_control", &self.grant_full_control); formatter.field("grant_read", &self.grant_read); diff --git a/sdk/s3/src/operation/put_object/builders.rs b/sdk/s3/src/operation/put_object/builders.rs index 68405bb2d2a7..e0852c6743a0 100644 --- a/sdk/s3/src/operation/put_object/builders.rs +++ b/sdk/s3/src/operation/put_object/builders.rs @@ -546,6 +546,29 @@ impl PutObjectFluentBuilder { pub fn get_expires(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { self.inner.get_expires() } + ///

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.

+ pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.if_match(input.into()); + self + } + ///

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.

+ pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_if_match(input); + self + } + ///

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.

+ pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_if_match() + } ///

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.

///

If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should retry the upload.

///

Expects the '*' (asterisk) character.

diff --git a/sdk/s3/src/protocol_serde/shape_complete_multipart_upload.rs b/sdk/s3/src/protocol_serde/shape_complete_multipart_upload.rs index c8745e0c9cdb..c3c8fce1e1f2 100644 --- a/sdk/s3/src/protocol_serde/shape_complete_multipart_upload.rs +++ b/sdk/s3/src/protocol_serde/shape_complete_multipart_upload.rs @@ -151,31 +151,42 @@ pub fn ser_complete_multipart_upload_headers( })?; builder = builder.header("x-amz-expected-bucket-owner", header_value); } - if let ::std::option::Option::Some(inner_13) = &input.if_none_match { + if let ::std::option::Option::Some(inner_13) = &input.if_match { let formatted_14 = inner_13.as_str(); let header_value = formatted_14; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( - "if_none_match", + "if_match", format!("`{}` cannot be used as a header value: {}", &header_value, err), ) })?; - builder = builder.header("If-None-Match", header_value); + builder = builder.header("If-Match", header_value); } - if let ::std::option::Option::Some(inner_15) = &input.sse_customer_algorithm { + if let ::std::option::Option::Some(inner_15) = &input.if_none_match { let formatted_16 = inner_15.as_str(); let header_value = formatted_16; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( - "sse_customer_algorithm", + "if_none_match", format!("`{}` cannot be used as a header value: {}", &header_value, err), ) })?; - builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value); + builder = builder.header("If-None-Match", header_value); } - if let ::std::option::Option::Some(inner_17) = &input.sse_customer_key { + if let ::std::option::Option::Some(inner_17) = &input.sse_customer_algorithm { let formatted_18 = inner_17.as_str(); let header_value = formatted_18; + let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + ::aws_smithy_types::error::operation::BuildError::invalid_field( + "sse_customer_algorithm", + format!("`{}` cannot be used as a header value: {}", &header_value, err), + ) + })?; + builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value); + } + if let ::std::option::Option::Some(inner_19) = &input.sse_customer_key { + let formatted_20 = inner_19.as_str(); + let header_value = formatted_20; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "sse_customer_key", @@ -184,9 +195,9 @@ pub fn ser_complete_multipart_upload_headers( })?; builder = builder.header("x-amz-server-side-encryption-customer-key", header_value); } - if let ::std::option::Option::Some(inner_19) = &input.sse_customer_key_md5 { - let formatted_20 = inner_19.as_str(); - let header_value = formatted_20; + if let ::std::option::Option::Some(inner_21) = &input.sse_customer_key_md5 { + let formatted_22 = inner_21.as_str(); + let header_value = formatted_22; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "sse_customer_key_md5", @@ -218,7 +229,7 @@ pub fn de_complete_multipart_upload( while let Some(mut tag) = decoder.next_tag() { match tag.start_el() { s if s.matches("ChecksumSHA1") /* ChecksumSHA1 com.amazonaws.s3.synthetic#CompleteMultipartUploadOutput$ChecksumSHA1 */ => { - let var_21 = + let var_23 = Some( Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() @@ -227,11 +238,11 @@ pub fn de_complete_multipart_upload( ? ) ; - builder = builder.set_checksum_sha1(var_21); + builder = builder.set_checksum_sha1(var_23); } , s if s.matches("ChecksumSHA256") /* ChecksumSHA256 com.amazonaws.s3.synthetic#CompleteMultipartUploadOutput$ChecksumSHA256 */ => { - let var_22 = + let var_24 = Some( Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() @@ -240,11 +251,11 @@ pub fn de_complete_multipart_upload( ? ) ; - builder = builder.set_checksum_sha256(var_22); + builder = builder.set_checksum_sha256(var_24); } , s if s.matches("Bucket") /* Bucket com.amazonaws.s3.synthetic#CompleteMultipartUploadOutput$Bucket */ => { - let var_23 = + let var_25 = Some( Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() @@ -253,11 +264,11 @@ pub fn de_complete_multipart_upload( ? ) ; - builder = builder.set_bucket(var_23); + builder = builder.set_bucket(var_25); } , s if s.matches("ETag") /* ETag com.amazonaws.s3.synthetic#CompleteMultipartUploadOutput$ETag */ => { - let var_24 = + let var_26 = Some( Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() @@ -266,11 +277,11 @@ pub fn de_complete_multipart_upload( ? ) ; - builder = builder.set_e_tag(var_24); + builder = builder.set_e_tag(var_26); } , s if s.matches("ChecksumCRC32C") /* ChecksumCRC32C com.amazonaws.s3.synthetic#CompleteMultipartUploadOutput$ChecksumCRC32C */ => { - let var_25 = + let var_27 = Some( Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() @@ -279,11 +290,11 @@ pub fn de_complete_multipart_upload( ? ) ; - builder = builder.set_checksum_crc32_c(var_25); + builder = builder.set_checksum_crc32_c(var_27); } , s if s.matches("ChecksumCRC32") /* ChecksumCRC32 com.amazonaws.s3.synthetic#CompleteMultipartUploadOutput$ChecksumCRC32 */ => { - let var_26 = + let var_28 = Some( Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() @@ -292,11 +303,11 @@ pub fn de_complete_multipart_upload( ? ) ; - builder = builder.set_checksum_crc32(var_26); + builder = builder.set_checksum_crc32(var_28); } , s if s.matches("Key") /* Key com.amazonaws.s3.synthetic#CompleteMultipartUploadOutput$Key */ => { - let var_27 = + let var_29 = Some( Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() @@ -305,11 +316,11 @@ pub fn de_complete_multipart_upload( ? ) ; - builder = builder.set_key(var_27); + builder = builder.set_key(var_29); } , s if s.matches("Location") /* Location com.amazonaws.s3.synthetic#CompleteMultipartUploadOutput$Location */ => { - let var_28 = + let var_30 = Some( Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() @@ -318,7 +329,7 @@ pub fn de_complete_multipart_upload( ? ) ; - builder = builder.set_location(var_28); + builder = builder.set_location(var_30); } , _ => {} diff --git a/sdk/s3/src/protocol_serde/shape_put_object.rs b/sdk/s3/src/protocol_serde/shape_put_object.rs index 59c1c65c7204..4d9a3618747a 100644 --- a/sdk/s3/src/protocol_serde/shape_put_object.rs +++ b/sdk/s3/src/protocol_serde/shape_put_object.rs @@ -339,53 +339,64 @@ pub fn ser_put_object_headers( })?; builder = builder.header("Expires", header_value); } - if let ::std::option::Option::Some(inner_29) = &input.if_none_match { + if let ::std::option::Option::Some(inner_29) = &input.if_match { let formatted_30 = inner_29.as_str(); let header_value = formatted_30; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( - "if_none_match", + "if_match", format!("`{}` cannot be used as a header value: {}", &header_value, err), ) })?; - builder = builder.header("If-None-Match", header_value); + builder = builder.header("If-Match", header_value); } - if let ::std::option::Option::Some(inner_31) = &input.grant_full_control { + if let ::std::option::Option::Some(inner_31) = &input.if_none_match { let formatted_32 = inner_31.as_str(); let header_value = formatted_32; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( - "grant_full_control", + "if_none_match", format!("`{}` cannot be used as a header value: {}", &header_value, err), ) })?; - builder = builder.header("x-amz-grant-full-control", header_value); + builder = builder.header("If-None-Match", header_value); } - if let ::std::option::Option::Some(inner_33) = &input.grant_read { + if let ::std::option::Option::Some(inner_33) = &input.grant_full_control { let formatted_34 = inner_33.as_str(); let header_value = formatted_34; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( - "grant_read", + "grant_full_control", format!("`{}` cannot be used as a header value: {}", &header_value, err), ) })?; - builder = builder.header("x-amz-grant-read", header_value); + builder = builder.header("x-amz-grant-full-control", header_value); } - if let ::std::option::Option::Some(inner_35) = &input.grant_read_acp { + if let ::std::option::Option::Some(inner_35) = &input.grant_read { let formatted_36 = inner_35.as_str(); let header_value = formatted_36; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( - "grant_read_acp", + "grant_read", format!("`{}` cannot be used as a header value: {}", &header_value, err), ) })?; - builder = builder.header("x-amz-grant-read-acp", header_value); + builder = builder.header("x-amz-grant-read", header_value); } - if let ::std::option::Option::Some(inner_37) = &input.grant_write_acp { + if let ::std::option::Option::Some(inner_37) = &input.grant_read_acp { let formatted_38 = inner_37.as_str(); let header_value = formatted_38; + let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + ::aws_smithy_types::error::operation::BuildError::invalid_field( + "grant_read_acp", + format!("`{}` cannot be used as a header value: {}", &header_value, err), + ) + })?; + builder = builder.header("x-amz-grant-read-acp", header_value); + } + if let ::std::option::Option::Some(inner_39) = &input.grant_write_acp { + let formatted_40 = inner_39.as_str(); + let header_value = formatted_40; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "grant_write_acp", @@ -394,10 +405,10 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-grant-write-acp", header_value); } - if let ::std::option::Option::Some(inner_39) = &input.write_offset_bytes { - let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_39); - let formatted_40 = encoder.encode(); - let header_value = formatted_40; + if let ::std::option::Option::Some(inner_41) = &input.write_offset_bytes { + let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_41); + let formatted_42 = encoder.encode(); + let header_value = formatted_42; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "write_offset_bytes", @@ -406,9 +417,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-write-offset-bytes", header_value); } - if let ::std::option::Option::Some(inner_41) = &input.server_side_encryption { - let formatted_42 = inner_41.as_str(); - let header_value = formatted_42; + if let ::std::option::Option::Some(inner_43) = &input.server_side_encryption { + let formatted_44 = inner_43.as_str(); + let header_value = formatted_44; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "server_side_encryption", @@ -417,9 +428,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-server-side-encryption", header_value); } - if let ::std::option::Option::Some(inner_43) = &input.storage_class { - let formatted_44 = inner_43.as_str(); - let header_value = formatted_44; + if let ::std::option::Option::Some(inner_45) = &input.storage_class { + let formatted_46 = inner_45.as_str(); + let header_value = formatted_46; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "storage_class", @@ -428,9 +439,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-storage-class", header_value); } - if let ::std::option::Option::Some(inner_45) = &input.website_redirect_location { - let formatted_46 = inner_45.as_str(); - let header_value = formatted_46; + if let ::std::option::Option::Some(inner_47) = &input.website_redirect_location { + let formatted_48 = inner_47.as_str(); + let header_value = formatted_48; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "website_redirect_location", @@ -439,9 +450,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-website-redirect-location", header_value); } - if let ::std::option::Option::Some(inner_47) = &input.sse_customer_algorithm { - let formatted_48 = inner_47.as_str(); - let header_value = formatted_48; + if let ::std::option::Option::Some(inner_49) = &input.sse_customer_algorithm { + let formatted_50 = inner_49.as_str(); + let header_value = formatted_50; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "sse_customer_algorithm", @@ -450,9 +461,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value); } - if let ::std::option::Option::Some(inner_49) = &input.sse_customer_key { - let formatted_50 = inner_49.as_str(); - let header_value = formatted_50; + if let ::std::option::Option::Some(inner_51) = &input.sse_customer_key { + let formatted_52 = inner_51.as_str(); + let header_value = formatted_52; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "sse_customer_key", @@ -461,9 +472,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-server-side-encryption-customer-key", header_value); } - if let ::std::option::Option::Some(inner_51) = &input.sse_customer_key_md5 { - let formatted_52 = inner_51.as_str(); - let header_value = formatted_52; + if let ::std::option::Option::Some(inner_53) = &input.sse_customer_key_md5 { + let formatted_54 = inner_53.as_str(); + let header_value = formatted_54; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "sse_customer_key_md5", @@ -472,9 +483,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value); } - if let ::std::option::Option::Some(inner_53) = &input.ssekms_key_id { - let formatted_54 = inner_53.as_str(); - let header_value = formatted_54; + if let ::std::option::Option::Some(inner_55) = &input.ssekms_key_id { + let formatted_56 = inner_55.as_str(); + let header_value = formatted_56; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "ssekms_key_id", @@ -483,9 +494,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-server-side-encryption-aws-kms-key-id", header_value); } - if let ::std::option::Option::Some(inner_55) = &input.ssekms_encryption_context { - let formatted_56 = inner_55.as_str(); - let header_value = formatted_56; + if let ::std::option::Option::Some(inner_57) = &input.ssekms_encryption_context { + let formatted_58 = inner_57.as_str(); + let header_value = formatted_58; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "ssekms_encryption_context", @@ -494,10 +505,10 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-server-side-encryption-context", header_value); } - if let ::std::option::Option::Some(inner_57) = &input.bucket_key_enabled { - let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_57); - let formatted_58 = encoder.encode(); - let header_value = formatted_58; + if let ::std::option::Option::Some(inner_59) = &input.bucket_key_enabled { + let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_59); + let formatted_60 = encoder.encode(); + let header_value = formatted_60; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "bucket_key_enabled", @@ -506,9 +517,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-server-side-encryption-bucket-key-enabled", header_value); } - if let ::std::option::Option::Some(inner_59) = &input.request_payer { - let formatted_60 = inner_59.as_str(); - let header_value = formatted_60; + if let ::std::option::Option::Some(inner_61) = &input.request_payer { + let formatted_62 = inner_61.as_str(); + let header_value = formatted_62; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "request_payer", @@ -517,9 +528,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-request-payer", header_value); } - if let ::std::option::Option::Some(inner_61) = &input.tagging { - let formatted_62 = inner_61.as_str(); - let header_value = formatted_62; + if let ::std::option::Option::Some(inner_63) = &input.tagging { + let formatted_64 = inner_63.as_str(); + let header_value = formatted_64; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "tagging", @@ -528,9 +539,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-tagging", header_value); } - if let ::std::option::Option::Some(inner_63) = &input.object_lock_mode { - let formatted_64 = inner_63.as_str(); - let header_value = formatted_64; + if let ::std::option::Option::Some(inner_65) = &input.object_lock_mode { + let formatted_66 = inner_65.as_str(); + let header_value = formatted_66; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "object_lock_mode", @@ -539,9 +550,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-object-lock-mode", header_value); } - if let ::std::option::Option::Some(inner_65) = &input.object_lock_retain_until_date { - let formatted_66 = inner_65.fmt(::aws_smithy_types::date_time::Format::DateTime)?; - let header_value = formatted_66; + if let ::std::option::Option::Some(inner_67) = &input.object_lock_retain_until_date { + let formatted_68 = inner_67.fmt(::aws_smithy_types::date_time::Format::DateTime)?; + let header_value = formatted_68; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "object_lock_retain_until_date", @@ -550,9 +561,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-object-lock-retain-until-date", header_value); } - if let ::std::option::Option::Some(inner_67) = &input.object_lock_legal_hold_status { - let formatted_68 = inner_67.as_str(); - let header_value = formatted_68; + if let ::std::option::Option::Some(inner_69) = &input.object_lock_legal_hold_status { + let formatted_70 = inner_69.as_str(); + let header_value = formatted_70; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "object_lock_legal_hold_status", @@ -561,9 +572,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-object-lock-legal-hold", header_value); } - if let ::std::option::Option::Some(inner_69) = &input.expected_bucket_owner { - let formatted_70 = inner_69.as_str(); - let header_value = formatted_70; + if let ::std::option::Option::Some(inner_71) = &input.expected_bucket_owner { + let formatted_72 = inner_71.as_str(); + let header_value = formatted_72; let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( "expected_bucket_owner", @@ -572,9 +583,9 @@ pub fn ser_put_object_headers( })?; builder = builder.header("x-amz-expected-bucket-owner", header_value); } - if let ::std::option::Option::Some(inner_71) = &input.metadata { + if let ::std::option::Option::Some(inner_73) = &input.metadata { { - for (k, v) in inner_71 { + for (k, v) in inner_73 { use std::str::FromStr; let header_name = http::header::HeaderName::from_str(&format!("{}{}", "x-amz-meta-", &k)).map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field( diff --git a/tests/no-default-features/Cargo.toml b/tests/no-default-features/Cargo.toml index d7e83c3e5976..ddec87c6298f 100644 --- a/tests/no-default-features/Cargo.toml +++ b/tests/no-default-features/Cargo.toml @@ -21,7 +21,7 @@ version = "1.5.10" [dev-dependencies.aws-sdk-s3] path = "../../sdk/s3" default-features = false -version = "1.62.0" +version = "1.63.0" [dev-dependencies.aws-smithy-async] path = "../../sdk/aws-smithy-async" diff --git a/versions.toml b/versions.toml index 502880a65a8b..cdf23e6e85ff 100644 --- a/versions.toml +++ b/versions.toml @@ -712,9 +712,9 @@ model_hash = 'b3acf0a59884b7504ce6f196736993338aa9ea89ac46237d1ed8beaf31cc50aa' [crates.aws-sdk-directconnect] category = 'AwsSdk' -version = '1.50.0' -source_hash = 'af0bebd2b5406c880c695a02028d6a49fd0b48d398b815e296d9e82c714a141d' -model_hash = '72e64ece15c7f5f5b0d3baef12cae6f68c1b69455cec29dc1632f1074475be95' +version = '1.51.0' +source_hash = 'a507e8d4f164963db5ad4dc72e8c3d416b6ba56ea72b8788553b73958b07e741' +model_hash = '42c695f3f0819f340c031781d76f8ede41ea89152c4c7df9a9abc2320b070e3c' [crates.aws-sdk-directory] category = 'AwsSdk' @@ -1594,9 +1594,9 @@ model_hash = '519c3bb308e6649b84ff3ba6b31f37d8a68fd5cc775b277d162ed92e24797f58' [crates.aws-sdk-networkmanager] category = 'AwsSdk' -version = '1.51.0' -source_hash = '514f8b02a653e885fa3a3af11c9e8035dcf0dc9c6407a90655430f4cf610655b' -model_hash = '3af5cd3615c95ab6a7e630f8c5ab5d143c54c72528804bbc60bfc745cf0078d5' +version = '1.52.0' +source_hash = '29c690fe96d19d18c573113b6b304943d9a4728e5d4a96c30ae04c97bbafaf60' +model_hash = 'bff282028f955cfc6998bbe31c3ebd670bf17bc1582510072f0e2f2af0f55ab4' [crates.aws-sdk-networkmonitor] category = 'AwsSdk' @@ -1966,9 +1966,9 @@ model_hash = '34648839402316ab9da4bef0fe11beb9bc3ec1d05b3ff7d09664ab74c0cb3d2b' [crates.aws-sdk-s3] category = 'AwsSdk' -version = '1.62.0' -source_hash = '2718818e1fcd6fda2e2b2af93d0c3c8003a3938564498954e2ca80ade5baa344' -model_hash = 'daf8e766b0eb5759a88501a87db37ece8b66c58f3217f3a967e148dde150075e' +version = '1.63.0' +source_hash = 'd153cad2abe2b3779e019212b070c2f82fdc5f7e2baf718d8146302b9b4ae7c8' +model_hash = 'fa854da689c894730ac6efc704ac906596fb2a3081ec19673e0224207d0f7c36' [crates.aws-sdk-s3control] category = 'AwsSdk' @@ -2547,29 +2547,7 @@ source_hash = 'f926d3a7deb08a19ecbde8ed9516c47a27d4a3db2cf6b2f2532791634565b05e' category = 'AwsRuntime' version = '0.0.0' source_hash = '340172f38639aeb06ccd407828639e840caf6a7109c4eac3c6c78a9e06c1ef06' - -[release] -tag = 'release-2024-11-22' - [release.crates] -aws-sdk-autoscaling = '1.57.0' -aws-sdk-bcmpricingcalculator = '1.0.0' -aws-sdk-bedrockagentruntime = '1.61.0' -aws-sdk-chatbot = '1.39.0' -aws-sdk-codepipeline = '1.57.0' -aws-sdk-cognitoidentityprovider = '1.58.0' -aws-sdk-connect = '1.75.0' -aws-sdk-costexplorer = '1.54.0' -aws-sdk-elasticloadbalancingv2 = '1.57.0' -aws-sdk-emr = '1.55.0' -aws-sdk-inspector2 = '1.56.0' -aws-sdk-lambda = '1.59.0' -aws-sdk-mailmanager = '1.27.0' -aws-sdk-neptunegraph = '1.48.0' -aws-sdk-omics = '1.54.0' -aws-sdk-quicksight = '1.65.0' -aws-sdk-sagemaker = '1.87.0' -aws-sdk-ses = '1.52.0' -aws-sdk-sfn = '1.53.0' -aws-sdk-sns = '1.50.1' -aws-sdk-workspaces = '1.59.1' +aws-sdk-directconnect = '1.51.0' +aws-sdk-networkmanager = '1.52.0' +aws-sdk-s3 = '1.63.0'