diff --git a/clients/client-b2bi/src/commands/CreateTransformerCommand.ts b/clients/client-b2bi/src/commands/CreateTransformerCommand.ts index 1f6727cd360d..2786d2632c73 100644 --- a/clients/client-b2bi/src/commands/CreateTransformerCommand.ts +++ b/clients/client-b2bi/src/commands/CreateTransformerCommand.ts @@ -204,17 +204,29 @@ export interface CreateTransformerCommandOutput extends CreateTransformerRespons * ```javascript * // * const input = { - * "name": "transformJSON", + * "name": "transformX12", * "clientToken": "foo", - * "ediType": { - * "x12Details": { - * "version": "VERSION_4010", - * "transactionSet": "X12_110" - * } + * "inputConversion": { + * "formatOptions": { + * "x12": { + * "version": "VERSION_4010", + * "transactionSet": "X12_110" + * } + * }, + * "fromFormat": "X12" + * }, + * "mapping": { + * "template": "{}", + * "templateLanguage": "JSONATA" + * }, + * "sampleDocuments": { + * "bucketName": "test-bucket", + * "keys": [ + * { + * "input": "sampleDoc.txt" + * } + * ] * }, - * "fileFormat": "JSON", - * "mappingTemplate": "{}", - * "sampleDocument": "s3://test-bucket/sampleDoc.txt", * "tags": [ * { * "Key": "sampleKey", @@ -226,17 +238,29 @@ export interface CreateTransformerCommandOutput extends CreateTransformerRespons * const response = await client.send(command); * /* response == * { - * "name": "transformJSON", + * "name": "transformX12", * "createdAt": "2023-11-01T21:51:05.504Z", - * "ediType": { - * "x12Details": { - * "version": "VERSION_4010", - * "transactionSet": "X12_110" - * } + * "inputConversion": { + * "formatOptions": { + * "x12": { + * "version": "VERSION_4010", + * "transactionSet": "X12_110" + * } + * }, + * "fromFormat": "X12" + * }, + * "mapping": { + * "template": "{}", + * "templateLanguage": "JSONATA" + * }, + * "sampleDocuments": { + * "bucketName": "test-bucket", + * "keys": [ + * { + * "input": "sampleDoc.txt" + * } + * ] * }, - * "fileFormat": "JSON", - * "mappingTemplate": "$", - * "sampleDocument": "s3://test-bucket/sampleDoc.txt", * "status": "inactive", * "transformerArn": "arn:aws:b2bi:us-west-2:123456789012:transformer/tr-974c129999f84d8c9", * "transformerId": "tr-974c129999f84d8c9" diff --git a/clients/client-b2bi/src/commands/GetTransformerCommand.ts b/clients/client-b2bi/src/commands/GetTransformerCommand.ts index f113f59c7b61..4da6b21910a5 100644 --- a/clients/client-b2bi/src/commands/GetTransformerCommand.ts +++ b/clients/client-b2bi/src/commands/GetTransformerCommand.ts @@ -127,18 +127,29 @@ export interface GetTransformerCommandOutput extends GetTransformerResponse, __M * const response = await client.send(command); * /* response == * { - * "name": "transformJSON", + * "name": "transformX12", * "createdAt": "2023-11-01T21:51:05.504Z", - * "ediType": { - * "x12Details": { - * "version": "VERSION_4010", - * "transactionSet": "X12_110" - * } + * "inputConversion": { + * "formatOptions": { + * "x12": { + * "version": "VERSION_4010", + * "transactionSet": "X12_110" + * } + * }, + * "fromFormat": "X12" + * }, + * "mapping": { + * "template": "{}", + * "templateLanguage": "JSONATA" + * }, + * "sampleDocuments": { + * "bucketName": "test-bucket", + * "keys": [ + * { + * "input": "sampleDoc.txt" + * } + * ] * }, - * "fileFormat": "JSON", - * "mappingTemplate": "$", - * "modifiedAt": "2023-11-01T21:51:05.504Z", - * "sampleDocument": "s3://test-bucket/sampleDoc.txt", * "status": "inactive", * "transformerArn": "arn:aws:b2bi:us-west-2:123456789012:transformer/tr-974c129999f84d8c9", * "transformerId": "tr-974c129999f84d8c9" diff --git a/clients/client-b2bi/src/commands/UpdateTransformerCommand.ts b/clients/client-b2bi/src/commands/UpdateTransformerCommand.ts index c4d2fd2b533d..3da0b82bf460 100644 --- a/clients/client-b2bi/src/commands/UpdateTransformerCommand.ts +++ b/clients/client-b2bi/src/commands/UpdateTransformerCommand.ts @@ -169,16 +169,28 @@ export interface UpdateTransformerCommandOutput extends UpdateTransformerRespons * ```javascript * // * const input = { - * "name": "transformJSON", - * "ediType": { - * "x12Details": { - * "version": "VERSION_4010", - * "transactionSet": "X12_110" - * } + * "name": "transformX12", + * "inputConversion": { + * "formatOptions": { + * "x12": { + * "version": "VERSION_4010", + * "transactionSet": "X12_110" + * } + * }, + * "fromFormat": "X12" + * }, + * "mapping": { + * "template": "{}", + * "templateLanguage": "JSONATA" + * }, + * "sampleDocuments": { + * "bucketName": "test-bucket", + * "keys": [ + * { + * "input": "sampleDoc.txt" + * } + * ] * }, - * "fileFormat": "JSON", - * "mappingTemplate": "{}", - * "sampleDocument": "s3://test-bucket/sampleDoc.txt", * "status": "inactive", * "transformerId": "tr-974c129999f84d8c9" * }; @@ -186,20 +198,32 @@ export interface UpdateTransformerCommandOutput extends UpdateTransformerRespons * const response = await client.send(command); * /* response == * { - * "name": "transformJSON", + * "name": "transformX12", * "createdAt": "2023-11-01T21:51:05.504Z", - * "ediType": { - * "x12Details": { - * "version": "VERSION_4010", - * "transactionSet": "X12_110" - * } + * "inputConversion": { + * "formatOptions": { + * "x12": { + * "version": "VERSION_4010", + * "transactionSet": "X12_110" + * } + * }, + * "fromFormat": "X12" + * }, + * "mapping": { + * "template": "{}", + * "templateLanguage": "JSONATA" + * }, + * "modifiedAt": "2023-11-02T22:31:05.504Z", + * "sampleDocuments": { + * "bucketName": "test-bucket", + * "keys": [ + * { + * "input": "sampleDoc.txt" + * } + * ] * }, - * "fileFormat": "JSON", - * "mappingTemplate": "$", - * "modifiedAt": "2023-11-01T21:51:05.504Z", - * "sampleDocument": "s3://test-bucket/sampleDoc.txt", * "status": "inactive", - * "transformerArn": "arn:aws:b2bi:us-west-2:607686414464:transformer/tr-974c129999f84d8c9", + * "transformerArn": "arn:aws:b2bi:us-west-2:123456789012:transformer/tr-974c129999f84d8c9", * "transformerId": "tr-974c129999f84d8c9" * } * *\/ diff --git a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts index 6649f1c2fe3c..9a638da5bdfc 100644 --- a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts @@ -314,9 +314,7 @@ export const de_InvokeAgentCommand = async ( [_mI]: [, output.headers[_xabami]], }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.completion = __expectUnion(de_ResponseStream(data, context)); - } + contents.completion = de_ResponseStream(data, context); return contents; }; @@ -334,9 +332,7 @@ export const de_InvokeFlowCommand = async ( $metadata: deserializeMetadata(output), }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.responseStream = __expectUnion(de_FlowResponseStream(data, context)); - } + contents.responseStream = de_FlowResponseStream(data, context); return contents; }; diff --git a/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts index 2fe89a5f6eb6..37d761b99356 100644 --- a/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts @@ -295,9 +295,7 @@ export const de_ConverseStreamCommand = async ( $metadata: deserializeMetadata(output), }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.stream = __expectUnion(de_ConverseStreamOutput(data, context)); - } + contents.stream = de_ConverseStreamOutput(data, context); return contents; }; @@ -335,9 +333,7 @@ export const de_InvokeModelWithResponseStreamCommand = async ( [_cT]: [, output.headers[_xabct]], }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.body = __expectUnion(de_ResponseStream(data, context)); - } + contents.body = de_ResponseStream(data, context); return contents; }; diff --git a/clients/client-lambda/src/protocols/Aws_restJson1.ts b/clients/client-lambda/src/protocols/Aws_restJson1.ts index feb997ab031e..42756c47e505 100644 --- a/clients/client-lambda/src/protocols/Aws_restJson1.ts +++ b/clients/client-lambda/src/protocols/Aws_restJson1.ts @@ -1,10 +1,5 @@ // smithy-typescript generated code -import { - awsExpectUnion as __expectUnion, - loadRestJsonErrorCode, - parseJsonBody as parseBody, - parseJsonErrorBody as parseErrorBody, -} from "@aws-sdk/core"; +import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core"; import { requestBuilder as rb } from "@smithy/core"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { @@ -2787,9 +2782,7 @@ export const de_InvokeWithResponseStreamCommand = async ( [_RSCT]: [, output.headers[_ct]], }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.EventStream = __expectUnion(de_InvokeWithResponseStreamResponseEvent(data, context)); - } + contents.EventStream = de_InvokeWithResponseStreamResponseEvent(data, context); map(contents, { StatusCode: [, output.statusCode], }); diff --git a/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts b/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts index eb1350dbd1ca..4be6565b7d7b 100644 --- a/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts @@ -1,10 +1,5 @@ // smithy-typescript generated code -import { - awsExpectUnion as __expectUnion, - loadRestJsonErrorCode, - parseJsonBody as parseBody, - parseJsonErrorBody as parseErrorBody, -} from "@aws-sdk/core"; +import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core"; import { requestBuilder as rb } from "@smithy/core"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { @@ -369,9 +364,7 @@ export const de_StartConversationCommand = async ( $metadata: deserializeMetadata(output), }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.responseEventStream = __expectUnion(de_StartConversationResponseEventStream(data, context)); - } + contents.responseEventStream = de_StartConversationResponseEventStream(data, context); return contents; }; diff --git a/clients/client-qbusiness/src/protocols/Aws_restJson1.ts b/clients/client-qbusiness/src/protocols/Aws_restJson1.ts index 594ed3868bfa..bd1d4a616670 100644 --- a/clients/client-qbusiness/src/protocols/Aws_restJson1.ts +++ b/clients/client-qbusiness/src/protocols/Aws_restJson1.ts @@ -1556,9 +1556,7 @@ export const de_ChatCommand = async ( $metadata: deserializeMetadata(output), }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.outputStream = __expectUnion(de_ChatOutputStream(data, context)); - } + contents.outputStream = de_ChatOutputStream(data, context); return contents; }; diff --git a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts index 1ad5cde4832f..a9118c24b1bc 100644 --- a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts @@ -102,9 +102,7 @@ export const de_StartFaceLivenessSessionCommand = async ( [_SI]: [, output.headers[_xarslsi]], }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.LivenessResponseStream = __expectUnion(de_LivenessResponseStream(data, context)); - } + contents.LivenessResponseStream = de_LivenessResponseStream(data, context); return contents; }; diff --git a/clients/client-s3/src/commands/DeleteObjectCommand.ts b/clients/client-s3/src/commands/DeleteObjectCommand.ts index 053c7afeb76e..3e7e5c89da4f 100644 --- a/clients/client-s3/src/commands/DeleteObjectCommand.ts +++ b/clients/client-s3/src/commands/DeleteObjectCommand.ts @@ -163,28 +163,28 @@ export interface DeleteObjectCommandOutput extends DeleteObjectOutput, __Metadat *
Base exception class for all service exceptions from S3 service.
* * @public - * @example To delete an object (from a non-versioned bucket) + * @example To delete an object * ```javascript - * // The following example deletes an object from a non-versioned bucket. + * // The following example deletes an object from an S3 bucket. * const input = { - * "Bucket": "ExampleBucket", - * "Key": "HappyFace.jpg" + * "Bucket": "examplebucket", + * "Key": "objectkey.jpg" * }; * const command = new DeleteObjectCommand(input); * await client.send(command); - * // example id: to-delete-an-object-from-a-non-versioned-bucket-1481588533089 + * // example id: to-delete-an-object-1472850136595 * ``` * - * @example To delete an object + * @example To delete an object (from a non-versioned bucket) * ```javascript - * // The following example deletes an object from an S3 bucket. + * // The following example deletes an object from a non-versioned bucket. * const input = { - * "Bucket": "examplebucket", - * "Key": "objectkey.jpg" + * "Bucket": "ExampleBucket", + * "Key": "HappyFace.jpg" * }; * const command = new DeleteObjectCommand(input); * await client.send(command); - * // example id: to-delete-an-object-1472850136595 + * // example id: to-delete-an-object-from-a-non-versioned-bucket-1481588533089 * ``` * */ diff --git a/clients/client-s3/src/commands/DeleteObjectsCommand.ts b/clients/client-s3/src/commands/DeleteObjectsCommand.ts index a41f2e1d2762..57727ddec80d 100644 --- a/clients/client-s3/src/commands/DeleteObjectsCommand.ts +++ b/clients/client-s3/src/commands/DeleteObjectsCommand.ts @@ -213,20 +213,18 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad *Base exception class for all service exceptions from S3 service.
* * @public - * @example To delete multiple object versions from a versioned bucket + * @example To delete multiple objects from a versioned bucket * ```javascript - * // The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object versions and returns the key and versions of deleted objects in the response. + * // The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker. * const input = { * "Bucket": "examplebucket", * "Delete": { * "Objects": [ * { - * "Key": "HappyFace.jpg", - * "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b" + * "Key": "objectkey1" * }, * { - * "Key": "HappyFace.jpg", - * "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd" + * "Key": "objectkey2" * } * ], * "Quiet": false @@ -238,31 +236,35 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad * { * "Deleted": [ * { - * "Key": "HappyFace.jpg", - * "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd" + * "DeleteMarker": "true", + * "DeleteMarkerVersionId": "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F", + * "Key": "objectkey1" * }, * { - * "Key": "HappyFace.jpg", - * "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b" + * "DeleteMarker": "true", + * "DeleteMarkerVersionId": "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt", + * "Key": "objectkey2" * } * ] * } * *\/ - * // example id: to-delete-multiple-object-versions-from-a-versioned-bucket-1483147087737 + * // example id: to-delete-multiple-objects-from-a-versioned-bucket-1483146248805 * ``` * - * @example To delete multiple objects from a versioned bucket + * @example To delete multiple object versions from a versioned bucket * ```javascript - * // The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker. + * // The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object versions and returns the key and versions of deleted objects in the response. * const input = { * "Bucket": "examplebucket", * "Delete": { * "Objects": [ * { - * "Key": "objectkey1" + * "Key": "HappyFace.jpg", + * "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b" * }, * { - * "Key": "objectkey2" + * "Key": "HappyFace.jpg", + * "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd" * } * ], * "Quiet": false @@ -274,19 +276,17 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad * { * "Deleted": [ * { - * "DeleteMarker": "true", - * "DeleteMarkerVersionId": "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F", - * "Key": "objectkey1" + * "Key": "HappyFace.jpg", + * "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd" * }, * { - * "DeleteMarker": "true", - * "DeleteMarkerVersionId": "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt", - * "Key": "objectkey2" + * "Key": "HappyFace.jpg", + * "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b" * } * ] * } * *\/ - * // example id: to-delete-multiple-objects-from-a-versioned-bucket-1483146248805 + * // example id: to-delete-multiple-object-versions-from-a-versioned-bucket-1483147087737 * ``` * */ diff --git a/clients/client-s3/src/commands/GetObjectCommand.ts b/clients/client-s3/src/commands/GetObjectCommand.ts index e7b067246d85..acfb28282a71 100644 --- a/clients/client-s3/src/commands/GetObjectCommand.ts +++ b/clients/client-s3/src/commands/GetObjectCommand.ts @@ -292,53 +292,53 @@ export interface GetObjectCommandOutput extends OmitBase exception class for all service exceptions from S3 service.
* * @public - * @example To retrieve an object + * @example To retrieve a byte range of an object * ```javascript - * // The following example retrieves an object for an S3 bucket. + * // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range. * const input = { * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg" + * "Key": "SampleFile.txt", + * "Range": "bytes=0-9" * }; * const command = new GetObjectCommand(input); * const response = await client.send(command); * /* response == * { * "AcceptRanges": "bytes", - * "ContentLength": "3191", - * "ContentType": "image/jpeg", - * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT", + * "ContentLength": "10", + * "ContentRange": "bytes 0-9/43", + * "ContentType": "text/plain", + * "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"", + * "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT", * "Metadata": {}, - * "TagCount": 2, * "VersionId": "null" * } * *\/ - * // example id: to-retrieve-an-object-1481827837012 + * // example id: to-retrieve-a-byte-range-of-an-object--1481832674603 * ``` * - * @example To retrieve a byte range of an object + * @example To retrieve an object * ```javascript - * // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range. + * // The following example retrieves an object for an S3 bucket. * const input = { * "Bucket": "examplebucket", - * "Key": "SampleFile.txt", - * "Range": "bytes=0-9" + * "Key": "HappyFace.jpg" * }; * const command = new GetObjectCommand(input); * const response = await client.send(command); * /* response == * { * "AcceptRanges": "bytes", - * "ContentLength": "10", - * "ContentRange": "bytes 0-9/43", - * "ContentType": "text/plain", - * "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"", - * "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT", + * "ContentLength": "3191", + * "ContentType": "image/jpeg", + * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", + * "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT", * "Metadata": {}, + * "TagCount": 2, * "VersionId": "null" * } * *\/ - * // example id: to-retrieve-a-byte-range-of-an-object--1481832674603 + * // example id: to-retrieve-an-object-1481827837012 * ``` * */ diff --git a/clients/client-s3/src/commands/GetObjectTaggingCommand.ts b/clients/client-s3/src/commands/GetObjectTaggingCommand.ts index 7d84170e5e3f..32326f4bc9dc 100644 --- a/clients/client-s3/src/commands/GetObjectTaggingCommand.ts +++ b/clients/client-s3/src/commands/GetObjectTaggingCommand.ts @@ -98,13 +98,12 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _ *Base exception class for all service exceptions from S3 service.
* * @public - * @example To retrieve tag set of a specific object version + * @example To retrieve tag set of an object * ```javascript - * // The following example retrieves tag set of an object. The request specifies object version. + * // The following example retrieves tag set of an object. * const input = { * "Bucket": "examplebucket", - * "Key": "exampleobject", - * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" + * "Key": "HappyFace.jpg" * }; * const command = new GetObjectTaggingCommand(input); * const response = await client.send(command); @@ -112,22 +111,27 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _ * { * "TagSet": [ * { - * "Key": "Key1", - * "Value": "Value1" + * "Key": "Key4", + * "Value": "Value4" + * }, + * { + * "Key": "Key3", + * "Value": "Value3" * } * ], - * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" + * "VersionId": "null" * } * *\/ - * // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663 + * // example id: to-retrieve-tag-set-of-an-object-1481833847896 * ``` * - * @example To retrieve tag set of an object + * @example To retrieve tag set of a specific object version * ```javascript - * // The following example retrieves tag set of an object. + * // The following example retrieves tag set of an object. The request specifies object version. * const input = { * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg" + * "Key": "exampleobject", + * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" * }; * const command = new GetObjectTaggingCommand(input); * const response = await client.send(command); @@ -135,18 +139,14 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _ * { * "TagSet": [ * { - * "Key": "Key4", - * "Value": "Value4" - * }, - * { - * "Key": "Key3", - * "Value": "Value3" + * "Key": "Key1", + * "Value": "Value1" * } * ], - * "VersionId": "null" + * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" * } * *\/ - * // example id: to-retrieve-tag-set-of-an-object-1481833847896 + * // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663 * ``` * */ diff --git a/clients/client-s3/src/commands/PutObjectCommand.ts b/clients/client-s3/src/commands/PutObjectCommand.ts index db31135c3013..92410019d42b 100644 --- a/clients/client-s3/src/commands/PutObjectCommand.ts +++ b/clients/client-s3/src/commands/PutObjectCommand.ts @@ -249,24 +249,24 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare *Base exception class for all service exceptions from S3 service.
* * @public - * @example To upload an object and specify optional tags + * @example To upload an object and specify canned ACL. * ```javascript - * // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object. + * // The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { - * "Body": "c:\\HappyFace.jpg", + * "ACL": "authenticated-read", + * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg", - * "Tagging": "key1=value1&key2=value2" + * "Key": "exampleobject" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a" + * "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr" * } * *\/ - * // example id: to-upload-an-object-and-specify-optional-tags-1481762310955 + * // example id: to-upload-an-object-and-specify-canned-acl-1483397779571 * ``` * * @example To create an object. @@ -288,46 +288,43 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * // example id: to-create-an-object-1483147613675 * ``` * - * @example To upload object and specify user-defined metadata + * @example To upload an object * ```javascript - * // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object. * const input = { - * "Body": "filetoupload", + * "Body": "HappyFace.jpg", * "Bucket": "examplebucket", - * "Key": "exampleobject", - * "Metadata": { - * "metadata1": "value1", - * "metadata2": "value2" - * } + * "Key": "HappyFace.jpg" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" + * "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk" * } * *\/ - * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 + * // example id: to-upload-an-object-1481760101010 * ``` * - * @example To upload an object + * @example To upload an object and specify optional tags * ```javascript - * // The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object. + * // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object. * const input = { - * "Body": "HappyFace.jpg", + * "Body": "c:\\HappyFace.jpg", * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg" + * "Key": "HappyFace.jpg", + * "Tagging": "key1=value1&key2=value2" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk" + * "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a" * } * *\/ - * // example id: to-upload-an-object-1481760101010 + * // example id: to-upload-an-object-and-specify-optional-tags-1481762310955 * ``` * * @example To upload an object and specify server-side encryption and object tags @@ -352,46 +349,49 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831 * ``` * - * @example To upload an object and specify canned ACL. + * @example To upload an object (specify optional headers) * ```javascript - * // The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption. * const input = { - * "ACL": "authenticated-read", - * "Body": "filetoupload", + * "Body": "HappyFace.jpg", * "Bucket": "examplebucket", - * "Key": "exampleobject" + * "Key": "HappyFace.jpg", + * "ServerSideEncryption": "AES256", + * "StorageClass": "STANDARD_IA" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr" + * "ServerSideEncryption": "AES256", + * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" * } * *\/ - * // example id: to-upload-an-object-and-specify-canned-acl-1483397779571 + * // example id: to-upload-an-object-(specify-optional-headers) * ``` * - * @example To upload an object (specify optional headers) + * @example To upload object and specify user-defined metadata * ```javascript - * // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption. + * // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { - * "Body": "HappyFace.jpg", + * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg", - * "ServerSideEncryption": "AES256", - * "StorageClass": "STANDARD_IA" + * "Key": "exampleobject", + * "Metadata": { + * "metadata1": "value1", + * "metadata2": "value2" + * } * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "ServerSideEncryption": "AES256", - * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" + * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" * } * *\/ - * // example id: to-upload-an-object-(specify-optional-headers) + * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 * ``` * */ diff --git a/clients/client-s3/src/commands/UploadPartCopyCommand.ts b/clients/client-s3/src/commands/UploadPartCopyCommand.ts index 3ea96249be70..a330ba4d28b9 100644 --- a/clients/client-s3/src/commands/UploadPartCopyCommand.ts +++ b/clients/client-s3/src/commands/UploadPartCopyCommand.ts @@ -305,15 +305,14 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met *Base exception class for all service exceptions from S3 service.
* * @public - * @example To upload a part by copying byte range from an existing object as data source + * @example To upload a part by copying data from an existing object as data source * ```javascript - * // The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as data source. + * // The following example uploads a part of a multipart upload by copying data from an existing object as data source. * const input = { * "Bucket": "examplebucket", * "CopySource": "/bucketname/sourceobjectkey", - * "CopySourceRange": "bytes=1-100000", * "Key": "examplelargeobject", - * "PartNumber": "2", + * "PartNumber": "1", * "UploadId": "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--" * }; * const command = new UploadPartCopyCommand(input); @@ -321,22 +320,23 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met * /* response == * { * "CopyPartResult": { - * "ETag": "\"65d16d19e65a7508a51f043180edcc36\"", - * "LastModified": "2016-12-29T21:44:28.000Z" + * "ETag": "\"b0c6f0e7e054ab8fa2536a2677f8734d\"", + * "LastModified": "2016-12-29T21:24:43.000Z" * } * } * *\/ - * // example id: to-upload-a-part-by-copying-byte-range-from-an-existing-object-as-data-source-1483048068594 + * // example id: to-upload-a-part-by-copying-data-from-an-existing-object-as-data-source-1483046746348 * ``` * - * @example To upload a part by copying data from an existing object as data source + * @example To upload a part by copying byte range from an existing object as data source * ```javascript - * // The following example uploads a part of a multipart upload by copying data from an existing object as data source. + * // The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as data source. * const input = { * "Bucket": "examplebucket", * "CopySource": "/bucketname/sourceobjectkey", + * "CopySourceRange": "bytes=1-100000", * "Key": "examplelargeobject", - * "PartNumber": "1", + * "PartNumber": "2", * "UploadId": "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--" * }; * const command = new UploadPartCopyCommand(input); @@ -344,12 +344,12 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met * /* response == * { * "CopyPartResult": { - * "ETag": "\"b0c6f0e7e054ab8fa2536a2677f8734d\"", - * "LastModified": "2016-12-29T21:24:43.000Z" + * "ETag": "\"65d16d19e65a7508a51f043180edcc36\"", + * "LastModified": "2016-12-29T21:44:28.000Z" * } * } * *\/ - * // example id: to-upload-a-part-by-copying-data-from-an-existing-object-as-data-source-1483046746348 + * // example id: to-upload-a-part-by-copying-byte-range-from-an-existing-object-as-data-source-1483048068594 * ``` * */ diff --git a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts index 5e67b1211d7a..74704ebcdf9a 100644 --- a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts @@ -1,10 +1,5 @@ // smithy-typescript generated code -import { - awsExpectUnion as __expectUnion, - loadRestJsonErrorCode, - parseJsonBody as parseBody, - parseJsonErrorBody as parseErrorBody, -} from "@aws-sdk/core"; +import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core"; import { requestBuilder as rb } from "@smithy/core"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { @@ -196,9 +191,7 @@ export const de_InvokeEndpointWithResponseStreamCommand = async ( [_CA]: [, output.headers[_xasca]], }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.Body = __expectUnion(de_ResponseStream(data, context)); - } + contents.Body = de_ResponseStream(data, context); return contents; }; diff --git a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts index 88b2d7fd76b9..9a00322b0d1b 100644 --- a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts @@ -1,10 +1,5 @@ // smithy-typescript generated code -import { - awsExpectUnion as __expectUnion, - loadRestJsonErrorCode, - parseJsonBody as parseBody, - parseJsonErrorBody as parseErrorBody, -} from "@aws-sdk/core"; +import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core"; import { requestBuilder as rb } from "@smithy/core"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { @@ -211,9 +206,7 @@ export const de_StartCallAnalyticsStreamTranscriptionCommand = async ( [_PET]: [, output.headers[_xatpet]], }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.CallAnalyticsTranscriptResultStream = __expectUnion(de_CallAnalyticsTranscriptResultStream(data, context)); - } + contents.CallAnalyticsTranscriptResultStream = de_CallAnalyticsTranscriptResultStream(data, context); return contents; }; @@ -243,9 +236,7 @@ export const de_StartMedicalStreamTranscriptionCommand = async ( [_CIT]: [, output.headers[_xatcit]], }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.TranscriptResultStream = __expectUnion(de_MedicalTranscriptResultStream(data, context)); - } + contents.TranscriptResultStream = de_MedicalTranscriptResultStream(data, context); return contents; }; @@ -286,9 +277,7 @@ export const de_StartStreamTranscriptionCommand = async ( [_VFNo]: [, output.headers[_xatvfn_]], }); const data: any = output.body; - if (Object.keys(data ?? {}).length) { - contents.TranscriptResultStream = __expectUnion(de_TranscriptResultStream(data, context)); - } + contents.TranscriptResultStream = de_TranscriptResultStream(data, context); return contents; }; diff --git a/scripts/generate-clients/config.js b/scripts/generate-clients/config.js index c895b9488cd1..afeeb2929bf8 100644 --- a/scripts/generate-clients/config.js +++ b/scripts/generate-clients/config.js @@ -1,7 +1,7 @@ // Update this commit when taking up new changes from smithy-typescript. module.exports = { // Use full commit hash as we explicitly fetch it. - SMITHY_TS_COMMIT: "e8b99b1bd437ce3caf83893737858bcba02ed4a8", + SMITHY_TS_COMMIT: "5c4370ae7df25b219c1facb6203ead15b9334d12", }; if (module.exports.SMITHY_TS_COMMIT.length < 40) {