From df939bca4d7783388e8d0248be9321c8b364d405 Mon Sep 17 00:00:00 2001 From: George Fu Date: Thu, 15 Jun 2023 18:26:58 +0000 Subject: [PATCH] feat(smithy-client): use collectBody from smithy-client --- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-acm/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-amp/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-api-gateway/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-apigatewayv2/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-appconfig/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-appconfigdata/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- clients/client-appsync/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_query.ts | 13 +-- clients/client-cloudfront/package.json | 1 + .../src/protocols/Aws_restXml.ts | 15 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-codeguruprofiler/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-dax/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-dlm/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-docdb/src/protocols/Aws_query.ts | 15 +-- .../client-drs/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../client-ebs/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- clients/client-ec2/src/protocols/Aws_ec2.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-ecr/src/protocols/Aws_json1_1.ts | 13 +-- .../client-ecs/src/protocols/Aws_json1_1.ts | 13 +-- .../client-efs/src/protocols/Aws_restJson1.ts | 13 +-- .../client-eks/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-emr/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-fis/src/protocols/Aws_restJson1.ts | 13 +-- .../client-fms/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-fsx/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-glue/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-iam/src/protocols/Aws_query.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-iot-data-plane/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-iot-wireless/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-iot/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-ivs/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-kms/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-lambda/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- clients/client-location/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-m2/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-macie/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-mgn/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-mq/src/protocols/Aws_restJson1.ts | 13 +-- .../client-mturk/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-neptune/src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-oam/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-pi/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-ram/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-rds/src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_query.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restXml.ts | 15 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-rum/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restXml.ts | 15 +-- .../src/commands/CreateBucketCommand.ts | 26 ++--- .../src/commands/DeleteObjectCommand.ts | 20 ++-- .../commands/DeleteObjectTaggingCommand.ts | 22 ++-- .../src/commands/GetObjectTaggingCommand.ts | 38 +++---- .../commands/ListMultipartUploadsCommand.ts | 64 +++++------ .../src/commands/PutObjectCommand.ts | 100 +++++++++--------- .../client-s3/src/protocols/Aws_restXml.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-sagemaker-runtime/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- clients/client-schemas/package.json | 1 + .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- clients/client-ses/src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-sfn/src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-sms/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- clients/client-sns/src/protocols/Aws_query.ts | 15 +-- clients/client-sqs/src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-ssm/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../client-sso/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- clients/client-sts/src/protocols/Aws_query.ts | 15 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-swf/src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- clients/client-tnb/package.json | 1 + .../client-tnb/src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_json1_0.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../client-waf/src/protocols/Aws_json1_1.ts | 13 +-- .../client-wafv2/src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_json1_1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- packages/smithy-client/package.json | 2 + .../src/collect-stream-body.spec.ts | 49 +++++++++ .../smithy-client/src/collect-stream-body.ts | 26 +++++ packages/smithy-client/src/index.ts | 1 + .../src/blob/Uint8ArrayBlobAdapter.spec.ts | 2 +- .../src/protocols/Aws_restJson1.ts | 13 +-- .../aws-protocoltests-ec2/src/endpoints.ts | 14 +++ .../src/protocols/Aws_ec2.ts | 15 +-- .../src/endpoints.ts | 14 +++ .../src/protocols/Aws_json1_0.ts | 13 +-- .../aws-protocoltests-json/src/endpoints.ts | 14 +++ .../src/protocols/Aws_json1_1.ts | 13 +-- .../aws-protocoltests-query/src/endpoints.ts | 14 +++ .../src/protocols/Aws_query.ts | 15 +-- .../src/endpoints.ts | 14 +++ .../src/protocols/Aws_restJson1.ts | 13 +-- .../aws-protocoltests-restxml/package.json | 1 + .../src/endpoints.ts | 14 +++ .../src/protocols/Aws_restXml.ts | 15 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- .../src/protocols/Aws_restJson1.ts | 13 +-- 390 files changed, 691 insertions(+), 4452 deletions(-) create mode 100644 packages/smithy-client/src/collect-stream-body.spec.ts create mode 100644 packages/smithy-client/src/collect-stream-body.ts diff --git a/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts b/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts index cd50f57915a4..f272e5b79330 100644 --- a/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts +++ b/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3323,17 +3323,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-account/src/protocols/Aws_restJson1.ts b/clients/client-account/src/protocols/Aws_restJson1.ts index ddd48acdd122..251b5bc9a8a5 100644 --- a/clients/client-account/src/protocols/Aws_restJson1.ts +++ b/clients/client-account/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -968,17 +968,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts index bb9055946824..baf7280b47bd 100644 --- a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2377,17 +2377,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-acm/src/protocols/Aws_json1_1.ts b/clients/client-acm/src/protocols/Aws_json1_1.ts index 8244d66e8a9f..7218403aac62 100644 --- a/clients/client-acm/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1599,17 +1599,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts index b8dd5865f21a..f34478c583a6 100644 --- a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts +++ b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7152,17 +7152,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-amp/src/protocols/Aws_restJson1.ts b/clients/client-amp/src/protocols/Aws_restJson1.ts index 15718b226d3a..71c1c6434f98 100644 --- a/clients/client-amp/src/protocols/Aws_restJson1.ts +++ b/clients/client-amp/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2264,17 +2264,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-amplify/src/protocols/Aws_restJson1.ts b/clients/client-amplify/src/protocols/Aws_restJson1.ts index bfaebdbd39b1..0638bc63a07c 100644 --- a/clients/client-amplify/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplify/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3778,17 +3778,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts b/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts index 859c5a62f999..c4797924a781 100644 --- a/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3892,17 +3892,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts b/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts index b92a12aa45c4..640c59d5c676 100644 --- a/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3706,17 +3706,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-api-gateway/package.json b/clients/client-api-gateway/package.json index c0826a786e54..9787d0906d5b 100644 --- a/clients/client-api-gateway/package.json +++ b/clients/client-api-gateway/package.json @@ -50,6 +50,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-api-gateway/src/protocols/Aws_restJson1.ts b/clients/client-api-gateway/src/protocols/Aws_restJson1.ts index 750af319139c..26f234d6dce7 100644 --- a/clients/client-api-gateway/src/protocols/Aws_restJson1.ts +++ b/clients/client-api-gateway/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, convertMap, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, @@ -20,7 +21,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -12172,17 +12172,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts b/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts index c7bf85f4986b..cfb92668f858 100644 --- a/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -369,17 +369,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-apigatewayv2/package.json b/clients/client-apigatewayv2/package.json index a9690301bf73..5df46fa8b9d4 100644 --- a/clients/client-apigatewayv2/package.json +++ b/clients/client-apigatewayv2/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts b/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts index c4274b6450fb..9e9ebe325913 100644 --- a/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -7371,17 +7371,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-app-mesh/src/protocols/Aws_restJson1.ts b/clients/client-app-mesh/src/protocols/Aws_restJson1.ts index b50c9f2ef3fa..8f0d225f93a0 100644 --- a/clients/client-app-mesh/src/protocols/Aws_restJson1.ts +++ b/clients/client-app-mesh/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5142,17 +5142,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-appconfig/package.json b/clients/client-appconfig/package.json index d3f5c7802bbc..07ca9752a661 100644 --- a/clients/client-appconfig/package.json +++ b/clients/client-appconfig/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-appconfig/src/protocols/Aws_restJson1.ts b/clients/client-appconfig/src/protocols/Aws_restJson1.ts index 7ec3047b9356..9088aee3ff53 100644 --- a/clients/client-appconfig/src/protocols/Aws_restJson1.ts +++ b/clients/client-appconfig/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4512,17 +4512,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-appconfigdata/package.json b/clients/client-appconfigdata/package.json index 96c1faa3bfa3..c27c48d52851 100644 --- a/clients/client-appconfigdata/package.json +++ b/clients/client-appconfigdata/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts b/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts index 74ffc4685527..786f8d4ed8f2 100644 --- a/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts +++ b/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -302,17 +302,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-appflow/src/protocols/Aws_restJson1.ts b/clients/client-appflow/src/protocols/Aws_restJson1.ts index 6cefeb22e9a9..73662fa2a884 100644 --- a/clients/client-appflow/src/protocols/Aws_restJson1.ts +++ b/clients/client-appflow/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3458,17 +3458,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-appintegrations/src/protocols/Aws_restJson1.ts b/clients/client-appintegrations/src/protocols/Aws_restJson1.ts index 3dc6a456a0c9..43a87d4483b3 100644 --- a/clients/client-appintegrations/src/protocols/Aws_restJson1.ts +++ b/clients/client-appintegrations/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1607,17 +1607,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts index a93f5f5628b1..7d0a69833ebb 100644 --- a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1558,17 +1558,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts index 0801a39656ad..d51f39d16086 100644 --- a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2568,17 +2568,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-application-insights/src/protocols/Aws_json1_1.ts b/clients/client-application-insights/src/protocols/Aws_json1_1.ts index 9b8200285634..496597af59c2 100644 --- a/clients/client-application-insights/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-insights/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2378,17 +2378,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts b/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts index b5476d5dbbf4..066f7b0369b7 100644 --- a/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts +++ b/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -708,17 +708,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-apprunner/src/protocols/Aws_json1_0.ts b/clients/client-apprunner/src/protocols/Aws_json1_0.ts index 581a2b52fcaa..fd7331c3ded3 100644 --- a/clients/client-apprunner/src/protocols/Aws_json1_0.ts +++ b/clients/client-apprunner/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3254,17 +3254,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-appstream/src/protocols/Aws_json1_1.ts b/clients/client-appstream/src/protocols/Aws_json1_1.ts index cebcf7b90e8c..a231972079b0 100644 --- a/clients/client-appstream/src/protocols/Aws_json1_1.ts +++ b/clients/client-appstream/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5894,17 +5894,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-appsync/package.json b/clients/client-appsync/package.json index c8003dfabba0..62a578d1bc8f 100644 --- a/clients/client-appsync/package.json +++ b/clients/client-appsync/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-appsync/src/protocols/Aws_restJson1.ts b/clients/client-appsync/src/protocols/Aws_restJson1.ts index 819b86cf4ae0..4dcf7962b078 100644 --- a/clients/client-appsync/src/protocols/Aws_restJson1.ts +++ b/clients/client-appsync/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5906,17 +5906,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts b/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts index 7e478fbc2011..6cde1d7d7e37 100644 --- a/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts +++ b/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -804,17 +804,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-athena/src/protocols/Aws_json1_1.ts b/clients/client-athena/src/protocols/Aws_json1_1.ts index 6b6ddb83649d..9b14719a450e 100644 --- a/clients/client-athena/src/protocols/Aws_json1_1.ts +++ b/clients/client-athena/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5800,17 +5800,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-auditmanager/src/protocols/Aws_restJson1.ts b/clients/client-auditmanager/src/protocols/Aws_restJson1.ts index 7be4ce2d93a7..d5f4e9aabc4f 100644 --- a/clients/client-auditmanager/src/protocols/Aws_restJson1.ts +++ b/clients/client-auditmanager/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6654,17 +6654,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts index 69da3362b0a6..4eced4795dbd 100644 --- a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts +++ b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -935,17 +935,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-auto-scaling/src/protocols/Aws_query.ts b/clients/client-auto-scaling/src/protocols/Aws_query.ts index 77decf81e034..791126d18f27 100644 --- a/clients/client-auto-scaling/src/protocols/Aws_query.ts +++ b/clients/client-auto-scaling/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -11232,17 +11232,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -11286,7 +11275,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts index 5e44a88eeae3..7a06adc47e62 100644 --- a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts +++ b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2236,17 +2236,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-backup/src/protocols/Aws_restJson1.ts b/clients/client-backup/src/protocols/Aws_restJson1.ts index 250101fa4018..a68925d2beae 100644 --- a/clients/client-backup/src/protocols/Aws_restJson1.ts +++ b/clients/client-backup/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7637,17 +7637,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-backupstorage/src/protocols/Aws_restJson1.ts b/clients/client-backupstorage/src/protocols/Aws_restJson1.ts index ba86462ca3ee..489d6164ccd8 100644 --- a/clients/client-backupstorage/src/protocols/Aws_restJson1.ts +++ b/clients/client-backupstorage/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -16,7 +17,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1209,17 +1209,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-batch/src/protocols/Aws_restJson1.ts b/clients/client-batch/src/protocols/Aws_restJson1.ts index 3333c5622017..db661974627d 100644 --- a/clients/client-batch/src/protocols/Aws_restJson1.ts +++ b/clients/client-batch/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2583,17 +2583,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-billingconductor/src/protocols/Aws_restJson1.ts b/clients/client-billingconductor/src/protocols/Aws_restJson1.ts index d60ba012987f..45b5a09f5e13 100644 --- a/clients/client-billingconductor/src/protocols/Aws_restJson1.ts +++ b/clients/client-billingconductor/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3520,17 +3520,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-braket/src/protocols/Aws_restJson1.ts b/clients/client-braket/src/protocols/Aws_restJson1.ts index 0debe57d973d..03fee49cbab7 100644 --- a/clients/client-braket/src/protocols/Aws_restJson1.ts +++ b/clients/client-braket/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1575,17 +1575,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-budgets/src/protocols/Aws_json1_1.ts b/clients/client-budgets/src/protocols/Aws_json1_1.ts index ea5257bae57b..f655e548e570 100644 --- a/clients/client-budgets/src/protocols/Aws_json1_1.ts +++ b/clients/client-budgets/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2742,17 +2742,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts index 4c4322ffbb80..ac9849b88642 100644 --- a/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3423,17 +3423,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts index e2054ea0e40b..84a43459833f 100644 --- a/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2605,17 +2605,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts index 5f053a515274..559e6cf120d7 100644 --- a/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1884,17 +1884,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts index 1d0f8f7924bf..6341c955c28f 100644 --- a/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5644,17 +5644,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts index 6bfff2d9331c..22957b267f91 100644 --- a/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -10498,17 +10498,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-chime/src/protocols/Aws_restJson1.ts b/clients/client-chime/src/protocols/Aws_restJson1.ts index 04ad983121da..7bfa0f81ad53 100644 --- a/clients/client-chime/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -20671,17 +20671,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts b/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts index 8a970476a3a0..0dddf6f27c4a 100644 --- a/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts +++ b/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4287,17 +4287,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloud9/src/protocols/Aws_json1_1.ts b/clients/client-cloud9/src/protocols/Aws_json1_1.ts index 69fdf90732f6..141560709094 100644 --- a/clients/client-cloud9/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloud9/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1323,17 +1323,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts index 11c61991a881..ce9f045b2d23 100644 --- a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts +++ b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1334,17 +1334,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts b/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts index c6896e46e0bb..1b3f9b78ac0e 100644 --- a/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts +++ b/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -8753,17 +8753,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudformation/src/protocols/Aws_query.ts b/clients/client-cloudformation/src/protocols/Aws_query.ts index c0f0d805e0a5..75b34560f82c 100644 --- a/clients/client-cloudformation/src/protocols/Aws_query.ts +++ b/clients/client-cloudformation/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -11069,17 +11069,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudfront/package.json b/clients/client-cloudfront/package.json index 9bab693fa555..47abd1959a72 100644 --- a/clients/client-cloudfront/package.json +++ b/clients/client-cloudfront/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-cloudfront/src/protocols/Aws_restXml.ts b/clients/client-cloudfront/src/protocols/Aws_restXml.ts index d523d4d5d5de..9fb91f6f1229 100644 --- a/clients/client-cloudfront/src/protocols/Aws_restXml.ts +++ b/clients/client-cloudfront/src/protocols/Aws_restXml.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -19941,17 +19941,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -19973,7 +19962,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts index e60f518964e5..e315024caa00 100644 --- a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1505,17 +1505,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts index 75e49bd4bb59..f8a3bc170bc1 100644 --- a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts @@ -1,11 +1,11 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1525,17 +1525,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts b/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts index b44fb450b5ca..5d7f2b5a2d17 100644 --- a/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts +++ b/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -380,17 +380,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudsearch/src/protocols/Aws_query.ts b/clients/client-cloudsearch/src/protocols/Aws_query.ts index bf2828f13547..1898f07084f8 100644 --- a/clients/client-cloudsearch/src/protocols/Aws_query.ts +++ b/clients/client-cloudsearch/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -4328,17 +4328,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -4382,7 +4371,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts b/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts index c6a4ffe88b4f..ab4c31ae161d 100644 --- a/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -259,17 +259,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts index 771bd5ba07fe..b80df41f0241 100644 --- a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6350,17 +6350,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts index 42e6bcc371e0..5f4f8de381e4 100644 --- a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4662,17 +4662,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts index 817e6759fc62..7b92cbeb6084 100644 --- a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectString as __expectString, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4123,17 +4123,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cloudwatch/src/protocols/Aws_query.ts b/clients/client-cloudwatch/src/protocols/Aws_query.ts index 17a279c0d25e..ab184ba0eacf 100644 --- a/clients/client-cloudwatch/src/protocols/Aws_query.ts +++ b/clients/client-cloudwatch/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -6685,17 +6685,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -6739,7 +6728,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-codeartifact/src/protocols/Aws_restJson1.ts b/clients/client-codeartifact/src/protocols/Aws_restJson1.ts index 2a8b9d5a8366..cf033e91cb64 100644 --- a/clients/client-codeartifact/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeartifact/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -19,7 +20,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4074,17 +4074,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codebuild/src/protocols/Aws_json1_1.ts b/clients/client-codebuild/src/protocols/Aws_json1_1.ts index f10f15c24884..f1ab60bb4ae2 100644 --- a/clients/client-codebuild/src/protocols/Aws_json1_1.ts +++ b/clients/client-codebuild/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4018,17 +4018,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts b/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts index 5d8bcee9cf01..a775da6b431f 100644 --- a/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts +++ b/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2945,17 +2945,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codecommit/src/protocols/Aws_json1_1.ts b/clients/client-codecommit/src/protocols/Aws_json1_1.ts index e4c04436568f..67b4ff865a75 100644 --- a/clients/client-codecommit/src/protocols/Aws_json1_1.ts +++ b/clients/client-codecommit/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -12534,17 +12534,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts index 1cbbf2db16ba..d41de96a94e9 100644 --- a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts +++ b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6886,17 +6886,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts b/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts index dd7bf4373a2e..15bdcf372d42 100644 --- a/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1686,17 +1686,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts b/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts index cb317e675d6b..364a448ed849 100644 --- a/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1522,17 +1522,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codeguruprofiler/package.json b/clients/client-codeguruprofiler/package.json index 3f69bea5e014..fdf8679e63f7 100644 --- a/clients/client-codeguruprofiler/package.json +++ b/clients/client-codeguruprofiler/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts b/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts index eaf2bd656196..93ccf91918c5 100644 --- a/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2672,17 +2672,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts index cb87f157a757..0defba08f9cd 100644 --- a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4241,17 +4241,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts index 144f59b92440..2e0aea1410cb 100644 --- a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts +++ b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts @@ -1,11 +1,11 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -943,17 +943,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts b/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts index 00af3765fc5b..887139cc0eda 100644 --- a/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts +++ b/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1349,17 +1349,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-codestar/src/protocols/Aws_json1_1.ts b/clients/client-codestar/src/protocols/Aws_json1_1.ts index 9ce5e0b758f1..715cd49110f0 100644 --- a/clients/client-codestar/src/protocols/Aws_json1_1.ts +++ b/clients/client-codestar/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1691,17 +1691,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts index f03e9c15f428..f485cb085335 100644 --- a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -10581,17 +10581,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts index 8b7f18e61b5f..ae55fefc8ee8 100644 --- a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2200,17 +2200,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts b/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts index 24e9d990d0af..21cde33c1100 100644 --- a/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts +++ b/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2112,17 +2112,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-comprehend/src/protocols/Aws_json1_1.ts b/clients/client-comprehend/src/protocols/Aws_json1_1.ts index 72d1340abe3f..7b933b84a32f 100644 --- a/clients/client-comprehend/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehend/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -9463,17 +9463,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts index 270ac5b6d1a0..3f20f033ec10 100644 --- a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2973,17 +2973,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts index 18b7641ed58d..52ddf446e86a 100644 --- a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts +++ b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3135,17 +3135,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-config-service/src/protocols/Aws_json1_1.ts b/clients/client-config-service/src/protocols/Aws_json1_1.ts index 323bc3fc28ce..1b4db40dd285 100644 --- a/clients/client-config-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-config-service/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -9506,17 +9506,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts b/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts index db87a80e177c..fd7231d300af 100644 --- a/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -251,17 +251,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-connect/src/protocols/Aws_restJson1.ts b/clients/client-connect/src/protocols/Aws_restJson1.ts index 76efaaffa16a..833eb3b60f66 100644 --- a/clients/client-connect/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -20,7 +21,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -20717,17 +20717,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts b/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts index 8058df710cd9..009b1938e56e 100644 --- a/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2351,17 +2351,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-connectcases/src/protocols/Aws_restJson1.ts b/clients/client-connectcases/src/protocols/Aws_restJson1.ts index 3e24a01b79a9..fad4913f4955 100644 --- a/clients/client-connectcases/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectcases/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3362,17 +3362,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts b/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts index 4bb623546e1e..e7efa5545c09 100644 --- a/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -911,17 +911,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-controltower/src/protocols/Aws_restJson1.ts b/clients/client-controltower/src/protocols/Aws_restJson1.ts index bdd14604d768..7ee1a579283d 100644 --- a/clients/client-controltower/src/protocols/Aws_restJson1.ts +++ b/clients/client-controltower/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -571,17 +571,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts index d81089447baa..67b15bbbeeed 100644 --- a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts @@ -1,11 +1,11 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -398,17 +398,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts index d6f178cdb0d1..94b7301c70af 100644 --- a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectString as __expectString, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3821,17 +3821,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts b/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts index 7f3b79f839b6..d05773886a14 100644 --- a/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts +++ b/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -19,7 +20,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5496,17 +5496,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts index b522ca9dba84..78dded70133f 100644 --- a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts @@ -1,12 +1,12 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, take, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1615,17 +1615,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts index 6cf363a9adf5..0772b0f6b130 100644 --- a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6562,17 +6562,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-databrew/src/protocols/Aws_restJson1.ts b/clients/client-databrew/src/protocols/Aws_restJson1.ts index e11fcd6a2fb1..f3df20a66589 100644 --- a/clients/client-databrew/src/protocols/Aws_restJson1.ts +++ b/clients/client-databrew/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4466,17 +4466,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-dataexchange/src/protocols/Aws_restJson1.ts b/clients/client-dataexchange/src/protocols/Aws_restJson1.ts index 112a8f96d6bd..86125d5bc42e 100644 --- a/clients/client-dataexchange/src/protocols/Aws_restJson1.ts +++ b/clients/client-dataexchange/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, convertMap, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -3295,17 +3295,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-datasync/src/protocols/Aws_json1_1.ts b/clients/client-datasync/src/protocols/Aws_json1_1.ts index d3fd08e2cbf8..15211b43dbd6 100644 --- a/clients/client-datasync/src/protocols/Aws_json1_1.ts +++ b/clients/client-datasync/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -4872,17 +4872,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-dax/src/protocols/Aws_json1_1.ts b/clients/client-dax/src/protocols/Aws_json1_1.ts index 8ffa77e55b3d..6f0d428951bb 100644 --- a/clients/client-dax/src/protocols/Aws_json1_1.ts +++ b/clients/client-dax/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2445,17 +2445,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-detective/src/protocols/Aws_restJson1.ts b/clients/client-detective/src/protocols/Aws_restJson1.ts index 95bfdd3f9c0a..faa6cceba929 100644 --- a/clients/client-detective/src/protocols/Aws_restJson1.ts +++ b/clients/client-detective/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2531,17 +2531,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-device-farm/src/protocols/Aws_json1_1.ts b/clients/client-device-farm/src/protocols/Aws_json1_1.ts index d52f3b597a30..8a2b622a9d4b 100644 --- a/clients/client-device-farm/src/protocols/Aws_json1_1.ts +++ b/clients/client-device-farm/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -7248,17 +7248,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-devops-guru/src/protocols/Aws_restJson1.ts b/clients/client-devops-guru/src/protocols/Aws_restJson1.ts index 72d543a4045c..0fb6a0381c51 100644 --- a/clients/client-devops-guru/src/protocols/Aws_restJson1.ts +++ b/clients/client-devops-guru/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4050,17 +4050,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts index 66cd6abaeb31..8e8d64bc3131 100644 --- a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4865,17 +4865,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-directory-service/src/protocols/Aws_json1_1.ts b/clients/client-directory-service/src/protocols/Aws_json1_1.ts index 2b392b8f8dab..bd3dbfcf830f 100644 --- a/clients/client-directory-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-directory-service/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6812,17 +6812,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-dlm/src/protocols/Aws_restJson1.ts b/clients/client-dlm/src/protocols/Aws_restJson1.ts index 51f1f4a359f5..249145c56d43 100644 --- a/clients/client-dlm/src/protocols/Aws_restJson1.ts +++ b/clients/client-dlm/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -981,17 +981,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts b/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts index 545ec3e0a761..9788bc248e4c 100644 --- a/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts +++ b/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1377,17 +1377,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-docdb/src/protocols/Aws_query.ts b/clients/client-docdb/src/protocols/Aws_query.ts index fefa2d4f7988..caa2c6e9fe3c 100644 --- a/clients/client-docdb/src/protocols/Aws_query.ts +++ b/clients/client-docdb/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -9627,17 +9627,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -9681,7 +9670,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-drs/src/protocols/Aws_restJson1.ts b/clients/client-drs/src/protocols/Aws_restJson1.ts index c848dd268154..29beabbc6f8c 100644 --- a/clients/client-drs/src/protocols/Aws_restJson1.ts +++ b/clients/client-drs/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4975,17 +4975,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts index ac570d0a015f..7c30fceafb48 100644 --- a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -604,17 +604,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts index e75ffd561fc2..31e873810492 100644 --- a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7126,17 +7126,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ebs/src/protocols/Aws_restJson1.ts b/clients/client-ebs/src/protocols/Aws_restJson1.ts index 5c400f8a7120..f2d0415240e5 100644 --- a/clients/client-ebs/src/protocols/Aws_restJson1.ts +++ b/clients/client-ebs/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -20,7 +21,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -842,17 +842,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts index b4d1085dd255..0e938224c48a 100644 --- a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts @@ -1,11 +1,11 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -402,17 +402,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ec2/src/protocols/Aws_ec2.ts b/clients/client-ec2/src/protocols/Aws_ec2.ts index e4ddf518692c..09ef6e46688e 100644 --- a/clients/client-ec2/src/protocols/Aws_ec2.ts +++ b/clients/client-ec2/src/protocols/Aws_ec2.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, expectNonNull as __expectNonNull, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -93514,17 +93514,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts index 3605bd9d376c..c9469502c9a1 100644 --- a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2562,17 +2562,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ecr/src/protocols/Aws_json1_1.ts b/clients/client-ecr/src/protocols/Aws_json1_1.ts index 74e3d868f179..1caa2065e77f 100644 --- a/clients/client-ecr/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4436,17 +4436,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ecs/src/protocols/Aws_json1_1.ts b/clients/client-ecs/src/protocols/Aws_json1_1.ts index 79c4b3534672..1b1342d3ea37 100644 --- a/clients/client-ecs/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecs/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6177,17 +6177,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-efs/src/protocols/Aws_restJson1.ts b/clients/client-efs/src/protocols/Aws_restJson1.ts index 6a1435476a6d..55a924f85de7 100644 --- a/clients/client-efs/src/protocols/Aws_restJson1.ts +++ b/clients/client-efs/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -19,7 +20,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3686,17 +3686,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-eks/src/protocols/Aws_restJson1.ts b/clients/client-eks/src/protocols/Aws_restJson1.ts index 042157955d7d..80358e5c2b42 100644 --- a/clients/client-eks/src/protocols/Aws_restJson1.ts +++ b/clients/client-eks/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3903,17 +3903,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts index ee7f3293cff3..ad0d3a98467b 100644 --- a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts +++ b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -7619,17 +7619,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -7673,7 +7662,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts b/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts index a5fff84ce509..e14b301d2c6c 100644 --- a/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -614,17 +614,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts index e84f509e7c5e..4927eb2df5d8 100644 --- a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -7216,17 +7216,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -7270,7 +7259,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts index 254630b26f6f..66dde5816a35 100644 --- a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -5009,17 +5009,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -5063,7 +5052,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts b/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts index 9198c9f70492..a48433cd2205 100644 --- a/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1898,17 +1898,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-elasticache/src/protocols/Aws_query.ts b/clients/client-elasticache/src/protocols/Aws_query.ts index f2078a9fd630..11542c9c82de 100644 --- a/clients/client-elasticache/src/protocols/Aws_query.ts +++ b/clients/client-elasticache/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -13298,17 +13298,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -13352,7 +13341,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts b/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts index c10c28bf1d09..c7260ec73b9c 100644 --- a/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5684,17 +5684,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-emr-containers/src/protocols/Aws_restJson1.ts b/clients/client-emr-containers/src/protocols/Aws_restJson1.ts index 0e16066f1157..654085e73686 100644 --- a/clients/client-emr-containers/src/protocols/Aws_restJson1.ts +++ b/clients/client-emr-containers/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2257,17 +2257,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts b/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts index bdc3aee5b59f..45f458ea9ab4 100644 --- a/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts +++ b/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1759,17 +1759,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-emr/src/protocols/Aws_json1_1.ts b/clients/client-emr/src/protocols/Aws_json1_1.ts index ea17497968cb..814793b1a577 100644 --- a/clients/client-emr/src/protocols/Aws_json1_1.ts +++ b/clients/client-emr/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5280,17 +5280,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts index aa0dac7b0987..58dff7d1d947 100644 --- a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts +++ b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5110,17 +5110,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-evidently/src/protocols/Aws_restJson1.ts b/clients/client-evidently/src/protocols/Aws_restJson1.ts index 77fcfc5f215a..aa888a72b6b3 100644 --- a/clients/client-evidently/src/protocols/Aws_restJson1.ts +++ b/clients/client-evidently/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -21,7 +22,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -4333,17 +4333,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-finspace-data/src/protocols/Aws_restJson1.ts b/clients/client-finspace-data/src/protocols/Aws_restJson1.ts index da6540286533..5b755bc4870e 100644 --- a/clients/client-finspace-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-finspace-data/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3247,17 +3247,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-finspace/src/protocols/Aws_restJson1.ts b/clients/client-finspace/src/protocols/Aws_restJson1.ts index 89b9fa1dc7cb..b2c3fe732532 100644 --- a/clients/client-finspace/src/protocols/Aws_restJson1.ts +++ b/clients/client-finspace/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4018,17 +4018,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-firehose/src/protocols/Aws_json1_1.ts b/clients/client-firehose/src/protocols/Aws_json1_1.ts index fd798b6bc71b..1a3622dc3026 100644 --- a/clients/client-firehose/src/protocols/Aws_json1_1.ts +++ b/clients/client-firehose/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1644,17 +1644,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-fis/src/protocols/Aws_restJson1.ts b/clients/client-fis/src/protocols/Aws_restJson1.ts index 8710be59b139..16acc5c2371f 100644 --- a/clients/client-fis/src/protocols/Aws_restJson1.ts +++ b/clients/client-fis/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1636,17 +1636,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-fms/src/protocols/Aws_json1_1.ts b/clients/client-fms/src/protocols/Aws_json1_1.ts index 4bcb93003fac..c41cc02f7041 100644 --- a/clients/client-fms/src/protocols/Aws_json1_1.ts +++ b/clients/client-fms/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3836,17 +3836,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-forecast/src/protocols/Aws_json1_1.ts b/clients/client-forecast/src/protocols/Aws_json1_1.ts index 265762a2c428..d179d6456846 100644 --- a/clients/client-forecast/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecast/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6149,17 +6149,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts index 07c37d9faa04..12bae6e394ed 100644 --- a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, limitedParseDouble as __limitedParseDouble, @@ -8,7 +9,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -340,17 +340,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts index 4c0ae6cf8325..309bc3323b39 100644 --- a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts +++ b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, @@ -8,7 +9,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6625,17 +6625,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-fsx/src/protocols/Aws_json1_1.ts b/clients/client-fsx/src/protocols/Aws_json1_1.ts index 5747a3f470c8..172dc56dcabd 100644 --- a/clients/client-fsx/src/protocols/Aws_json1_1.ts +++ b/clients/client-fsx/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5210,17 +5210,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-gamelift/src/protocols/Aws_json1_1.ts b/clients/client-gamelift/src/protocols/Aws_json1_1.ts index 6ad0d97e5f1f..b065cd8e4e4e 100644 --- a/clients/client-gamelift/src/protocols/Aws_json1_1.ts +++ b/clients/client-gamelift/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -9938,17 +9938,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-gamesparks/src/protocols/Aws_restJson1.ts b/clients/client-gamesparks/src/protocols/Aws_restJson1.ts index 87ca3aae1356..e8f89bdf8141 100644 --- a/clients/client-gamesparks/src/protocols/Aws_restJson1.ts +++ b/clients/client-gamesparks/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3410,17 +3410,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-glacier/src/protocols/Aws_restJson1.ts b/clients/client-glacier/src/protocols/Aws_restJson1.ts index a01e86f36166..0ecea7326a95 100644 --- a/clients/client-glacier/src/protocols/Aws_restJson1.ts +++ b/clients/client-glacier/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -17,7 +18,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3203,17 +3203,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts index 5100a6e11113..c74269c9247d 100644 --- a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts +++ b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4605,17 +4605,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-glue/src/protocols/Aws_json1_1.ts b/clients/client-glue/src/protocols/Aws_json1_1.ts index 46cab57e6d17..839447181233 100644 --- a/clients/client-glue/src/protocols/Aws_json1_1.ts +++ b/clients/client-glue/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -20601,17 +20601,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-grafana/src/protocols/Aws_restJson1.ts b/clients/client-grafana/src/protocols/Aws_restJson1.ts index 39b75af8c36b..a49125877dc0 100644 --- a/clients/client-grafana/src/protocols/Aws_restJson1.ts +++ b/clients/client-grafana/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2017,17 +2017,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-greengrass/src/protocols/Aws_restJson1.ts b/clients/client-greengrass/src/protocols/Aws_restJson1.ts index 03289b544cdb..cef4706371c4 100644 --- a/clients/client-greengrass/src/protocols/Aws_restJson1.ts +++ b/clients/client-greengrass/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -8159,17 +8159,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts b/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts index e69a907ba5e3..ef548ff8dcc2 100644 --- a/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -20,7 +21,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3503,17 +3503,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-groundstation/src/protocols/Aws_restJson1.ts b/clients/client-groundstation/src/protocols/Aws_restJson1.ts index 624c45360b2a..a77b7d6b02f2 100644 --- a/clients/client-groundstation/src/protocols/Aws_restJson1.ts +++ b/clients/client-groundstation/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -19,7 +20,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3567,17 +3567,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-guardduty/src/protocols/Aws_restJson1.ts b/clients/client-guardduty/src/protocols/Aws_restJson1.ts index b4268a7e6ee2..c5a358dd4f1b 100644 --- a/clients/client-guardduty/src/protocols/Aws_restJson1.ts +++ b/clients/client-guardduty/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -8629,17 +8629,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-health/src/protocols/Aws_json1_1.ts b/clients/client-health/src/protocols/Aws_json1_1.ts index 8c13deaa831e..0932bf329d3f 100644 --- a/clients/client-health/src/protocols/Aws_json1_1.ts +++ b/clients/client-health/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1349,17 +1349,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-healthlake/src/protocols/Aws_json1_0.ts b/clients/client-healthlake/src/protocols/Aws_json1_0.ts index 9aaaa413efde..16658874caed 100644 --- a/clients/client-healthlake/src/protocols/Aws_json1_0.ts +++ b/clients/client-healthlake/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1383,17 +1383,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-honeycode/src/protocols/Aws_restJson1.ts b/clients/client-honeycode/src/protocols/Aws_restJson1.ts index 86e5945944ad..db686e294597 100644 --- a/clients/client-honeycode/src/protocols/Aws_restJson1.ts +++ b/clients/client-honeycode/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1912,17 +1912,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iam/src/protocols/Aws_query.ts b/clients/client-iam/src/protocols/Aws_query.ts index 6077affeca2c..761cf43f992b 100644 --- a/clients/client-iam/src/protocols/Aws_query.ts +++ b/clients/client-iam/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -18542,17 +18542,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-identitystore/src/protocols/Aws_json1_1.ts b/clients/client-identitystore/src/protocols/Aws_json1_1.ts index 23c75817df1b..923c71a54900 100644 --- a/clients/client-identitystore/src/protocols/Aws_json1_1.ts +++ b/clients/client-identitystore/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, take, withBaseException, @@ -10,7 +11,6 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1823,17 +1823,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts index 705dd8731a11..f6e2d1cafb7c 100644 --- a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts +++ b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -6483,17 +6483,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-inspector/src/protocols/Aws_json1_1.ts b/clients/client-inspector/src/protocols/Aws_json1_1.ts index 93cd02c4c1db..6558c0234104 100644 --- a/clients/client-inspector/src/protocols/Aws_json1_1.ts +++ b/clients/client-inspector/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3570,17 +3570,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-inspector2/src/protocols/Aws_restJson1.ts b/clients/client-inspector2/src/protocols/Aws_restJson1.ts index 7623e38af33a..d6007ce7ba37 100644 --- a/clients/client-inspector2/src/protocols/Aws_restJson1.ts +++ b/clients/client-inspector2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -20,7 +21,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4780,17 +4780,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts b/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts index b134e67195ec..c6c72b31c7b8 100644 --- a/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts +++ b/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1291,17 +1291,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts b/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts index 8b315d8f9b00..ebc9a2019f97 100644 --- a/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1370,17 +1370,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts b/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts index ae74154c50cc..dfdffe161296 100644 --- a/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1618,17 +1618,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iot-data-plane/package.json b/clients/client-iot-data-plane/package.json index 171a7e1a174f..9ee0aa3f1ad8 100644 --- a/clients/client-iot-data-plane/package.json +++ b/clients/client-iot-data-plane/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts b/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts index adc867adc12e..0917d8ad1398 100644 --- a/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -918,17 +918,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts b/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts index 2ba612b6b45b..1d9460ad73d0 100644 --- a/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1454,17 +1454,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iot-events/src/protocols/Aws_restJson1.ts b/clients/client-iot-events/src/protocols/Aws_restJson1.ts index 50812fe2b11d..bc15c5338003 100644 --- a/clients/client-iot-events/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3166,17 +3166,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts b/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts index 9c9daf5a445f..7c2510278c77 100644 --- a/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -566,17 +566,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts b/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts index 691ddb9ae6f9..5c48a69b0c20 100644 --- a/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2240,17 +2240,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iot-wireless/package.json b/clients/client-iot-wireless/package.json index 3fbf980226f3..274d5ecb8954 100644 --- a/clients/client-iot-wireless/package.json +++ b/clients/client-iot-wireless/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts b/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts index dd4b6a6463ac..3b7c1409b405 100644 --- a/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -21,7 +22,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -11077,17 +11077,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iot/src/protocols/Aws_restJson1.ts b/clients/client-iot/src/protocols/Aws_restJson1.ts index 28298ceccf8b..4f5182969717 100644 --- a/clients/client-iot/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -19,7 +20,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -26494,17 +26494,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts b/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts index 3962f649cb2f..48c0856fcdc8 100644 --- a/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4014,17 +4014,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts index 7cb30c382040..2567db1a87ad 100644 --- a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1478,17 +1478,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts b/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts index 307de7a328eb..814845528ef2 100644 --- a/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -857,17 +857,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts index fdc5af911634..671866e70664 100644 --- a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts +++ b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5177,17 +5177,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts index 3f67d38bd9c9..f36c1374611c 100644 --- a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -684,17 +684,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts b/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts index 4cf8041d6221..b52f96961204 100644 --- a/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -8572,17 +8572,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts index 8aa441dc1f32..8c893f918bab 100644 --- a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3256,17 +3256,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts b/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts index 1d02966cf2ac..985cbfdaf8b8 100644 --- a/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts +++ b/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -19,7 +20,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -4646,17 +4646,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts b/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts index 647a4f11edda..4d567956caa3 100644 --- a/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1610,17 +1610,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ivs/src/protocols/Aws_restJson1.ts b/clients/client-ivs/src/protocols/Aws_restJson1.ts index d4a4d0b58421..6fde628b5e33 100644 --- a/clients/client-ivs/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivs/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2797,17 +2797,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ivschat/src/protocols/Aws_restJson1.ts b/clients/client-ivschat/src/protocols/Aws_restJson1.ts index b984a24cf41d..6d05c1fa6499 100644 --- a/clients/client-ivschat/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivschat/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1847,17 +1847,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kafka/src/protocols/Aws_restJson1.ts b/clients/client-kafka/src/protocols/Aws_restJson1.ts index 91ce0a1dfda3..a8b91dbbdc94 100644 --- a/clients/client-kafka/src/protocols/Aws_restJson1.ts +++ b/clients/client-kafka/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5703,17 +5703,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts b/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts index 2b90463d86a8..913617dcf3e4 100644 --- a/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1695,17 +1695,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts b/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts index dd8ecf323d88..e4882fc50113 100644 --- a/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts +++ b/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1044,17 +1044,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kendra/src/protocols/Aws_json1_1.ts b/clients/client-kendra/src/protocols/Aws_json1_1.ts index d963a42bbee5..9401fad5811b 100644 --- a/clients/client-kendra/src/protocols/Aws_json1_1.ts +++ b/clients/client-kendra/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -19,7 +20,6 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7523,17 +7523,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts index 8c9e2b835eb3..5f2415b79d22 100644 --- a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts +++ b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1308,17 +1308,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts index 5cd94967bf04..25e57645273f 100644 --- a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3367,17 +3367,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts index b8f88638b026..2842079a0a4c 100644 --- a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2041,17 +2041,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts index 65f1ab4fe960..fe157893426f 100644 --- a/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -16,7 +17,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -965,17 +965,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts index 51cec8294df3..a4f589c00c92 100644 --- a/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, map, @@ -11,7 +12,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -260,17 +260,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts index ff2aaa2c2793..9257fd139a6e 100644 --- a/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -347,17 +347,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts index 3745bec105ac..0f43432920af 100644 --- a/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, map, @@ -8,7 +9,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -191,17 +191,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts index 553d8f8e068b..08fb6078de13 100644 --- a/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3080,17 +3080,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kinesis/src/protocols/Aws_json1_1.ts b/clients/client-kinesis/src/protocols/Aws_json1_1.ts index 43c6c7f202f1..37b8abc6fb0a 100644 --- a/clients/client-kinesis/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3071,17 +3071,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-kms/src/protocols/Aws_json1_1.ts b/clients/client-kms/src/protocols/Aws_json1_1.ts index 9b15ec50dc9a..25e76b1a6e71 100644 --- a/clients/client-kms/src/protocols/Aws_json1_1.ts +++ b/clients/client-kms/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5503,17 +5503,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-lakeformation/src/protocols/Aws_restJson1.ts b/clients/client-lakeformation/src/protocols/Aws_restJson1.ts index 775430b7d98d..d96649121a89 100644 --- a/clients/client-lakeformation/src/protocols/Aws_restJson1.ts +++ b/clients/client-lakeformation/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -17,7 +18,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -5049,17 +5049,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-lambda/package.json b/clients/client-lambda/package.json index d141f1a54fed..43fa94adee1e 100644 --- a/clients/client-lambda/package.json +++ b/clients/client-lambda/package.json @@ -52,6 +52,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-lambda/src/protocols/Aws_restJson1.ts b/clients/client-lambda/src/protocols/Aws_restJson1.ts index a086c6d26650..4a322cefa9a9 100644 --- a/clients/client-lambda/src/protocols/Aws_restJson1.ts +++ b/clients/client-lambda/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -22,7 +23,6 @@ import { EventStreamSerdeContext as __EventStreamSerdeContext, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -8251,17 +8251,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts b/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts index 0db79f19f999..c39f45d78e3a 100644 --- a/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4432,17 +4432,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts index bec037615ba7..05c79b971f20 100644 --- a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -20,7 +21,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -10751,17 +10751,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts b/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts index e8c14af56b67..a0bf45665e9a 100644 --- a/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -17,7 +18,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -937,17 +937,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); 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 676de3851373..798ca371574d 100644 --- a/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -18,7 +19,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1557,17 +1557,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts b/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts index 4fac14d30799..457503ae9f3a 100644 --- a/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts +++ b/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -468,17 +468,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts b/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts index ad3f3d0108b0..7a546acd3772 100644 --- a/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts +++ b/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1314,17 +1314,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-license-manager/src/protocols/Aws_json1_1.ts b/clients/client-license-manager/src/protocols/Aws_json1_1.ts index cb7c78038503..d1eb0a4ed21a 100644 --- a/clients/client-license-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-license-manager/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4973,17 +4973,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-lightsail/src/protocols/Aws_json1_1.ts b/clients/client-lightsail/src/protocols/Aws_json1_1.ts index 4acd61393ae0..aa08ef9093e1 100644 --- a/clients/client-lightsail/src/protocols/Aws_json1_1.ts +++ b/clients/client-lightsail/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -16427,17 +16427,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-location/package.json b/clients/client-location/package.json index ae654cd8c4d7..69aa21cd95bd 100644 --- a/clients/client-location/package.json +++ b/clients/client-location/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-location/src/protocols/Aws_restJson1.ts b/clients/client-location/src/protocols/Aws_restJson1.ts index 66849f75d956..a2cccd5cca7e 100644 --- a/clients/client-location/src/protocols/Aws_restJson1.ts +++ b/clients/client-location/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -7070,17 +7070,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts index a06ad8f14aca..f29a00900dce 100644 --- a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts +++ b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3375,17 +3375,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts b/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts index fa794454cca0..353756a7fa5a 100644 --- a/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts +++ b/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3571,17 +3571,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts b/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts index 37f125b7e826..03e66d0bdc06 100644 --- a/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts +++ b/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2589,17 +2589,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-m2/src/protocols/Aws_restJson1.ts b/clients/client-m2/src/protocols/Aws_restJson1.ts index 8ac3af437efa..9608b3cf95e2 100644 --- a/clients/client-m2/src/protocols/Aws_restJson1.ts +++ b/clients/client-m2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3777,17 +3777,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts index dd65045d4490..5d641e241c73 100644 --- a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts +++ b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2620,17 +2620,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-macie/src/protocols/Aws_json1_1.ts b/clients/client-macie/src/protocols/Aws_json1_1.ts index a2de3a6ffbe9..b5920529c190 100644 --- a/clients/client-macie/src/protocols/Aws_json1_1.ts +++ b/clients/client-macie/src/protocols/Aws_json1_1.ts @@ -1,11 +1,11 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -627,17 +627,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-macie2/src/protocols/Aws_restJson1.ts b/clients/client-macie2/src/protocols/Aws_restJson1.ts index 07c77e33ad7f..7c83fee512e9 100644 --- a/clients/client-macie2/src/protocols/Aws_restJson1.ts +++ b/clients/client-macie2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -10304,17 +10304,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts b/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts index 4a56c71c4f47..1648300d9825 100644 --- a/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts +++ b/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3036,17 +3036,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts index f173b76b78a4..5fd6cc9fd6b8 100644 --- a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts +++ b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1329,17 +1329,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts index 014d643c4417..580da378ebb7 100644 --- a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts @@ -1,12 +1,12 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, take, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -202,17 +202,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts index 9729b5587814..04da23dcdee0 100644 --- a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -206,17 +206,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts index 40ba4f1099ea..ec783c02b870 100644 --- a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -818,17 +818,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts b/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts index 60bd23255405..5e88687af272 100644 --- a/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6522,17 +6522,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts b/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts index 49223126a2a2..96fde57069ab 100644 --- a/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -8591,17 +8591,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-medialive/src/protocols/Aws_restJson1.ts b/clients/client-medialive/src/protocols/Aws_restJson1.ts index 21198d5cb187..298476866ed5 100644 --- a/clients/client-medialive/src/protocols/Aws_restJson1.ts +++ b/clients/client-medialive/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -21,7 +22,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -12353,17 +12353,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts b/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts index 0d5697edc2c8..d3589e5724bc 100644 --- a/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2282,17 +2282,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mediapackage/src/protocols/Aws_restJson1.ts b/clients/client-mediapackage/src/protocols/Aws_restJson1.ts index 3ac73b547766..342ac671ccc0 100644 --- a/clients/client-mediapackage/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2570,17 +2570,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts b/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts index facdcdbb5bc5..683e8be4373a 100644 --- a/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2724,17 +2724,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts b/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts index 0c2899964145..33d4e39c177c 100644 --- a/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -20,7 +21,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -562,17 +562,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mediastore/src/protocols/Aws_json1_1.ts b/clients/client-mediastore/src/protocols/Aws_json1_1.ts index 2f6e765e7e01..684ed7c9bb24 100644 --- a/clients/client-mediastore/src/protocols/Aws_json1_1.ts +++ b/clients/client-mediastore/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1756,17 +1756,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mediatailor/src/protocols/Aws_restJson1.ts b/clients/client-mediatailor/src/protocols/Aws_restJson1.ts index ae0bdd99d62f..b4cabe409b0a 100644 --- a/clients/client-mediatailor/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediatailor/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4028,17 +4028,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-memorydb/src/protocols/Aws_json1_1.ts b/clients/client-memorydb/src/protocols/Aws_json1_1.ts index 1f6219cf350d..c6629148502d 100644 --- a/clients/client-memorydb/src/protocols/Aws_json1_1.ts +++ b/clients/client-memorydb/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4644,17 +4644,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mgn/src/protocols/Aws_restJson1.ts b/clients/client-mgn/src/protocols/Aws_restJson1.ts index 9c5877baf244..3e80d9945b1a 100644 --- a/clients/client-mgn/src/protocols/Aws_restJson1.ts +++ b/clients/client-mgn/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -6140,17 +6140,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts b/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts index 36eb98f13ae3..5079c0d64608 100644 --- a/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts +++ b/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2963,17 +2963,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts index e3b490188255..f83e0e80bc3a 100644 --- a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts +++ b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1886,17 +1886,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts index a000606a3246..b24f680fc4d7 100644 --- a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts +++ b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -421,17 +421,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts b/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts index ca7248777293..333a271b0479 100644 --- a/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts +++ b/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2820,17 +2820,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts b/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts index 720f7ec2ccb5..9da2429f2ac7 100644 --- a/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts +++ b/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2456,17 +2456,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mobile/src/protocols/Aws_restJson1.ts b/clients/client-mobile/src/protocols/Aws_restJson1.ts index 3f8e4d3e5943..5ee06f068828 100644 --- a/clients/client-mobile/src/protocols/Aws_restJson1.ts +++ b/clients/client-mobile/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1046,17 +1046,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mq/src/protocols/Aws_restJson1.ts b/clients/client-mq/src/protocols/Aws_restJson1.ts index e0a9974dd398..7df76109b443 100644 --- a/clients/client-mq/src/protocols/Aws_restJson1.ts +++ b/clients/client-mq/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2655,17 +2655,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mturk/src/protocols/Aws_json1_1.ts b/clients/client-mturk/src/protocols/Aws_json1_1.ts index 6e5ad392d759..728f443f71e4 100644 --- a/clients/client-mturk/src/protocols/Aws_json1_1.ts +++ b/clients/client-mturk/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3257,17 +3257,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-mwaa/src/protocols/Aws_restJson1.ts b/clients/client-mwaa/src/protocols/Aws_restJson1.ts index 36b167c8fe0a..9e81dd735d9a 100644 --- a/clients/client-mwaa/src/protocols/Aws_restJson1.ts +++ b/clients/client-mwaa/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -1240,17 +1240,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-neptune/src/protocols/Aws_query.ts b/clients/client-neptune/src/protocols/Aws_query.ts index ab0657a7437e..24675c3b88d6 100644 --- a/clients/client-neptune/src/protocols/Aws_query.ts +++ b/clients/client-neptune/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -12758,17 +12758,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -12812,7 +12801,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts index 2de08c32f895..ecb92047a330 100644 --- a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts +++ b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3660,17 +3660,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-networkmanager/src/protocols/Aws_restJson1.ts b/clients/client-networkmanager/src/protocols/Aws_restJson1.ts index 7fbb63c03584..609018c38b40 100644 --- a/clients/client-networkmanager/src/protocols/Aws_restJson1.ts +++ b/clients/client-networkmanager/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -9377,17 +9377,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-nimble/src/protocols/Aws_restJson1.ts b/clients/client-nimble/src/protocols/Aws_restJson1.ts index 345c876159a0..40c66cc203fa 100644 --- a/clients/client-nimble/src/protocols/Aws_restJson1.ts +++ b/clients/client-nimble/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5565,17 +5565,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-oam/src/protocols/Aws_restJson1.ts b/clients/client-oam/src/protocols/Aws_restJson1.ts index 8f8f49974b02..4480a15fea07 100644 --- a/clients/client-oam/src/protocols/Aws_restJson1.ts +++ b/clients/client-oam/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1526,17 +1526,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-omics/src/protocols/Aws_restJson1.ts b/clients/client-omics/src/protocols/Aws_restJson1.ts index 3e3499d485e5..4d7eecd2f82c 100644 --- a/clients/client-omics/src/protocols/Aws_restJson1.ts +++ b/clients/client-omics/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -21,7 +22,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -8895,17 +8895,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-opensearch/src/protocols/Aws_restJson1.ts b/clients/client-opensearch/src/protocols/Aws_restJson1.ts index 3f6e05e7b5dd..03a7b777ac8e 100644 --- a/clients/client-opensearch/src/protocols/Aws_restJson1.ts +++ b/clients/client-opensearch/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6222,17 +6222,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts index 76cd102ccce5..e230af391cbe 100644 --- a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts +++ b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectString as __expectString, @@ -12,7 +13,6 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2733,17 +2733,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-opsworks/src/protocols/Aws_json1_1.ts b/clients/client-opsworks/src/protocols/Aws_json1_1.ts index ff060dcd46ae..32cf3a42b616 100644 --- a/clients/client-opsworks/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworks/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5248,17 +5248,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts index 4b1b305e86c8..4d6411020d94 100644 --- a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1712,17 +1712,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-organizations/src/protocols/Aws_json1_1.ts b/clients/client-organizations/src/protocols/Aws_json1_1.ts index f2ddeb910f95..34df7b3e5b71 100644 --- a/clients/client-organizations/src/protocols/Aws_json1_1.ts +++ b/clients/client-organizations/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6072,17 +6072,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-osis/src/protocols/Aws_restJson1.ts b/clients/client-osis/src/protocols/Aws_restJson1.ts index 2da898ee2611..e9ae3bebca79 100644 --- a/clients/client-osis/src/protocols/Aws_restJson1.ts +++ b/clients/client-osis/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1608,17 +1608,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-outposts/src/protocols/Aws_restJson1.ts b/clients/client-outposts/src/protocols/Aws_restJson1.ts index fe2f58ddbfc0..6fc473316f29 100644 --- a/clients/client-outposts/src/protocols/Aws_restJson1.ts +++ b/clients/client-outposts/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2613,17 +2613,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-panorama/src/protocols/Aws_restJson1.ts b/clients/client-panorama/src/protocols/Aws_restJson1.ts index 8a75fa4687b8..98a2d2ad5a20 100644 --- a/clients/client-panorama/src/protocols/Aws_restJson1.ts +++ b/clients/client-panorama/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3711,17 +3711,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts b/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts index 1da57228fa75..ff998bb1e1e2 100644 --- a/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1380,17 +1380,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts b/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts index 536a0bb04213..f1aa1217a874 100644 --- a/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts +++ b/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2002,17 +2002,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-personalize-events/src/protocols/Aws_restJson1.ts b/clients/client-personalize-events/src/protocols/Aws_restJson1.ts index 7b2f0087cb2b..c76fe94b1129 100644 --- a/clients/client-personalize-events/src/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-events/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -404,17 +404,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts b/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts index 38316f309628..fb3624264ee5 100644 --- a/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -278,17 +278,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-personalize/src/protocols/Aws_json1_1.ts b/clients/client-personalize/src/protocols/Aws_json1_1.ts index 5fb6f181589d..1960b415da0d 100644 --- a/clients/client-personalize/src/protocols/Aws_json1_1.ts +++ b/clients/client-personalize/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6324,17 +6324,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-pi/src/protocols/Aws_json1_1.ts b/clients/client-pi/src/protocols/Aws_json1_1.ts index 41e14aa25974..0c1ddfbc3a49 100644 --- a/clients/client-pi/src/protocols/Aws_json1_1.ts +++ b/clients/client-pi/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -730,17 +730,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts index 8929813232f1..bf59c2ca0d5b 100644 --- a/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4408,17 +4408,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts index bc440ecda26c..ed3908c6efa4 100644 --- a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts +++ b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4188,17 +4188,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts index 2ccee79c21f8..7544bee546ac 100644 --- a/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -934,17 +934,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-pinpoint/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint/src/protocols/Aws_restJson1.ts index c25c45972a41..12e20cf14875 100644 --- a/clients/client-pinpoint/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -14494,17 +14494,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-pipes/src/protocols/Aws_restJson1.ts b/clients/client-pipes/src/protocols/Aws_restJson1.ts index aec34e91f6f5..e8740688ca93 100644 --- a/clients/client-pipes/src/protocols/Aws_restJson1.ts +++ b/clients/client-pipes/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1534,17 +1534,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-polly/src/protocols/Aws_restJson1.ts b/clients/client-polly/src/protocols/Aws_restJson1.ts index 3baf534f093b..01d29312b7c3 100644 --- a/clients/client-polly/src/protocols/Aws_restJson1.ts +++ b/clients/client-polly/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -19,7 +20,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1369,17 +1369,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-pricing/src/protocols/Aws_json1_1.ts b/clients/client-pricing/src/protocols/Aws_json1_1.ts index 0332c98f6f04..838f050d14d7 100644 --- a/clients/client-pricing/src/protocols/Aws_json1_1.ts +++ b/clients/client-pricing/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, @@ -8,7 +9,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -578,17 +578,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts b/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts index 8806eba7689d..bcbc61d259e6 100644 --- a/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts +++ b/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2654,17 +2654,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-proton/src/protocols/Aws_json1_0.ts b/clients/client-proton/src/protocols/Aws_json1_0.ts index e57d2c8eada7..b68654076cdb 100644 --- a/clients/client-proton/src/protocols/Aws_json1_0.ts +++ b/clients/client-proton/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -8354,17 +8354,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts index 5de7f5b514f1..7012cff1f07f 100644 --- a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts +++ b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts @@ -1,13 +1,13 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, take, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -384,17 +384,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-qldb/src/protocols/Aws_restJson1.ts b/clients/client-qldb/src/protocols/Aws_restJson1.ts index 0e04cd98525d..c5dc36ceba54 100644 --- a/clients/client-qldb/src/protocols/Aws_restJson1.ts +++ b/clients/client-qldb/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1954,17 +1954,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-quicksight/src/protocols/Aws_restJson1.ts b/clients/client-quicksight/src/protocols/Aws_restJson1.ts index 699d79e0dcff..c4102fbbac3e 100644 --- a/clients/client-quicksight/src/protocols/Aws_restJson1.ts +++ b/clients/client-quicksight/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -20,7 +21,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -28310,17 +28310,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ram/src/protocols/Aws_restJson1.ts b/clients/client-ram/src/protocols/Aws_restJson1.ts index 4adbe78a5405..1beeb7ea95a8 100644 --- a/clients/client-ram/src/protocols/Aws_restJson1.ts +++ b/clients/client-ram/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4402,17 +4402,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-rbin/src/protocols/Aws_restJson1.ts b/clients/client-rbin/src/protocols/Aws_restJson1.ts index c8cd09d3683e..b16ebb5a1e19 100644 --- a/clients/client-rbin/src/protocols/Aws_restJson1.ts +++ b/clients/client-rbin/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1036,17 +1036,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-rds-data/src/protocols/Aws_restJson1.ts b/clients/client-rds-data/src/protocols/Aws_restJson1.ts index 816a7c0b82fd..ba794c933baf 100644 --- a/clients/client-rds-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-rds-data/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1138,17 +1138,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-rds/src/protocols/Aws_query.ts b/clients/client-rds/src/protocols/Aws_query.ts index 987c647cec9e..e79e485ae128 100644 --- a/clients/client-rds/src/protocols/Aws_query.ts +++ b/clients/client-rds/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -26477,17 +26477,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -26531,7 +26520,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts index d625f96b6b49..e6dd5ed0dc74 100644 --- a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1121,17 +1121,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts index d840ffeb4ae0..11897a3a3d92 100644 --- a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3743,17 +3743,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-redshift/src/protocols/Aws_query.ts b/clients/client-redshift/src/protocols/Aws_query.ts index aae630cc91ba..78147891e4ac 100644 --- a/clients/client-redshift/src/protocols/Aws_query.ts +++ b/clients/client-redshift/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -21200,17 +21200,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-rekognition/src/protocols/Aws_json1_1.ts b/clients/client-rekognition/src/protocols/Aws_json1_1.ts index e28af65aa3ee..84854b01e3d2 100644 --- a/clients/client-rekognition/src/protocols/Aws_json1_1.ts +++ b/clients/client-rekognition/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -9088,17 +9088,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts index e21bdfa1d813..0ca9d8791934 100644 --- a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, expectUnion as __expectUnion, @@ -16,7 +17,6 @@ import { MessageHeaders as __MessageHeaders, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -643,17 +643,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts b/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts index fda608c4db2c..a2d3f5b5ad6d 100644 --- a/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts +++ b/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5684,17 +5684,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts b/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts index 48f08a4637bb..048d80f911c6 100644 --- a/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts +++ b/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2053,17 +2053,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts index 61e0bc2f9641..53b7c789df9a 100644 --- a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts +++ b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts @@ -1,11 +1,11 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -778,17 +778,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-resource-groups/src/protocols/Aws_restJson1.ts b/clients/client-resource-groups/src/protocols/Aws_restJson1.ts index 00bb9a0cd3d3..843dda1a798d 100644 --- a/clients/client-resource-groups/src/protocols/Aws_restJson1.ts +++ b/clients/client-resource-groups/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1927,17 +1927,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-robomaker/src/protocols/Aws_restJson1.ts b/clients/client-robomaker/src/protocols/Aws_restJson1.ts index fdbddcf3ed36..cd335ae67f4a 100644 --- a/clients/client-robomaker/src/protocols/Aws_restJson1.ts +++ b/clients/client-robomaker/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -6225,17 +6225,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts b/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts index 4eb7c45d4448..c26bcee7dbb5 100644 --- a/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts +++ b/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2595,17 +2595,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts index 413973fa54fe..54445353eebe 100644 --- a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts +++ b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2953,17 +2953,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-route-53/src/protocols/Aws_restXml.ts b/clients/client-route-53/src/protocols/Aws_restXml.ts index 0636546ea546..791cab72b614 100644 --- a/clients/client-route-53/src/protocols/Aws_restXml.ts +++ b/clients/client-route-53/src/protocols/Aws_restXml.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -9613,17 +9613,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -9645,7 +9634,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts index 4844339474fd..590b77cd34f1 100644 --- a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts +++ b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts @@ -1,11 +1,11 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -520,17 +520,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts index c669fe043bdb..b9cc3d38c632 100644 --- a/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts +++ b/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2293,17 +2293,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts index 38cffcfd0ce7..33e10431854f 100644 --- a/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts +++ b/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3492,17 +3492,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts index 117cdf075919..8bd03b93fdbd 100644 --- a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts +++ b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts @@ -1,12 +1,12 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, take, withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5597,17 +5597,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-rum/src/protocols/Aws_restJson1.ts b/clients/client-rum/src/protocols/Aws_restJson1.ts index b615a41bf2e8..4584b232051c 100644 --- a/clients/client-rum/src/protocols/Aws_restJson1.ts +++ b/clients/client-rum/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -1943,17 +1943,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-s3-control/src/protocols/Aws_restXml.ts b/clients/client-s3-control/src/protocols/Aws_restXml.ts index e900e91ff61a..f59d1a71ea2a 100644 --- a/clients/client-s3-control/src/protocols/Aws_restXml.ts +++ b/clients/client-s3-control/src/protocols/Aws_restXml.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { HttpRequest as __HttpRequest, @@ -10349,17 +10349,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -10381,7 +10370,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-s3/src/commands/CreateBucketCommand.ts b/clients/client-s3/src/commands/CreateBucketCommand.ts index 17ba2ba6568e..bca69a518d44 100644 --- a/clients/client-s3/src/commands/CreateBucketCommand.ts +++ b/clients/client-s3/src/commands/CreateBucketCommand.ts @@ -169,39 +169,39 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @example To create a bucket in a specific region + * @example To create a bucket * ```javascript - * // The following example creates a bucket. The request specifies an AWS region where to create the bucket. + * // The following example creates a bucket. * const input = { - * "Bucket": "examplebucket", - * "CreateBucketConfiguration": { - * "LocationConstraint": "eu-west-1" - * } + * "Bucket": "examplebucket" * }; * const command = new CreateBucketCommand(input); * const response = await client.send(command); * /* response == * { - * "Location": "http://examplebucket..s3.amazonaws.com/" + * "Location": "/examplebucket" * } * *\/ - * // example id: to-create-a-bucket-in-a-specific-region-1483399072992 + * // example id: to-create-a-bucket--1472851826060 * ``` * - * @example To create a bucket + * @example To create a bucket in a specific region * ```javascript - * // The following example creates a bucket. + * // The following example creates a bucket. The request specifies an AWS region where to create the bucket. * const input = { - * "Bucket": "examplebucket" + * "Bucket": "examplebucket", + * "CreateBucketConfiguration": { + * "LocationConstraint": "eu-west-1" + * } * }; * const command = new CreateBucketCommand(input); * const response = await client.send(command); * /* response == * { - * "Location": "/examplebucket" + * "Location": "http://examplebucket..s3.amazonaws.com/" * } * *\/ - * // example id: to-create-a-bucket--1472851826060 + * // example id: to-create-a-bucket-in-a-specific-region-1483399072992 * ``` * */ diff --git a/clients/client-s3/src/commands/DeleteObjectCommand.ts b/clients/client-s3/src/commands/DeleteObjectCommand.ts index 23562c511fe9..0f61073c6d74 100644 --- a/clients/client-s3/src/commands/DeleteObjectCommand.ts +++ b/clients/client-s3/src/commands/DeleteObjectCommand.ts @@ -96,28 +96,28 @@ export interface DeleteObjectCommandOutput extends DeleteObjectOutput, __Metadat * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @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/DeleteObjectTaggingCommand.ts b/clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts index b0d6a2f3226e..8c09e526c31b 100644 --- a/clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts +++ b/clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts @@ -85,39 +85,39 @@ export interface DeleteObjectTaggingCommandOutput extends DeleteObjectTaggingOut * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @example To remove tag set from an object + * @example To remove tag set from an object version * ```javascript - * // The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the operation removes tag set from the latest object version. + * // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version. * const input = { * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg" + * "Key": "HappyFace.jpg", + * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" * }; * const command = new DeleteObjectTaggingCommand(input); * const response = await client.send(command); * /* response == * { - * "VersionId": "null" + * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" * } * *\/ - * // example id: to-remove-tag-set-from-an-object-1483145342862 + * // example id: to-remove-tag-set-from-an-object-version-1483145285913 * ``` * - * @example To remove tag set from an object version + * @example To remove tag set from an object * ```javascript - * // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version. + * // The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the operation removes tag set from the latest object version. * const input = { * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg", - * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" + * "Key": "HappyFace.jpg" * }; * const command = new DeleteObjectTaggingCommand(input); * const response = await client.send(command); * /* response == * { - * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" + * "VersionId": "null" * } * *\/ - * // example id: to-remove-tag-set-from-an-object-version-1483145285913 + * // example id: to-remove-tag-set-from-an-object-1483145342862 * ``` * */ diff --git a/clients/client-s3/src/commands/GetObjectTaggingCommand.ts b/clients/client-s3/src/commands/GetObjectTaggingCommand.ts index 25a5b410c6e1..585eb3834e40 100644 --- a/clients/client-s3/src/commands/GetObjectTaggingCommand.ts +++ b/clients/client-s3/src/commands/GetObjectTaggingCommand.ts @@ -101,13 +101,12 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _ * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @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); @@ -115,22 +114,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); @@ -138,18 +142,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/ListMultipartUploadsCommand.ts b/clients/client-s3/src/commands/ListMultipartUploadsCommand.ts index 63fe31735e87..a3f52dec279e 100644 --- a/clients/client-s3/src/commands/ListMultipartUploadsCommand.ts +++ b/clients/client-s3/src/commands/ListMultipartUploadsCommand.ts @@ -148,104 +148,104 @@ export interface ListMultipartUploadsCommandOutput extends ListMultipartUploadsO * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @example To list in-progress multipart uploads on a bucket + * @example List next set of multipart uploads when previous result is truncated * ```javascript - * // The following example lists in-progress multipart uploads on a specific bucket. + * // The following example specifies the upload-id-marker and key-marker from previous truncated response to retrieve next setup of multipart uploads. * const input = { - * "Bucket": "examplebucket" + * "Bucket": "examplebucket", + * "KeyMarker": "nextkeyfrompreviousresponse", + * "MaxUploads": "2", + * "UploadIdMarker": "valuefrompreviousresponse" * }; * const command = new ListMultipartUploadsCommand(input); * const response = await client.send(command); * /* response == * { + * "Bucket": "acl1", + * "IsTruncated": true, + * "KeyMarker": "", + * "MaxUploads": "2", + * "NextKeyMarker": "someobjectkey", + * "NextUploadIdMarker": "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--", + * "UploadIdMarker": "", * "Uploads": [ * { * "Initiated": "2014-05-01T05:40:58.000Z", * "Initiator": { - * "DisplayName": "display-name", + * "DisplayName": "ownder-display-name", * "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" * }, * "Key": "JavaFile", * "Owner": { - * "DisplayName": "display-name", - * "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" + * "DisplayName": "mohanataws", + * "ID": "852b113e7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" * }, * "StorageClass": "STANDARD", - * "UploadId": "examplelUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--" + * "UploadId": "gZ30jIqlUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--" * }, * { * "Initiated": "2014-05-01T05:41:27.000Z", * "Initiator": { - * "DisplayName": "display-name", + * "DisplayName": "ownder-display-name", * "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" * }, * "Key": "JavaFile", * "Owner": { - * "DisplayName": "display-name", + * "DisplayName": "ownder-display-name", * "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" * }, * "StorageClass": "STANDARD", - * "UploadId": "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--" + * "UploadId": "b7tZSqIlo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--" * } * ] * } * *\/ - * // example id: to-list-in-progress-multipart-uploads-on-a-bucket-1481852775260 + * // example id: list-next-set-of-multipart-uploads-when-previous-result-is-truncated-1482428106748 * ``` * - * @example List next set of multipart uploads when previous result is truncated + * @example To list in-progress multipart uploads on a bucket * ```javascript - * // The following example specifies the upload-id-marker and key-marker from previous truncated response to retrieve next setup of multipart uploads. + * // The following example lists in-progress multipart uploads on a specific bucket. * const input = { - * "Bucket": "examplebucket", - * "KeyMarker": "nextkeyfrompreviousresponse", - * "MaxUploads": "2", - * "UploadIdMarker": "valuefrompreviousresponse" + * "Bucket": "examplebucket" * }; * const command = new ListMultipartUploadsCommand(input); * const response = await client.send(command); * /* response == * { - * "Bucket": "acl1", - * "IsTruncated": true, - * "KeyMarker": "", - * "MaxUploads": "2", - * "NextKeyMarker": "someobjectkey", - * "NextUploadIdMarker": "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--", - * "UploadIdMarker": "", * "Uploads": [ * { * "Initiated": "2014-05-01T05:40:58.000Z", * "Initiator": { - * "DisplayName": "ownder-display-name", + * "DisplayName": "display-name", * "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" * }, * "Key": "JavaFile", * "Owner": { - * "DisplayName": "mohanataws", - * "ID": "852b113e7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" + * "DisplayName": "display-name", + * "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" * }, * "StorageClass": "STANDARD", - * "UploadId": "gZ30jIqlUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--" + * "UploadId": "examplelUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--" * }, * { * "Initiated": "2014-05-01T05:41:27.000Z", * "Initiator": { - * "DisplayName": "ownder-display-name", + * "DisplayName": "display-name", * "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" * }, * "Key": "JavaFile", * "Owner": { - * "DisplayName": "ownder-display-name", + * "DisplayName": "display-name", * "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" * }, * "StorageClass": "STANDARD", - * "UploadId": "b7tZSqIlo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--" + * "UploadId": "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--" * } * ] * } * *\/ - * // example id: list-next-set-of-multipart-uploads-when-previous-result-is-truncated-1482428106748 + * // example id: to-list-in-progress-multipart-uploads-on-a-bucket-1481852775260 * ``` * */ diff --git a/clients/client-s3/src/commands/PutObjectCommand.ts b/clients/client-s3/src/commands/PutObjectCommand.ts index 2e8c12fcbfec..86afc0b00a51 100644 --- a/clients/client-s3/src/commands/PutObjectCommand.ts +++ b/clients/client-s3/src/commands/PutObjectCommand.ts @@ -218,149 +218,149 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @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 object and specify user-defined metadata + * @example To upload an object and specify canned ACL. * ```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 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 = { + * "ACL": "authenticated-read", * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "exampleobject", - * "Metadata": { - * "metadata1": "value1", - * "metadata2": "value2" - * } + * "Key": "exampleobject" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" + * "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr" * } * *\/ - * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 + * // example id: to-upload-an-object-and-specify-canned-acl-1483397779571 * ``` * - * @example To upload an object (specify optional headers) + * @example To create an object. * ```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. 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": "objectkey" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "ServerSideEncryption": "AES256", - * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" + * "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ" * } * *\/ - * // example id: to-upload-an-object-(specify-optional-headers) + * // example id: to-create-an-object-1483147613675 * ``` * - * @example To create an object. + * @example To upload an object and specify server-side encryption and object tags * ```javascript - * // The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "objectkey" + * "Key": "exampleobject", + * "ServerSideEncryption": "AES256", + * "Tagging": "key1=value1&key2=value2" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ" + * "ServerSideEncryption": "AES256", + * "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt" * } * *\/ - * // example id: to-create-an-object-1483147613675 + * // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831 * ``` * - * @example To upload an object and specify server-side encryption and object tags + * @example To upload object and specify user-defined metadata * ```javascript - * // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response. + * // 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": "filetoupload", * "Bucket": "examplebucket", * "Key": "exampleobject", - * "ServerSideEncryption": "AES256", - * "Tagging": "key1=value1&key2=value2" + * "Metadata": { + * "metadata1": "value1", + * "metadata2": "value2" + * } * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "ServerSideEncryption": "AES256", - * "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt" + * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" * } * *\/ - * // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831 + * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 * ``` * - * @example To upload an object and specify optional tags + * @example To upload an object * ```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 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": "c:\\HappyFace.jpg", + * "Body": "HappyFace.jpg", * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg", - * "Tagging": "key1=value1&key2=value2" + * "Key": "HappyFace.jpg" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a" + * "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk" * } * *\/ - * // example id: to-upload-an-object-and-specify-optional-tags-1481762310955 + * // example id: to-upload-an-object-1481760101010 * ``` * - * @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) * ``` * */ diff --git a/clients/client-s3/src/protocols/Aws_restXml.ts b/clients/client-s3/src/protocols/Aws_restXml.ts index 07b714291bfc..866494794492 100644 --- a/clients/client-s3/src/protocols/Aws_restXml.ts +++ b/clients/client-s3/src/protocols/Aws_restXml.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, dateToUtcString as __dateToUtcString, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, @@ -23,7 +24,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { HttpRequest as __HttpRequest, @@ -12922,17 +12922,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-s3outposts/src/protocols/Aws_restJson1.ts b/clients/client-s3outposts/src/protocols/Aws_restJson1.ts index 5d24a7b01d1d..373b11861465 100644 --- a/clients/client-s3outposts/src/protocols/Aws_restJson1.ts +++ b/clients/client-s3outposts/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -666,17 +666,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts index a903e626b4ea..7e4bd0d5b118 100644 --- a/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -632,17 +632,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts index c2aa7148294d..549aee50bd53 100644 --- a/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -360,17 +360,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts index 656a11c2865d..09282195bcfb 100644 --- a/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -535,17 +535,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts index b9302f074f30..0b0ad73b9cdc 100644 --- a/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -24,7 +25,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2990,17 +2990,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts index 3cc5bd17fcca..85f7cda8fc0b 100644 --- a/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, expectNonNull as __expectNonNull, expectObject as __expectObject, map, @@ -9,7 +10,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -124,17 +124,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sagemaker-runtime/package.json b/clients/client-sagemaker-runtime/package.json index 6d553bf5a38e..a5837ce41d68 100644 --- a/clients/client-sagemaker-runtime/package.json +++ b/clients/client-sagemaker-runtime/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts index 4b9757aadde7..5f714cc8c997 100644 --- a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -357,17 +357,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts index 169f45476488..c90842225cb0 100644 --- a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts +++ b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -28258,17 +28258,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-savingsplans/src/protocols/Aws_restJson1.ts b/clients/client-savingsplans/src/protocols/Aws_restJson1.ts index 35565668ebbc..6c2eefa1a0e5 100644 --- a/clients/client-savingsplans/src/protocols/Aws_restJson1.ts +++ b/clients/client-savingsplans/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1004,17 +1004,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-scheduler/src/protocols/Aws_restJson1.ts b/clients/client-scheduler/src/protocols/Aws_restJson1.ts index 5975d42e1bab..be3e070b7457 100644 --- a/clients/client-scheduler/src/protocols/Aws_restJson1.ts +++ b/clients/client-scheduler/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1395,17 +1395,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-schemas/package.json b/clients/client-schemas/package.json index 0a1a55c3b0d3..d47c99079cdd 100644 --- a/clients/client-schemas/package.json +++ b/clients/client-schemas/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-schemas/src/protocols/Aws_restJson1.ts b/clients/client-schemas/src/protocols/Aws_restJson1.ts index e3b1b7dfffb7..5bd9071670d3 100644 --- a/clients/client-schemas/src/protocols/Aws_restJson1.ts +++ b/clients/client-schemas/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3404,17 +3404,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts index bd17986b8e0c..ab233b46329c 100644 --- a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2228,17 +2228,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-securityhub/src/protocols/Aws_restJson1.ts b/clients/client-securityhub/src/protocols/Aws_restJson1.ts index 6f4d7a01fa89..77dad23c2b8f 100644 --- a/clients/client-securityhub/src/protocols/Aws_restJson1.ts +++ b/clients/client-securityhub/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -11889,17 +11889,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-securitylake/src/protocols/Aws_restJson1.ts b/clients/client-securitylake/src/protocols/Aws_restJson1.ts index a9174142676f..185e9a3189cc 100644 --- a/clients/client-securitylake/src/protocols/Aws_restJson1.ts +++ b/clients/client-securitylake/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2995,17 +2995,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts b/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts index 0e688ab7e862..841c6b0caa24 100644 --- a/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts +++ b/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1862,17 +1862,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts b/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts index 133ea3218da6..101a8a1f86cd 100644 --- a/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts +++ b/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2392,17 +2392,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts index 4b62cf601bb2..e9468d7ed62c 100644 --- a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7745,17 +7745,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts index ff74bd8eb507..64d0b7c4b454 100644 --- a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2233,17 +2233,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts index cdc85ee18d49..f7590da46393 100644 --- a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts +++ b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -2550,17 +2550,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ses/src/protocols/Aws_query.ts b/clients/client-ses/src/protocols/Aws_query.ts index cf5d3f641470..0ee156e0052d 100644 --- a/clients/client-ses/src/protocols/Aws_query.ts +++ b/clients/client-ses/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -9716,17 +9716,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -9770,7 +9759,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-sesv2/src/protocols/Aws_restJson1.ts b/clients/client-sesv2/src/protocols/Aws_restJson1.ts index 571f340b99f7..bca81239eb2f 100644 --- a/clients/client-sesv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-sesv2/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -8911,17 +8911,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sfn/src/protocols/Aws_json1_0.ts b/clients/client-sfn/src/protocols/Aws_json1_0.ts index fefd7369c712..6d00e7bdf7f1 100644 --- a/clients/client-sfn/src/protocols/Aws_json1_0.ts +++ b/clients/client-sfn/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -2849,17 +2849,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-shield/src/protocols/Aws_json1_1.ts b/clients/client-shield/src/protocols/Aws_json1_1.ts index 40d6b6737316..b7da2d04eb2f 100644 --- a/clients/client-shield/src/protocols/Aws_json1_1.ts +++ b/clients/client-shield/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3364,17 +3364,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-signer/src/protocols/Aws_restJson1.ts b/clients/client-signer/src/protocols/Aws_restJson1.ts index c029bc6d753b..0b2800167d3f 100644 --- a/clients/client-signer/src/protocols/Aws_restJson1.ts +++ b/clients/client-signer/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -2141,17 +2141,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts b/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts index 980b4c58ae54..4d0194118ee5 100644 --- a/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts +++ b/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1628,17 +1628,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sms/src/protocols/Aws_json1_1.ts b/clients/client-sms/src/protocols/Aws_json1_1.ts index e98285004ad5..878e77bafa01 100644 --- a/clients/client-sms/src/protocols/Aws_json1_1.ts +++ b/clients/client-sms/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3569,17 +3569,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts b/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts index 7cb8c266ae64..fdc2f81d5288 100644 --- a/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts +++ b/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1465,17 +1465,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-snowball/src/protocols/Aws_json1_1.ts b/clients/client-snowball/src/protocols/Aws_json1_1.ts index 8a10feede3c8..3f77ab161777 100644 --- a/clients/client-snowball/src/protocols/Aws_json1_1.ts +++ b/clients/client-snowball/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -14,7 +15,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2549,17 +2549,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sns/src/protocols/Aws_query.ts b/clients/client-sns/src/protocols/Aws_query.ts index 42b71bb5e25d..abbfe06ff392 100644 --- a/clients/client-sns/src/protocols/Aws_query.ts +++ b/clients/client-sns/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -5936,17 +5936,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -5990,7 +5979,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-sqs/src/protocols/Aws_query.ts b/clients/client-sqs/src/protocols/Aws_query.ts index b9ed495699af..6f384e173446 100644 --- a/clients/client-sqs/src/protocols/Aws_query.ts +++ b/clients/client-sqs/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -3363,17 +3363,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -3417,7 +3406,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts index e7f191bc52e5..1f464432b7b1 100644 --- a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3853,17 +3853,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts b/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts index c4b259dfd40b..fc66beef4879 100644 --- a/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts +++ b/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -17,7 +18,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3182,17 +3182,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts b/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts index 698903652270..095b50d704f5 100644 --- a/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts +++ b/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1691,17 +1691,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-ssm/src/protocols/Aws_json1_1.ts b/clients/client-ssm/src/protocols/Aws_json1_1.ts index 391e30f05557..734e5da5bcef 100644 --- a/clients/client-ssm/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -15903,17 +15903,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts index b656fb8c27ea..1b887f97a911 100644 --- a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts +++ b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3452,17 +3452,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts b/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts index a47098d65f8e..5829b60a9c88 100644 --- a/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts +++ b/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -602,17 +602,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sso/src/protocols/Aws_restJson1.ts b/clients/client-sso/src/protocols/Aws_restJson1.ts index 6c457736d0dd..edbe8ad70566 100644 --- a/clients/client-sso/src/protocols/Aws_restJson1.ts +++ b/clients/client-sso/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -452,17 +452,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts index 4705a533560b..2d65f12f3072 100644 --- a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts +++ b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6804,17 +6804,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-sts/src/protocols/Aws_query.ts b/clients/client-sts/src/protocols/Aws_query.ts index f2f0e310d01f..bec8d57b6ba5 100644 --- a/clients/client-sts/src/protocols/Aws_query.ts +++ b/clients/client-sts/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -1334,17 +1334,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -1388,7 +1377,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/clients/client-support-app/src/protocols/Aws_restJson1.ts b/clients/client-support-app/src/protocols/Aws_restJson1.ts index 3b7a87d786b2..4d643484cf5b 100644 --- a/clients/client-support-app/src/protocols/Aws_restJson1.ts +++ b/clients/client-support-app/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1040,17 +1040,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-support/src/protocols/Aws_json1_1.ts b/clients/client-support/src/protocols/Aws_json1_1.ts index ffeac8396519..2c68e9c73eb0 100644 --- a/clients/client-support/src/protocols/Aws_json1_1.ts +++ b/clients/client-support/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectString as __expectString, @@ -9,7 +10,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1640,17 +1640,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-swf/src/protocols/Aws_json1_0.ts b/clients/client-swf/src/protocols/Aws_json1_0.ts index 7a18beb02f8e..e3f710e66802 100644 --- a/clients/client-swf/src/protocols/Aws_json1_0.ts +++ b/clients/client-swf/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3300,17 +3300,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-synthetics/src/protocols/Aws_restJson1.ts b/clients/client-synthetics/src/protocols/Aws_restJson1.ts index 7df22c5b3029..9e63fc3fa3dc 100644 --- a/clients/client-synthetics/src/protocols/Aws_restJson1.ts +++ b/clients/client-synthetics/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2276,17 +2276,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-textract/src/protocols/Aws_json1_1.ts b/clients/client-textract/src/protocols/Aws_json1_1.ts index c5115711599d..3ce171bd33e0 100644 --- a/clients/client-textract/src/protocols/Aws_json1_1.ts +++ b/clients/client-textract/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectString as __expectString, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2176,17 +2176,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts index cf7d2fc747ec..c1820dc10d13 100644 --- a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1617,17 +1617,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts index 27c27480f1ce..79d5f2b42ec3 100644 --- a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2050,17 +2050,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-tnb/package.json b/clients/client-tnb/package.json index 29dd8db9972f..19568a14f810 100644 --- a/clients/client-tnb/package.json +++ b/clients/client-tnb/package.json @@ -49,6 +49,7 @@ "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-endpoints": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/clients/client-tnb/src/protocols/Aws_restJson1.ts b/clients/client-tnb/src/protocols/Aws_restJson1.ts index 512072844e2b..cb023c6cd2e8 100644 --- a/clients/client-tnb/src/protocols/Aws_restJson1.ts +++ b/clients/client-tnb/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3618,17 +3618,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts index 0eadf11f5ca5..8ed1f0aede5a 100644 --- a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -18,7 +19,6 @@ import { MessageHeaders as __MessageHeaders, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1187,17 +1187,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-transcribe/src/protocols/Aws_json1_1.ts b/clients/client-transcribe/src/protocols/Aws_json1_1.ts index 458281e70aa1..416a0bb9f5c4 100644 --- a/clients/client-transcribe/src/protocols/Aws_json1_1.ts +++ b/clients/client-transcribe/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3780,17 +3780,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-transfer/src/protocols/Aws_json1_1.ts b/clients/client-transfer/src/protocols/Aws_json1_1.ts index 7da11cc59a51..916d3e415b8b 100644 --- a/clients/client-transfer/src/protocols/Aws_json1_1.ts +++ b/clients/client-transfer/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5001,17 +5001,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-translate/src/protocols/Aws_json1_1.ts b/clients/client-translate/src/protocols/Aws_json1_1.ts index 46bca2f405c8..237c5afc4b7a 100644 --- a/clients/client-translate/src/protocols/Aws_json1_1.ts +++ b/clients/client-translate/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2152,17 +2152,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts b/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts index 606252ac0f8a..744d85503b17 100644 --- a/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts +++ b/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2637,17 +2637,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-voice-id/src/protocols/Aws_json1_0.ts b/clients/client-voice-id/src/protocols/Aws_json1_0.ts index 9ea649665a3e..b825ffb1c59f 100644 --- a/clients/client-voice-id/src/protocols/Aws_json1_0.ts +++ b/clients/client-voice-id/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3091,17 +3091,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts b/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts index 1351cbccd035..a0d38b389156 100644 --- a/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts +++ b/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5772,17 +5772,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts index df07eb852af1..24ae6d8c564c 100644 --- a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -7117,17 +7117,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-waf/src/protocols/Aws_json1_1.ts b/clients/client-waf/src/protocols/Aws_json1_1.ts index 14e802d119f0..7136705877b0 100644 --- a/clients/client-waf/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, @@ -11,7 +12,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6788,17 +6788,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-wafv2/src/protocols/Aws_json1_1.ts b/clients/client-wafv2/src/protocols/Aws_json1_1.ts index 0a448a99198e..536430cce977 100644 --- a/clients/client-wafv2/src/protocols/Aws_json1_1.ts +++ b/clients/client-wafv2/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -13,7 +14,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5955,17 +5955,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts b/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts index b0cd80d477d9..042978e7031f 100644 --- a/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts +++ b/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5925,17 +5925,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-wisdom/src/protocols/Aws_restJson1.ts b/clients/client-wisdom/src/protocols/Aws_restJson1.ts index a5a12ef05154..4cd28042f0f1 100644 --- a/clients/client-wisdom/src/protocols/Aws_restJson1.ts +++ b/clients/client-wisdom/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3079,17 +3079,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-workdocs/src/protocols/Aws_restJson1.ts b/clients/client-workdocs/src/protocols/Aws_restJson1.ts index 016c6f38663e..c66627085d75 100644 --- a/clients/client-workdocs/src/protocols/Aws_restJson1.ts +++ b/clients/client-workdocs/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5186,17 +5186,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-worklink/src/protocols/Aws_restJson1.ts b/clients/client-worklink/src/protocols/Aws_restJson1.ts index 50067c6306d7..604f230ab84e 100644 --- a/clients/client-worklink/src/protocols/Aws_restJson1.ts +++ b/clients/client-worklink/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3269,17 +3269,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-workmail/src/protocols/Aws_json1_1.ts b/clients/client-workmail/src/protocols/Aws_json1_1.ts index f3661a8ea507..c543b911c0d8 100644 --- a/clients/client-workmail/src/protocols/Aws_json1_1.ts +++ b/clients/client-workmail/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, @@ -12,7 +13,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7388,17 +7388,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts b/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts index 9516b3ff59f5..068ac4482543 100644 --- a/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts +++ b/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, map, @@ -12,7 +13,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -271,17 +271,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts b/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts index ebffad6741d4..d35c03176953 100644 --- a/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts +++ b/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -15,7 +16,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5810,17 +5810,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-workspaces/src/protocols/Aws_json1_1.ts b/clients/client-workspaces/src/protocols/Aws_json1_1.ts index d3da069373e6..b17b7d0f0cde 100644 --- a/clients/client-workspaces/src/protocols/Aws_json1_1.ts +++ b/clients/client-workspaces/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, @@ -10,7 +11,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5665,17 +5665,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/clients/client-xray/src/protocols/Aws_restJson1.ts b/clients/client-xray/src/protocols/Aws_restJson1.ts index 702fae899709..cd6d1ea1a19b 100644 --- a/clients/client-xray/src/protocols/Aws_restJson1.ts +++ b/clients/client-xray/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -18,7 +19,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3534,17 +3534,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/packages/smithy-client/package.json b/packages/smithy-client/package.json index 62949ab7f109..a5820794e285 100644 --- a/packages/smithy-client/package.json +++ b/packages/smithy-client/package.json @@ -23,6 +23,8 @@ "dependencies": { "@aws-sdk/middleware-stack": "*", "@aws-sdk/types": "*", + "@aws-sdk/util-stream": "*", + "@smithy/types": "^1.0.0", "tslib": "^2.5.0" }, "engines": { diff --git a/packages/smithy-client/src/collect-stream-body.spec.ts b/packages/smithy-client/src/collect-stream-body.spec.ts new file mode 100644 index 000000000000..18755a8fb9f4 --- /dev/null +++ b/packages/smithy-client/src/collect-stream-body.spec.ts @@ -0,0 +1,49 @@ +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; + +import { collectBody } from "./collect-stream-body"; + +describe(collectBody.name, () => { + it("passes through Uint8Array", async () => { + const body = new Uint8Array(); + const arr = await collectBody(body, { + async streamCollector(stream: any) { + return new Uint8Array(stream); + }, + }); + + expect(arr).toBe(body); + }); + + it("uses the contextual streamCollector", async () => { + const body = "x"; + const arr = await collectBody(body, { + async streamCollector(stream: any) { + return Uint8ArrayBlobAdapter.fromString(stream); + }, + }); + + expect(arr.transformToString()).toEqual("x"); + }); + + it("uses the contextual streamCollector for empty string", async () => { + const body = ""; + const arr = await collectBody(body, { + async streamCollector(stream: any) { + return Uint8ArrayBlobAdapter.fromString(stream); + }, + }); + + expect(arr.transformToString()).toEqual(""); + }); + + it("defaults to an empty Uint8Array", async () => { + const body = null; + const arr = await collectBody(body, { + async streamCollector(stream: any) { + return Uint8ArrayBlobAdapter.fromString(stream); + }, + }); + + expect(arr.transformToString()).toEqual(""); + }); +}); diff --git a/packages/smithy-client/src/collect-stream-body.ts b/packages/smithy-client/src/collect-stream-body.ts new file mode 100644 index 000000000000..5e8baf49145c --- /dev/null +++ b/packages/smithy-client/src/collect-stream-body.ts @@ -0,0 +1,26 @@ +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; +import { SerdeContext } from "@smithy/types"; + +/** + * @internal + * + * Collect low-level response body stream to Uint8Array. + */ +export const collectBody = async ( + streamBody: any = new Uint8Array(), + context: { + streamCollector: SerdeContext["streamCollector"]; + } +): Promise => { + if (streamBody instanceof Uint8Array) { + return Uint8ArrayBlobAdapter.mutate(streamBody); + } + + if (!streamBody) { + return Uint8ArrayBlobAdapter.mutate(new Uint8Array()); + } + + const fromContext = context.streamCollector(streamBody); + + return Uint8ArrayBlobAdapter.mutate(await fromContext); +}; diff --git a/packages/smithy-client/src/index.ts b/packages/smithy-client/src/index.ts index 344c64f9d147..5f5538bddd29 100644 --- a/packages/smithy-client/src/index.ts +++ b/packages/smithy-client/src/index.ts @@ -1,5 +1,6 @@ export * from "./NoOpLogger"; export * from "./client"; +export * from "./collect-stream-body"; export * from "./command"; export * from "./constants"; export * from "./create-aggregated-client"; diff --git a/packages/util-stream/src/blob/Uint8ArrayBlobAdapter.spec.ts b/packages/util-stream/src/blob/Uint8ArrayBlobAdapter.spec.ts index c9c27d248a1a..d8f071c19654 100644 --- a/packages/util-stream/src/blob/Uint8ArrayBlobAdapter.spec.ts +++ b/packages/util-stream/src/blob/Uint8ArrayBlobAdapter.spec.ts @@ -2,7 +2,7 @@ import { Uint8ArrayBlobAdapter } from "./Uint8ArrayBlobAdapter"; describe(Uint8ArrayBlobAdapter.name, () => { it("extends Uint8Array", () => { - const blobby = new Uint8ArrayBlobAdapter(5); + const blobby = Uint8ArrayBlobAdapter.mutate(new Uint8Array(5)); blobby[-1] = 8; blobby[0] = 8; diff --git a/private/aws-echo-service/src/protocols/Aws_restJson1.ts b/private/aws-echo-service/src/protocols/Aws_restJson1.ts index 2d02ae4df8a4..f587c712c431 100644 --- a/private/aws-echo-service/src/protocols/Aws_restJson1.ts +++ b/private/aws-echo-service/src/protocols/Aws_restJson1.ts @@ -11,12 +11,12 @@ import { expectString as __expectString, resolvedPath as __resolvedPath, _json, + collectBody, map, take, withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -178,17 +178,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/private/aws-protocoltests-ec2/src/endpoints.ts b/private/aws-protocoltests-ec2/src/endpoints.ts index da75903b7eaf..a159bd7df32f 100644 --- a/private/aws-protocoltests-ec2/src/endpoints.ts +++ b/private/aws-protocoltests-ec2/src/endpoints.ts @@ -119,6 +119,20 @@ const partitionHash: PartitionHash = { }, ], }, + "aws-iso-f": { + regions: [], + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + variants: [ + { + hostname: "awsec2.{region}.csp.hci.ic.gov", + tags: [], + }, + { + hostname: "awsec2-fips.{region}.csp.hci.ic.gov", + tags: ["fips"], + }, + ], + }, "aws-us-gov": { regions: ["us-gov-east-1", "us-gov-west-1"], regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", diff --git a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts index 5f861b15bd99..2391f77b761d 100644 --- a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts +++ b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -19,7 +20,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -2343,17 +2343,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -2397,7 +2386,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/private/aws-protocoltests-json-10/src/endpoints.ts b/private/aws-protocoltests-json-10/src/endpoints.ts index 140305e3a86e..181483ee5a9a 100644 --- a/private/aws-protocoltests-json-10/src/endpoints.ts +++ b/private/aws-protocoltests-json-10/src/endpoints.ts @@ -119,6 +119,20 @@ const partitionHash: PartitionHash = { }, ], }, + "aws-iso-f": { + regions: [], + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + variants: [ + { + hostname: "jsonrpc10.{region}.csp.hci.ic.gov", + tags: [], + }, + { + hostname: "jsonrpc10-fips.{region}.csp.hci.ic.gov", + tags: ["fips"], + }, + ], + }, "aws-us-gov": { regions: ["us-gov-east-1", "us-gov-west-1"], regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", diff --git a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts index bfec49f2b33e..921bb2609dc4 100644 --- a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts +++ b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, @@ -16,7 +17,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -752,17 +752,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/private/aws-protocoltests-json/src/endpoints.ts b/private/aws-protocoltests-json/src/endpoints.ts index b91e329796ad..c2f084164820 100644 --- a/private/aws-protocoltests-json/src/endpoints.ts +++ b/private/aws-protocoltests-json/src/endpoints.ts @@ -119,6 +119,20 @@ const partitionHash: PartitionHash = { }, ], }, + "aws-iso-f": { + regions: [], + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + variants: [ + { + hostname: "jsonprotocol.{region}.csp.hci.ic.gov", + tags: [], + }, + { + hostname: "jsonprotocol-fips.{region}.csp.hci.ic.gov", + tags: ["fips"], + }, + ], + }, "aws-us-gov": { regions: ["us-gov-east-1", "us-gov-west-1"], regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", diff --git a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts index a5926b68ff86..225eaaa26294 100644 --- a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts +++ b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, dateToUtcString as __dateToUtcString, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, @@ -25,7 +26,6 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -1412,17 +1412,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/private/aws-protocoltests-query/src/endpoints.ts b/private/aws-protocoltests-query/src/endpoints.ts index 1a3ee11f42d9..f1b370d0cf62 100644 --- a/private/aws-protocoltests-query/src/endpoints.ts +++ b/private/aws-protocoltests-query/src/endpoints.ts @@ -119,6 +119,20 @@ const partitionHash: PartitionHash = { }, ], }, + "aws-iso-f": { + regions: [], + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + variants: [ + { + hostname: "awsquery.{region}.csp.hci.ic.gov", + tags: [], + }, + { + hostname: "awsquery-fips.{region}.csp.hci.ic.gov", + tags: ["fips"], + }, + ], + }, "aws-us-gov": { regions: ["us-gov-east-1", "us-gov-west-1"], regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", diff --git a/private/aws-protocoltests-query/src/protocols/Aws_query.ts b/private/aws-protocoltests-query/src/protocols/Aws_query.ts index fa5f1351eb97..6539a29d7aed 100644 --- a/private/aws-protocoltests-query/src/protocols/Aws_query.ts +++ b/private/aws-protocoltests-query/src/protocols/Aws_query.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, @@ -19,7 +20,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -3126,17 +3126,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -3180,7 +3169,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/private/aws-protocoltests-restjson/src/endpoints.ts b/private/aws-protocoltests-restjson/src/endpoints.ts index 4dba95939fc2..e5637421edaf 100644 --- a/private/aws-protocoltests-restjson/src/endpoints.ts +++ b/private/aws-protocoltests-restjson/src/endpoints.ts @@ -119,6 +119,20 @@ const partitionHash: PartitionHash = { }, ], }, + "aws-iso-f": { + regions: [], + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + variants: [ + { + hostname: "restjson.{region}.csp.hci.ic.gov", + tags: [], + }, + { + hostname: "restjson-fips.{region}.csp.hci.ic.gov", + tags: ["fips"], + }, + ], + }, "aws-us-gov": { regions: ["us-gov-east-1", "us-gov-west-1"], regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", diff --git a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts index 8098fcf2435c..c085dec6d1ff 100644 --- a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts +++ b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, convertMap, dateToUtcString as __dateToUtcString, decorateServiceException as __decorateServiceException, @@ -40,7 +41,6 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -7414,17 +7414,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/private/aws-protocoltests-restxml/package.json b/private/aws-protocoltests-restxml/package.json index ed3c3a439775..9ac5d64be524 100644 --- a/private/aws-protocoltests-restxml/package.json +++ b/private/aws-protocoltests-restxml/package.json @@ -43,6 +43,7 @@ "@aws-sdk/util-defaults-mode-browser": "*", "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-user-agent-browser": "*", "@aws-sdk/util-user-agent-node": "*", "@aws-sdk/util-utf8": "*", diff --git a/private/aws-protocoltests-restxml/src/endpoints.ts b/private/aws-protocoltests-restxml/src/endpoints.ts index 3976a45b2d93..0aeb57d9686c 100644 --- a/private/aws-protocoltests-restxml/src/endpoints.ts +++ b/private/aws-protocoltests-restxml/src/endpoints.ts @@ -119,6 +119,20 @@ const partitionHash: PartitionHash = { }, ], }, + "aws-iso-f": { + regions: [], + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + variants: [ + { + hostname: "restxml.{region}.csp.hci.ic.gov", + tags: [], + }, + { + hostname: "restxml-fips.{region}.csp.hci.ic.gov", + tags: ["fips"], + }, + ], + }, "aws-us-gov": { regions: ["us-gov-east-1", "us-gov-west-1"], regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", diff --git a/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts b/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts index 88834ed04172..ab399b8d60ef 100644 --- a/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts +++ b/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { + collectBody, convertMap, dateToUtcString as __dateToUtcString, decorateServiceException as __decorateServiceException, @@ -26,7 +27,6 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { HttpRequest as __HttpRequest, @@ -6085,17 +6085,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -6117,7 +6106,7 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => ignoreDeclaration: true, parseTagValue: false, trimValues: false, - tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), }); parser.addEntity("#xD", "\r"); parser.addEntity("#10", "\n"); diff --git a/private/aws-restjson-server/src/protocols/Aws_restJson1.ts b/private/aws-restjson-server/src/protocols/Aws_restJson1.ts index 675c7a376988..2be50f5e7ea0 100644 --- a/private/aws-restjson-server/src/protocols/Aws_restJson1.ts +++ b/private/aws-restjson-server/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, dateToUtcString as __dateToUtcString, expectBoolean as __expectBoolean, expectByte as __expectByte, @@ -32,7 +33,6 @@ import { } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { acceptMatches as __acceptMatches, NotAcceptableException as __NotAcceptableException, @@ -8144,17 +8144,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); diff --git a/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts b/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts index 1af579b8f7be..753d5aba3888 100644 --- a/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts +++ b/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code import { _json, + collectBody, expectBoolean as __expectBoolean, expectByte as __expectByte, expectInt32 as __expectInt32, @@ -20,7 +21,6 @@ import { } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { acceptMatches as __acceptMatches, NotAcceptableException as __NotAcceptableException, @@ -1510,17 +1510,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));