Skip to content

Commit dc57732

Browse files
chore: assert deserialized types are correct (#2515)
1 parent a8502a7 commit dc57732

File tree

278 files changed

+42179
-58722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+42179
-58722
lines changed

clients/client-accessanalyzer/protocols/Aws_restJson1.ts

Lines changed: 134 additions & 181 deletions
Large diffs are not rendered by default.

clients/client-acm-pca/protocols/Aws_json1_1.ts

Lines changed: 96 additions & 131 deletions
Large diffs are not rendered by default.

clients/client-acm/protocols/Aws_json1_1.ts

Lines changed: 63 additions & 88 deletions
Large diffs are not rendered by default.

clients/client-alexa-for-business/protocols/Aws_json1_1.ts

Lines changed: 254 additions & 358 deletions
Large diffs are not rendered by default.

clients/client-amp/protocols/Aws_restJson1.ts

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2323
import {
2424
SmithyException as __SmithyException,
25+
expectString as __expectString,
2526
extendedEncodeURIComponent as __extendedEncodeURIComponent,
2627
} from "@aws-sdk/smithy-client";
2728
import {
@@ -191,13 +192,13 @@ export const deserializeAws_restJson1CreateWorkspaceCommand = async (
191192
};
192193
const data: any = await parseBody(output.body, context);
193194
if (data.arn !== undefined && data.arn !== null) {
194-
contents.arn = data.arn;
195+
contents.arn = __expectString(data.arn);
195196
}
196197
if (data.status !== undefined && data.status !== null) {
197198
contents.status = deserializeAws_restJson1WorkspaceStatus(data.status, context);
198199
}
199200
if (data.workspaceId !== undefined && data.workspaceId !== null) {
200-
contents.workspaceId = data.workspaceId;
201+
contents.workspaceId = __expectString(data.workspaceId);
201202
}
202203
return Promise.resolve(contents);
203204
};
@@ -463,7 +464,7 @@ export const deserializeAws_restJson1ListWorkspacesCommand = async (
463464
};
464465
const data: any = await parseBody(output.body, context);
465466
if (data.nextToken !== undefined && data.nextToken !== null) {
466-
contents.nextToken = data.nextToken;
467+
contents.nextToken = __expectString(data.nextToken);
467468
}
468469
if (data.workspaces !== undefined && data.workspaces !== null) {
469470
contents.workspaces = deserializeAws_restJson1WorkspaceSummaryList(data.workspaces, context);
@@ -643,7 +644,7 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
643644
};
644645
const data: any = parsedOutput.body;
645646
if (data.message !== undefined && data.message !== null) {
646-
contents.message = data.message;
647+
contents.message = __expectString(data.message);
647648
}
648649
return contents;
649650
};
@@ -662,13 +663,13 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (
662663
};
663664
const data: any = parsedOutput.body;
664665
if (data.message !== undefined && data.message !== null) {
665-
contents.message = data.message;
666+
contents.message = __expectString(data.message);
666667
}
667668
if (data.resourceId !== undefined && data.resourceId !== null) {
668-
contents.resourceId = data.resourceId;
669+
contents.resourceId = __expectString(data.resourceId);
669670
}
670671
if (data.resourceType !== undefined && data.resourceType !== null) {
671-
contents.resourceType = data.resourceType;
672+
contents.resourceType = __expectString(data.resourceType);
672673
}
673674
return contents;
674675
};
@@ -690,7 +691,7 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (
690691
}
691692
const data: any = parsedOutput.body;
692693
if (data.message !== undefined && data.message !== null) {
693-
contents.message = data.message;
694+
contents.message = __expectString(data.message);
694695
}
695696
return contents;
696697
};
@@ -709,13 +710,13 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
709710
};
710711
const data: any = parsedOutput.body;
711712
if (data.message !== undefined && data.message !== null) {
712-
contents.message = data.message;
713+
contents.message = __expectString(data.message);
713714
}
714715
if (data.resourceId !== undefined && data.resourceId !== null) {
715-
contents.resourceId = data.resourceId;
716+
contents.resourceId = __expectString(data.resourceId);
716717
}
717718
if (data.resourceType !== undefined && data.resourceType !== null) {
718-
contents.resourceType = data.resourceType;
719+
contents.resourceType = __expectString(data.resourceType);
719720
}
720721
return contents;
721722
};
@@ -736,19 +737,19 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (
736737
};
737738
const data: any = parsedOutput.body;
738739
if (data.message !== undefined && data.message !== null) {
739-
contents.message = data.message;
740+
contents.message = __expectString(data.message);
740741
}
741742
if (data.quotaCode !== undefined && data.quotaCode !== null) {
742-
contents.quotaCode = data.quotaCode;
743+
contents.quotaCode = __expectString(data.quotaCode);
743744
}
744745
if (data.resourceId !== undefined && data.resourceId !== null) {
745-
contents.resourceId = data.resourceId;
746+
contents.resourceId = __expectString(data.resourceId);
746747
}
747748
if (data.resourceType !== undefined && data.resourceType !== null) {
748-
contents.resourceType = data.resourceType;
749+
contents.resourceType = __expectString(data.resourceType);
749750
}
750751
if (data.serviceCode !== undefined && data.serviceCode !== null) {
751-
contents.serviceCode = data.serviceCode;
752+
contents.serviceCode = __expectString(data.serviceCode);
752753
}
753754
return contents;
754755
};
@@ -772,13 +773,13 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (
772773
}
773774
const data: any = parsedOutput.body;
774775
if (data.message !== undefined && data.message !== null) {
775-
contents.message = data.message;
776+
contents.message = __expectString(data.message);
776777
}
777778
if (data.quotaCode !== undefined && data.quotaCode !== null) {
778-
contents.quotaCode = data.quotaCode;
779+
contents.quotaCode = __expectString(data.quotaCode);
779780
}
780781
if (data.serviceCode !== undefined && data.serviceCode !== null) {
781-
contents.serviceCode = data.serviceCode;
782+
contents.serviceCode = __expectString(data.serviceCode);
782783
}
783784
return contents;
784785
};
@@ -800,10 +801,10 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (
800801
contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
801802
}
802803
if (data.message !== undefined && data.message !== null) {
803-
contents.message = data.message;
804+
contents.message = __expectString(data.message);
804805
}
805806
if (data.reason !== undefined && data.reason !== null) {
806-
contents.reason = data.reason;
807+
contents.reason = __expectString(data.reason);
807808
}
808809
return contents;
809810
};
@@ -813,8 +814,8 @@ const deserializeAws_restJson1ValidationExceptionField = (
813814
context: __SerdeContext
814815
): ValidationExceptionField => {
815816
return {
816-
message: output.message !== undefined && output.message !== null ? output.message : undefined,
817-
name: output.name !== undefined && output.name !== null ? output.name : undefined,
817+
message: __expectString(output.message),
818+
name: __expectString(output.name),
818819
} as any;
819820
};
820821

@@ -834,34 +835,31 @@ const deserializeAws_restJson1ValidationExceptionFieldList = (
834835

835836
const deserializeAws_restJson1WorkspaceDescription = (output: any, context: __SerdeContext): WorkspaceDescription => {
836837
return {
837-
alias: output.alias !== undefined && output.alias !== null ? output.alias : undefined,
838-
arn: output.arn !== undefined && output.arn !== null ? output.arn : undefined,
838+
alias: __expectString(output.alias),
839+
arn: __expectString(output.arn),
839840
createdAt:
840841
output.createdAt !== undefined && output.createdAt !== null
841842
? new Date(Math.round(output.createdAt * 1000))
842843
: undefined,
843-
prometheusEndpoint:
844-
output.prometheusEndpoint !== undefined && output.prometheusEndpoint !== null
845-
? output.prometheusEndpoint
846-
: undefined,
844+
prometheusEndpoint: __expectString(output.prometheusEndpoint),
847845
status:
848846
output.status !== undefined && output.status !== null
849847
? deserializeAws_restJson1WorkspaceStatus(output.status, context)
850848
: undefined,
851-
workspaceId: output.workspaceId !== undefined && output.workspaceId !== null ? output.workspaceId : undefined,
849+
workspaceId: __expectString(output.workspaceId),
852850
} as any;
853851
};
854852

855853
const deserializeAws_restJson1WorkspaceStatus = (output: any, context: __SerdeContext): WorkspaceStatus => {
856854
return {
857-
statusCode: output.statusCode !== undefined && output.statusCode !== null ? output.statusCode : undefined,
855+
statusCode: __expectString(output.statusCode),
858856
} as any;
859857
};
860858

861859
const deserializeAws_restJson1WorkspaceSummary = (output: any, context: __SerdeContext): WorkspaceSummary => {
862860
return {
863-
alias: output.alias !== undefined && output.alias !== null ? output.alias : undefined,
864-
arn: output.arn !== undefined && output.arn !== null ? output.arn : undefined,
861+
alias: __expectString(output.alias),
862+
arn: __expectString(output.arn),
865863
createdAt:
866864
output.createdAt !== undefined && output.createdAt !== null
867865
? new Date(Math.round(output.createdAt * 1000))
@@ -870,7 +868,7 @@ const deserializeAws_restJson1WorkspaceSummary = (output: any, context: __SerdeC
870868
output.status !== undefined && output.status !== null
871869
? deserializeAws_restJson1WorkspaceStatus(output.status, context)
872870
: undefined,
873-
workspaceId: output.workspaceId !== undefined && output.workspaceId !== null ? output.workspaceId : undefined,
871+
workspaceId: __expectString(output.workspaceId),
874872
} as any;
875873
};
876874

0 commit comments

Comments
 (0)