Skip to content

feat: update clients #717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
247 changes: 131 additions & 116 deletions clients/client-acm-pca/protocols/Aws_json1_1.ts

Large diffs are not rendered by default.

170 changes: 93 additions & 77 deletions clients/client-acm/protocols/Aws_json1_1.ts

Large diffs are not rendered by default.

623 changes: 313 additions & 310 deletions clients/client-alexa-for-business/protocols/Aws_json1_1.ts

Large diffs are not rendered by default.

548 changes: 190 additions & 358 deletions clients/client-amplify/protocols/Aws_restJson1_1.ts

Large diffs are not rendered by default.

1,679 changes: 548 additions & 1,131 deletions clients/client-api-gateway/protocols/Aws_restJson1_1.ts

Large diffs are not rendered by default.

58 changes: 30 additions & 28 deletions clients/client-apigatewaymanagementapi/protocols/Aws_restJson1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ async function deserializeAws_restJson1_1DeleteConnectionCommandError(
output: __HttpResponse,
context: __SerdeContext
): Promise<DeleteConnectionCommandOutput> {
const data: any = await parseBody(output.body, context);
const parsedOutput: any = {
...output,
body: data
};
let response: __SmithyException & __MetadataBearer;
let errorCode: String = "UnknownError";
if (output.headers["x-amzn-errortype"]) {
Expand All @@ -149,21 +144,21 @@ async function deserializeAws_restJson1_1DeleteConnectionCommandError(
case "ForbiddenException":
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
response = await deserializeAws_restJson1_1ForbiddenExceptionResponse(
parsedOutput,
output,
context
);
break;
case "GoneException":
case "com.amazonaws.apigatewaymanagementapi#GoneException":
response = await deserializeAws_restJson1_1GoneExceptionResponse(
parsedOutput,
output,
context
);
break;
case "LimitExceededException":
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
response = await deserializeAws_restJson1_1LimitExceededExceptionResponse(
parsedOutput,
output,
context
);
break;
Expand Down Expand Up @@ -211,11 +206,6 @@ async function deserializeAws_restJson1_1GetConnectionCommandError(
output: __HttpResponse,
context: __SerdeContext
): Promise<GetConnectionCommandOutput> {
const data: any = await parseBody(output.body, context);
const parsedOutput: any = {
...output,
body: data
};
let response: __SmithyException & __MetadataBearer;
let errorCode: String = "UnknownError";
if (output.headers["x-amzn-errortype"]) {
Expand All @@ -225,21 +215,21 @@ async function deserializeAws_restJson1_1GetConnectionCommandError(
case "ForbiddenException":
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
response = await deserializeAws_restJson1_1ForbiddenExceptionResponse(
parsedOutput,
output,
context
);
break;
case "GoneException":
case "com.amazonaws.apigatewaymanagementapi#GoneException":
response = await deserializeAws_restJson1_1GoneExceptionResponse(
parsedOutput,
output,
context
);
break;
case "LimitExceededException":
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
response = await deserializeAws_restJson1_1LimitExceededExceptionResponse(
parsedOutput,
output,
context
);
break;
Expand Down Expand Up @@ -273,11 +263,6 @@ async function deserializeAws_restJson1_1PostToConnectionCommandError(
output: __HttpResponse,
context: __SerdeContext
): Promise<PostToConnectionCommandOutput> {
const data: any = await parseBody(output.body, context);
const parsedOutput: any = {
...output,
body: data
};
let response: __SmithyException & __MetadataBearer;
let errorCode: String = "UnknownError";
if (output.headers["x-amzn-errortype"]) {
Expand All @@ -287,28 +272,28 @@ async function deserializeAws_restJson1_1PostToConnectionCommandError(
case "ForbiddenException":
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
response = await deserializeAws_restJson1_1ForbiddenExceptionResponse(
parsedOutput,
output,
context
);
break;
case "GoneException":
case "com.amazonaws.apigatewaymanagementapi#GoneException":
response = await deserializeAws_restJson1_1GoneExceptionResponse(
parsedOutput,
output,
context
);
break;
case "LimitExceededException":
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
response = await deserializeAws_restJson1_1LimitExceededExceptionResponse(
parsedOutput,
output,
context
);
break;
case "PayloadTooLargeException":
case "com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException":
response = await deserializeAws_restJson1_1PayloadTooLargeExceptionResponse(
parsedOutput,
output,
context
);
break;
Expand Down Expand Up @@ -368,7 +353,7 @@ const deserializeAws_restJson1_1PayloadTooLargeExceptionResponse = async (
$metadata: deserializeMetadata(output),
Message: undefined
};
const data: any = output.body;
const data: any = await parseBody(output.body, context);
if (data.message !== undefined) {
contents.Message = data.message;
}
Expand Down Expand Up @@ -399,9 +384,26 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
requestId: output.headers["x-amzn-requestid"]
});

// Collect low-level response body stream to Uint8Array.
const collectBody = (
streamBody: any,
context: __SerdeContext
): Promise<Uint8Array> => {
return context.streamCollector(streamBody) || new Uint8Array();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (
streamBody: any,
context: __SerdeContext
): Promise<string> => {
return collectBody(streamBody, context).then(body =>
context.utf8Encoder(body)
);
};

const parseBody = (streamBody: any, context: __SerdeContext): any => {
return context.streamCollector(streamBody).then((body: any) => {
const encoded = context.utf8Encoder(body);
return collectBodyString(streamBody, context).then(encoded => {
if (encoded.length) {
return JSON.parse(encoded);
}
Expand Down
Loading