From 6ebe9321b5bffd877c20e8da97481a3ebe96c131 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 | 15 +-- 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 | 15 +-- .../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 | 15 +-- .../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 +-- .../aws-protocoltests-restjson/package.json | 1 + .../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 +-- 391 files changed, 695 insertions(+), 4455 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 cd50f57915a40..f272e5b793306 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 ddd48acdd122c..251b5bc9a8a5d 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 bb9055946824e..baf7280b47bd1 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 8244d66e8a9fb..7218403aac62e 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 b8dd5865f21a6..f34478c583a6f 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 15718b226d3a5..71c1c6434f98d 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 bfaebdbd39b10..0638bc63a07c3 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 859c5a62f999d..c4797924a781e 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 b92a12aa45c4d..640c59d5c676c 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 c0826a786e54c..9787d0906d5b7 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 750af319139c8..26f234d6dce77 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 c7bf85f4986b2..cfb92668f8586 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 a9690301bf73e..5df46fa8b9d44 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 c4274b6450fb9..9e9ebe325913a 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 b50c9f2ef3fa6..8f0d225f93a04 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 d3f5c7802bbce..07ca9752a661a 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 7ec3047b9356a..9088aee3ff53c 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 96c1faa3bfa39..c27c48d528516 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 74ffc4685527b..786f8d4ed8f26 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 323ccce120101..c4bf4455b7385 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"; @@ -3368,17 +3368,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into 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 3dc6a456a0c9c..43a87d4483b3f 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 a93f5f5628b13..7d0a69833ebbc 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 0801a39656add..d51f39d160862 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 9b82002856344..496597af59c20 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 b5476d5dbbf4c..066f7b0369b76 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 581a2b52fcaaa..fd7331c3ded34 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 cebcf7b90e8cb..a231972079b01 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 c8003dfabba06..62a578d1bc8fe 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 819b86cf4ae0f..4dcf7962b0788 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 7e478fbc2011a..6cde1d7d7e370 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 6b6ddb83649d8..9b14719a450ee 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 7be4ce2d93a73..d5f4e9aabc4f4 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 69da3362b0a63..4eced4795dbd6 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 77decf81e034f..791126d18f278 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 5e44a88eeae3e..7a06adc47e62c 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 250101fa40183..a68925d2beaee 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 ba86462ca3ee9..489d6164ccd87 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 3333c56220174..db661974627d2 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 d60ba012987fa..45b5a09f5e13f 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 0debe57d973d5..03fee49cbab7c 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 ea5257bae57b9..f655e548e570a 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 4c4322ffbb80f..ac9849b886427 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 e2054ea0e40b0..84a43459833fc 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 5f053a515274d..559e6cf120d76 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 1d0f8f7924bf4..6341c955c28fa 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 6bfff2d9331cd..22957b267f91d 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 04ad983121da1..7bfa0f81ad534 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 8a970476a3a0d..0dddf6f27c4ac 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 69fdf90732f60..1415607090949 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 11c61991a8811..ce9f045b2d239 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 c6896e46e0bbc..1b3f9b78ac0e3 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 51cf95a289ce8..4448c0d5b735c 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"; @@ -11063,17 +11063,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -11117,7 +11106,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-cloudfront/package.json b/clients/client-cloudfront/package.json index 9bab693fa5553..47abd1959a727 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 d523d4d5d5deb..9fb91f6f12290 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 e60f518964e52..e315024caa007 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 75e49bd4bb59d..f8a3bc170bc1c 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 b44fb450b5ca3..5d7f2b5a2d17a 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 bf2828f13547e..1898f07084f83 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 c6a4ffe88b4f0..ab4c31ae161d8 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 771bd5ba07fef..b80df41f0241e 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 42e6bcc371e0b..5f4f8de381e40 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 817e6759fc627..7b92cbeb60844 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 17a279c0d25e9..ab184ba0eacfc 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 2a8b9d5a83660..cf033e91cb641 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 f10f15c248844..f1ab60bb4ae22 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 5d8bcee9cf011..a775da6b431f5 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 e4c04436568fb..67b4ff865a75f 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 1cbbf2db16baf..d41de96a94e9c 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 dd7bf4373a2e9..15bdcf372d420 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 cb317e675d6bc..364a448ed8494 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 3f69bea5e014c..fdf8679e63f7a 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 eaf2bd6561960..93ccf91918c53 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 cb87f157a757e..0defba08f9cdb 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 144f59b924403..2e0aea1410cb6 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 00af3765fc5b9..887139cc0edaa 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 9ce5e0b758f14..715cd49110f0d 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 f03e9c15f428f..f485cb0853359 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 8b7f18e61b5fe..ae55fefc8ee8f 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 24e9d990d0af7..21cde33c1100a 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 72d1340abe3f8..7b933b84a32fa 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 270ac5b6d1a08..3f20f033ec108 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 18b7641ed58dd..52ddf446e86ae 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 323bc3fc28cea..1b4db40dd2853 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 db87a80e177c6..fd7231d300af7 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 76efaaffa16ac..833eb3b60f665 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 8058df710cd94..009b1938e56e0 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 3e24a01b79a98..fad4913f4955e 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 4bb623546e1ea..e7efa5545c098 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 bdd14604d7685..7ee1a579283d7 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 d81089447baa7..67b15bbbeeedd 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 d6f178cdb0d14..94b7301c70af2 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 7f3b79f839b6d..d05773886a14a 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 b522ca9dba846..78dded70133fe 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 6cf363a9adf54..0772b0f6b1306 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 e11fcd6a2fb1a..f3df20a665898 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 112a8f96d6bd9..86125d5bc42ed 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 d3fd08e2cbf8c..15211b43dbd6c 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 8ffa77e55b3d2..6f0d428951bbf 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 95bfdd3f9c0ae..faa6cceba9299 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 d52f3b597a305..8a2b622a9d4b0 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 72d543a4045c6..0fb6a0381c51f 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 66cd6abaeb31d..8e8d64bc31318 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 2b392b8f8dab2..bd3dbfcf830fd 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 51f1f4a359f57..249145c56d437 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 545ec3e0a7612..9788bc248e4c1 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 fefa2d4f79880..caa2c6e9fe3c4 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 c848dd2681549..29beabbc6f8ce 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 ac570d0a015fa..7c30fceafb487 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 e75ffd561fc21..31e873810492b 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 5c400f8a71206..f2d0415240e53 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 b4d1085dd255b..0e938224c48a0 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 c5a366a37667b..d57bd524283e8 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"; @@ -93473,17 +93473,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -93527,7 +93516,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-ecr-public/src/protocols/Aws_json1_1.ts b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts index 3605bd9d376c7..c9469502c9a12 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 74e3d868f1799..1caa2065e77f0 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 79c4b35346723..1b1342d3ea37a 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 6a1435476a6db..55a924f85de77 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 042157955d7dd..80358e5c2b42a 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 ee7f3293cff39..ad0d3a98467ba 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 a5fff84ce5092..e14b301d2c6c5 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 e84f509e7c5ef..4927eb2df5d82 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 254630b26f6f8..66dde5816a357 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 9198c9f70492b..a48433cd22052 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 f2078a9fd6302..11542c9c82de7 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 c10c28bf1d093..c7260ec73b9cd 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 0e16066f1157a..654085e736867 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 bdc3aee5b59fe..45f458ea9ab4a 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 ea17497968cb8..814793b1a577a 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 aa0dac7b09874..58dff7d1d947d 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 77fcfc5f215a9..aa888a72b6b35 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 da65402865334..5b755bc4870e8 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 89b9fa1dc7cb3..b2c3fe7325325 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 fd798b6bc71b2..1a3622dc30265 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 8710be59b1399..16acc5c2371f8 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 4bcb93003fac1..c41cc02f70417 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 265762a2c4288..d179d6456846e 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 07c37d9faa046..12bae6e394edf 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 4c0ae6cf8325b..309bc3323b395 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 5747a3f470c8f..172dc56dcabd1 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 6ad0d97e5f1f1..b065cd8e4e4e6 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 87ca3aae13564..e8f89bdf8141f 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 a01e86f361665..0ecea7326a950 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 5100a6e111130..c74269c9247de 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 46cab57e6d172..8394471812334 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 39b75af8c36b8..a49125877dc08 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 03289b544cdb9..cef4706371c4a 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 e69a907ba5e38..ef548ff8dcc24 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 624c45360b2a4..a77b7d6b02f2a 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 b4268a7e6ee22..c5a358dd4f1b7 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 8c13deaa831ea..0932bf329d3f2 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 9aaaa413efde2..16658874caedb 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 86e5945944ad4..db686e294597c 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 6077affeca2cd..761cf43f992b9 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 23c75817df1be..923c71a549004 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 705dd8731a119..f6e2d1cafb7cb 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 93cd02c4c1db8..6558c02341046 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 7623e38af33a3..d6007ce7ba37a 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 b134e67195ec8..c6c72b31c7b8a 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 8b315d8f9b00b..ebc9a2019f972 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 ae74154c50cc1..dfdffe1612969 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 171a7e1a174f8..9ee0aa3f1ad81 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 adc867adc12ea..0917d8ad1398c 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 2ba612b6b45b8..1d9460ad73d0d 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 50812fe2b11d4..bc15c53380036 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 9c9daf5a445f3..7c2510278c779 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 691ddb9ae6f93..5c48a69b0c20c 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 3fbf980226f32..274d5ecb89541 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 dd4b6a6463ac4..3b7c1409b405d 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 28298ceccf8bc..4f5182969717e 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 3962f649cb2f9..48c0856fcdc84 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 7cb30c3820401..2567db1a87ad3 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 307de7a328eb4..814845528ef2b 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 fdc5af9116340..671866e70664a 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 3f67d38bd9c9e..f36c1374611cb 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 4cf8041d6221e..b52f96961204d 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 8aa441dc1f32f..8c893f918bab8 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 1d02966cf2ac9..985cbfdaf8b8e 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 647a4f11eddac..4d567956caa32 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 d4a4d0b584210..6fde628b5e330 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 b984a24cf41d8..6d05c1fa64995 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 91ce0a1dfda3d..a8b91dbbdc94f 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 2b90463d86a80..913617dcf3e40 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 dd8ecf323d888..e4882fc501139 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 d963a42bbee5c..9401fad5811b9 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 8c9e2b835eb36..5f2415b79d220 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 5cd94967bf046..25e57645273f3 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 b8f88638b0269..2842079a0a4cb 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 65f1ab4fe9606..fe157893426fd 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 51cec8294df35..a4f589c00c924 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 ff2aaa2c27933..9257fd139a6e9 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 3745bec105ac2..0f43432920af4 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 553d8f8e068b2..08fb6078de134 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 43c6c7f202f1e..37b8abc6fb0a9 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 9b15ec50dc9a3..25e76b1a6e718 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 775430b7d98dd..d96649121a899 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 67238346e7e1c..2946cc262bad0 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 190993b75c191..f33a17a076b6c 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"; @@ -8223,17 +8223,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into 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 0db79f19f9998..c39f45d78e3a2 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 bec037615ba79..05c79b971f201 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 e8c14af56b67b..a0bf45665e9a3 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 676de38513737..798ca371574d3 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 4fac14d307992..457503ae9f3a2 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 ad3f3d0108b02..7a546acd3772f 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 cb7c78038503c..d1eb0a4ed21a5 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 4acd61393ae09..aa08ef9093e1a 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 ae654cd8c4d77..69aa21cd95bd6 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 66849f75d9564..a2cccd5cca7e8 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 a06ad8f14acaa..f29a00900dce1 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 fa794454cca03..353756a7fa5a8 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 37f125b7e826c..03e66d0bdc065 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 8ac3af437efad..9608b3cf95e2f 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 dd65045d44904..5d641e241c732 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 a2de3a6ffbe93..b5920529c190a 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 07c77e33ad7fd..7c83fee512e92 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 4a56c71c4f477..1648300d9825f 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 f173b76b78a47..5fd6cc9fd6b84 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 014d643c4417a..580da378ebb76 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 9729b5587814a..04da23dcdee0e 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 40ba4f1099ea7..ec783c02b870c 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 60bd232554055..5e88687af272f 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 49223126a2a20..96fde57069aba 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 21198d5cb1870..298476866ed5a 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 0d5697edc2c8d..d3589e5724bc8 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 3ac73b547766e..342ac671ccc0b 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 facdcdbb5bc56..683e8be4373a6 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 0c28999641451..33d4e39c177c7 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 2f6e765e7e01f..684ed7c9bb24e 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 ae0bdd99d62f8..b4cabe409b0a7 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 1f6219cf350dd..c6629148502d6 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 9c5877baf2447..3e80d9945b1a3 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 36eb98f13ae31..5079c0d646089 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 e3b4901882550..f83e0e80bc3a0 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 a000606a32466..b24f680fc4d78 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 ca72487772938..333a271b04795 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 720f7ec2ccb52..9da2429f2ac7e 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 3f8e4d3e5943c..5ee06f068828f 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 e0a9974dd398b..7df76109b4435 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 6e5ad392d7598..728f443f71e42 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 36b167c8fe0af..9e81dd735d9a3 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 ab0657a7437ea..24675c3b88d6f 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 2de08c32f8951..ecb92047a3302 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 7fbb63c035841..609018c38b403 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 345c876159a0d..40c66cc203fa2 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 8f8f49974b024..4480a15fea077 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 3e3499d485e5b..4d7eecd2f82c5 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 3f6e05e7b5ddf..03a7b777ac8ef 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 76cd102ccce56..e230af391cbe2 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 ff060dcd46ae0..32cf3a42b6160 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 4b1b305e86c85..4d6411020d949 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 f2ddeb910f95d..34df7b3e5b717 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 2da898ee2611b..e9ae3bebca798 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 fe2f58ddbfc02..6fc473316f29a 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 8a75fa4687b87..98a2d2ad5a20d 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 1da57228fa753..ff998bb1e1e2e 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 536a0bb042134..f1aa1217a8741 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 7b2f0087cb2bb..c76fe94b11291 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 38316f3096286..fb3624264ee59 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 5fb6f181589d3..1960b415da0db 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 41e14aa259748..0c1ddfbc3a49e 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 8929813232f1f..bf59c2ca0d5ba 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 bc440ecda26c3..ed3908c6efa41 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 2ccee79c21f84..7544bee546ac7 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 c25c45972a416..12e20cf148755 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 aec34e91f6f52..e8740688ca939 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 3baf534f093b0..01d29312b7c30 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 0332c98f6f042..838f050d14d73 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 8806eba7689d6..bcbc61d259e67 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 e57d2c8eada74..b68654076cdb2 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 5de7f5b514f13..7012cff1f07f3 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 0e04cd98525d2..c5dc36ceba54f 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 699d79e0dcffc..c4102fbbac3e7 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 4adbe78a54054..1beeb7ea95a82 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 c8cd09d3683e4..b16ebb5a1e190 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 816a7c0b82fd7..ba794c933bafb 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 987c647cec9ec..e79e485ae1285 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 d625f96b6b499..e6dd5ed0dc744 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 d840ffeb4ae09..11897a3a3d925 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 9976c2669fadc..8192695200aa6 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"; @@ -20621,17 +20621,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into string with utf-8. const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); @@ -20675,7 +20664,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-rekognition/src/protocols/Aws_json1_1.ts b/clients/client-rekognition/src/protocols/Aws_json1_1.ts index e28af65aa3eec..84854b01e3d26 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 e21bdfa1d813c..0ca9d8791934f 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 fda608c4db2cf..a2d3f5b5ad6d4 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 48f08a4637bbc..048d80f911c64 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 61e0bc2f9641b..53b7c789df9a5 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 00bb9a0cd3d34..843dda1a798dd 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 fdbddcf3ed361..cd335ae67f4ae 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 4eb7c45d44483..c26bcee7dbb5e 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 413973fa54fe2..54445353eebe1 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 0636546ea546e..791cab72b6141 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 4844339474fd8..590b77cd34f19 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 c669fe043bdbd..b9cc3d38c6328 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 38cffcfd0ce71..33e10431854fc 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 117cdf0759196..8bd03b93fdbdb 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 b615a41bf2e88..4584b232051ca 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 e900e91ff61aa..f59d1a71ea2a4 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 17ba2ba6568ea..bca69a518d44a 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 23562c511fe94..0f61073c6d741 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 b0d6a2f3226e0..8c09e526c31ba 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 25a5b410c6e16..585eb3834e402 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 63fe31735e879..a3f52dec279e9 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 2e8c12fcbfec6..86afc0b00a517 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 07b714291bfc3..866494794492e 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 5d24a7b01d1d0..373b118614656 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 a903e626b4ea5..7e4bd0d5b1181 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 c2aa7148294d8..549aee50bd530 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 656a11c2865db..09282195bcfb1 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 b9302f074f305..0b0ad73b9cdc8 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 3cc5bd17fccab..85f7cda8fc0b2 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 6d553bf5a38e5..a5837ce41d687 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 4b9757aadde71..5f714cc8c9973 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 d6af45e8812a4..9e4f5c69418e3 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"; @@ -28239,17 +28239,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ cfId: output.headers["x-amz-cf-id"], }); -// Collect low-level response body stream to Uint8Array. -const collectBody = async ( - streamBody: any = new Uint8Array(), - context: __SerdeContext -): Promise<__Uint8ArrayBlobAdapter> => { - if (streamBody instanceof Uint8Array) { - return __Uint8ArrayBlobAdapter.mutate(streamBody); - } - return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); -}; - // Encode Uint8Array data into 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 35565668ebbce..6c2eefa1a0e54 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 5975d42e1bab2..be3e070b74572 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 0a1a55c3b0d3f..d47c99079cdd4 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 e3b1b7dfffb76..5bd9071670d30 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 bd17986b8e0c5..ab233b46329c8 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 6f4d7a01fa899..77dad23c2b8fe 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 a9174142676fd..185e9a3189cc8 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 0e688ab7e8625..841c6b0caa245 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 133ea3218da68..101a8a1f86cdd 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 4b62cf601bb2e..e9468d7ed62c6 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 ff74bd8eb507e..64d0b7c4b4546 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 cdc85ee18d49e..f7590da463936 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 cf5d3f6414701..0ee156e0052dc 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 571f340b99f7e..bca81239eb2fe 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 fefd7369c7127..6d00e7bdf7f17 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 40d6b6737316d..b7da2d04eb2f0 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 c029bc6d753ba..0b2800167d3ff 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 980b4c58ae542..4d0194118ee50 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 e98285004ad57..878e77bafa018 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 7cb8c266ae648..fdc2f81d52888 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 8a10feede3c83..3f77ab161777b 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 42b71bb5e25db..abbfe06ff3922 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 b9ed495699afa..6f384e173446a 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 e7f191bc52e5c..1f464432b7b10 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 c4b259dfd40b0..fc66beef4879e 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 698903652270a..095b50d704f52 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 391e30f055576..734e5da5bcefe 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 b656fb8c27ea0..1b887f97a911e 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 a47098d65f8e0..5829b60a9c887 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 6c457736d0ddb..edbe8ad705666 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 4705a533560be..2d65f12f3072b 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 f2f0e310d01f0..bec8d57b6ba5d 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 3b7a87d786b20..4d643484cf5b9 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 ffeac83965193..2c68e9c73eb00 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 7a18beb02f8ea..e3f710e668029 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 7df22c5b30293..9e63fc3fa3dc3 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 c5115711599d7..3ce171bd33e0e 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 cf7d2fc747ec7..c1820dc10d13c 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 27c27480f1ce5..79d5f2b42ec32 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 29dd8db9972f1..19568a14f8103 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 512072844e2b8..cb023c6cd2e82 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 0eadf11f5ca5e..8ed1f0aede5a5 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 458281e70aa1a..416a0bb9f5c4e 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 7da11cc59a517..916d3e415b8b3 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 46bca2f405c88..237c5afc4b7ab 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 606252ac0f8a5..744d85503b178 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 9ea649665a3ec..b825ffb1c59f6 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 1351cbccd0355..a0d38b389156d 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 df07eb852af16..24ae6d8c564ca 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 14e802d119f07..7136705877b02 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 0a448a99198eb..536430cce9771 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 b0cd80d477d9a..042978e7031f2 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 a5a12ef051545..4cd28042f0f17 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 016c6f38663ef..c66627085d753 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 50067c6306d7d..604f230ab84eb 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 f3661a8ea5076..c543b911c0d84 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 9516b3ff59f51..068ac44825433 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 ebffad6741d40..d35c031769534 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 d3da069373e65..b17b7d0f0cdef 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 702fae899709d..cd6d1ea1a19b8 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 62949ab7f1095..a5820794e285a 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 0000000000000..18755a8fb9f41 --- /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 0000000000000..5e8baf49145c1 --- /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 344c64f9d1474..5f5538bddd29c 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 c9c27d248a1aa..d8f071c19654f 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 2d02ae4df8a42..f587c712c4312 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 da75903b7eafb..a159bd7df32f9 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 5f861b15bd997..2391f77b761db 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 140305e3a86eb..181483ee5a9a1 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 bfec49f2b33e2..921bb2609dc4b 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 b91e329796ad6..c2f0841648200 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 a5926b68ff86b..225eaaa262946 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 1a3ee11f42d98..f1b370d0cf624 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 fa5f1351eb97b..6539a29d7aed6 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/package.json b/private/aws-protocoltests-restjson/package.json index 1073bd8bed52b..2cd55842fd776 100644 --- a/private/aws-protocoltests-restjson/package.json +++ b/private/aws-protocoltests-restjson/package.json @@ -47,6 +47,7 @@ "@aws-sdk/util-defaults-mode-browser": "*", "@aws-sdk/util-defaults-mode-node": "*", "@aws-sdk/util-retry": "*", + "@aws-sdk/util-stream": "*", "@aws-sdk/util-stream-browser": "*", "@aws-sdk/util-stream-node": "*", "@aws-sdk/util-user-agent-browser": "*", diff --git a/private/aws-protocoltests-restjson/src/endpoints.ts b/private/aws-protocoltests-restjson/src/endpoints.ts index 4dba95939fc20..e5637421edaf4 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 8098fcf2435cd..c085dec6d1ff4 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 ed3c3a4397750..9ac5d64be524f 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 3976a45b2d938..0aeb57d9686c2 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 88834ed041722..ab399b8d60efb 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 675c7a3769881..2be50f5e7ea00 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 1af579b8f7be1..753d5aba38887 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));