Skip to content
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

chore(clients): parse date-times with offsets #4385

Merged
merged 1 commit into from
Jan 30, 2023
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
66 changes: 43 additions & 23 deletions clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
expectUnion as __expectUnion,
extendedEncodeURIComponent as __extendedEncodeURIComponent,
map as __map,
parseRfc3339DateTime as __parseRfc3339DateTime,
parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset,
resolvedPath as __resolvedPath,
strictParseInt32 as __strictParseInt32,
throwDefaultError,
Expand Down Expand Up @@ -3064,7 +3064,8 @@ const deserializeAws_restJson1AccessPreview = (output: any, context: __SerdeCont
output.configurations != null
? deserializeAws_restJson1ConfigurationsMap(output.configurations, context)
: undefined,
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
id: __expectString(output.id),
status: __expectString(output.status),
statusReason:
Expand All @@ -3080,7 +3081,8 @@ const deserializeAws_restJson1AccessPreviewFinding = (output: any, context: __Se
changeType: __expectString(output.changeType),
condition:
output.condition != null ? deserializeAws_restJson1ConditionKeyMap(output.condition, context) : undefined,
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
error: __expectString(output.error),
existingFindingId: __expectString(output.existingFindingId),
existingFindingStatus: __expectString(output.existingFindingStatus),
Expand Down Expand Up @@ -3134,7 +3136,8 @@ const deserializeAws_restJson1AccessPreviewStatusReason = (
const deserializeAws_restJson1AccessPreviewSummary = (output: any, context: __SerdeContext): AccessPreviewSummary => {
return {
analyzerArn: __expectString(output.analyzerArn),
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
id: __expectString(output.id),
status: __expectString(output.status),
statusReason:
Expand Down Expand Up @@ -3169,16 +3172,19 @@ const deserializeAws_restJson1ActionList = (output: any, context: __SerdeContext
const deserializeAws_restJson1AnalyzedResource = (output: any, context: __SerdeContext): AnalyzedResource => {
return {
actions: output.actions != null ? deserializeAws_restJson1ActionList(output.actions, context) : undefined,
analyzedAt: output.analyzedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.analyzedAt)) : undefined,
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
analyzedAt:
output.analyzedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.analyzedAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
error: __expectString(output.error),
isPublic: __expectBoolean(output.isPublic),
resourceArn: __expectString(output.resourceArn),
resourceOwnerAccount: __expectString(output.resourceOwnerAccount),
resourceType: __expectString(output.resourceType),
sharedVia: output.sharedVia != null ? deserializeAws_restJson1SharedViaList(output.sharedVia, context) : undefined,
status: __expectString(output.status),
updatedAt: output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.updatedAt)) : undefined,
updatedAt:
output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.updatedAt)) : undefined,
} as any;
};

Expand Down Expand Up @@ -3223,11 +3229,12 @@ const deserializeAws_restJson1AnalyzersList = (output: any, context: __SerdeCont
const deserializeAws_restJson1AnalyzerSummary = (output: any, context: __SerdeContext): AnalyzerSummary => {
return {
arn: __expectString(output.arn),
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
lastResourceAnalyzed: __expectString(output.lastResourceAnalyzed),
lastResourceAnalyzedAt:
output.lastResourceAnalyzedAt != null
? __expectNonNull(__parseRfc3339DateTime(output.lastResourceAnalyzedAt))
? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastResourceAnalyzedAt))
: undefined,
name: __expectString(output.name),
status: __expectString(output.status),
Expand All @@ -3252,17 +3259,20 @@ const deserializeAws_restJson1ArchiveRulesList = (output: any, context: __SerdeC

const deserializeAws_restJson1ArchiveRuleSummary = (output: any, context: __SerdeContext): ArchiveRuleSummary => {
return {
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
filter: output.filter != null ? deserializeAws_restJson1FilterCriteriaMap(output.filter, context) : undefined,
ruleName: __expectString(output.ruleName),
updatedAt: output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.updatedAt)) : undefined,
updatedAt:
output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.updatedAt)) : undefined,
} as any;
};

const deserializeAws_restJson1CloudTrailProperties = (output: any, context: __SerdeContext): CloudTrailProperties => {
return {
endTime: output.endTime != null ? __expectNonNull(__parseRfc3339DateTime(output.endTime)) : undefined,
startTime: output.startTime != null ? __expectNonNull(__parseRfc3339DateTime(output.startTime)) : undefined,
endTime: output.endTime != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.endTime)) : undefined,
startTime:
output.startTime != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.startTime)) : undefined,
trailProperties:
output.trailProperties != null
? deserializeAws_restJson1TrailPropertiesList(output.trailProperties, context)
Expand Down Expand Up @@ -3433,10 +3443,12 @@ const deserializeAws_restJson1FilterCriteriaMap = (output: any, context: __Serde
const deserializeAws_restJson1Finding = (output: any, context: __SerdeContext): Finding => {
return {
action: output.action != null ? deserializeAws_restJson1ActionList(output.action, context) : undefined,
analyzedAt: output.analyzedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.analyzedAt)) : undefined,
analyzedAt:
output.analyzedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.analyzedAt)) : undefined,
condition:
output.condition != null ? deserializeAws_restJson1ConditionKeyMap(output.condition, context) : undefined,
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
error: __expectString(output.error),
id: __expectString(output.id),
isPublic: __expectBoolean(output.isPublic),
Expand All @@ -3446,7 +3458,8 @@ const deserializeAws_restJson1Finding = (output: any, context: __SerdeContext):
resourceType: __expectString(output.resourceType),
sources: output.sources != null ? deserializeAws_restJson1FindingSourceList(output.sources, context) : undefined,
status: __expectString(output.status),
updatedAt: output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.updatedAt)) : undefined,
updatedAt:
output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.updatedAt)) : undefined,
} as any;
};

Expand Down Expand Up @@ -3491,10 +3504,12 @@ const deserializeAws_restJson1FindingSourceList = (output: any, context: __Serde
const deserializeAws_restJson1FindingSummary = (output: any, context: __SerdeContext): FindingSummary => {
return {
action: output.action != null ? deserializeAws_restJson1ActionList(output.action, context) : undefined,
analyzedAt: output.analyzedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.analyzedAt)) : undefined,
analyzedAt:
output.analyzedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.analyzedAt)) : undefined,
condition:
output.condition != null ? deserializeAws_restJson1ConditionKeyMap(output.condition, context) : undefined,
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
error: __expectString(output.error),
id: __expectString(output.id),
isPublic: __expectBoolean(output.isPublic),
Expand All @@ -3504,7 +3519,8 @@ const deserializeAws_restJson1FindingSummary = (output: any, context: __SerdeCon
resourceType: __expectString(output.resourceType),
sources: output.sources != null ? deserializeAws_restJson1FindingSourceList(output.sources, context) : undefined,
status: __expectString(output.status),
updatedAt: output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.updatedAt)) : undefined,
updatedAt:
output.updatedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.updatedAt)) : undefined,
} as any;
};

Expand Down Expand Up @@ -3565,10 +3581,12 @@ const deserializeAws_restJson1InternetConfiguration = (output: any, context: __S

const deserializeAws_restJson1JobDetails = (output: any, context: __SerdeContext): JobDetails => {
return {
completedOn: output.completedOn != null ? __expectNonNull(__parseRfc3339DateTime(output.completedOn)) : undefined,
completedOn:
output.completedOn != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.completedOn)) : undefined,
jobError: output.jobError != null ? deserializeAws_restJson1JobError(output.jobError, context) : undefined,
jobId: __expectString(output.jobId),
startedOn: output.startedOn != null ? __expectNonNull(__parseRfc3339DateTime(output.startedOn)) : undefined,
startedOn:
output.startedOn != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.startedOn)) : undefined,
status: __expectString(output.status),
} as any;
};
Expand Down Expand Up @@ -3734,10 +3752,12 @@ const deserializeAws_restJson1PathElementList = (output: any, context: __SerdeCo

const deserializeAws_restJson1PolicyGeneration = (output: any, context: __SerdeContext): PolicyGeneration => {
return {
completedOn: output.completedOn != null ? __expectNonNull(__parseRfc3339DateTime(output.completedOn)) : undefined,
completedOn:
output.completedOn != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.completedOn)) : undefined,
jobId: __expectString(output.jobId),
principalArn: __expectString(output.principalArn),
startedOn: output.startedOn != null ? __expectNonNull(__parseRfc3339DateTime(output.startedOn)) : undefined,
startedOn:
output.startedOn != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.startedOn)) : undefined,
status: __expectString(output.status),
} as any;
};
Expand Down
14 changes: 9 additions & 5 deletions clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
extendedEncodeURIComponent as __extendedEncodeURIComponent,
limitedParseFloat32 as __limitedParseFloat32,
map as __map,
parseRfc3339DateTime as __parseRfc3339DateTime,
parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset,
resolvedPath as __resolvedPath,
serializeFloat as __serializeFloat,
throwDefaultError,
Expand Down Expand Up @@ -2674,11 +2674,13 @@ const deserializeAws_restJson1Component = (output: any, context: __SerdeContext)
? deserializeAws_restJson1ComponentCollectionProperties(output.collectionProperties, context)
: undefined,
componentType: __expectString(output.componentType),
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
environmentName: __expectString(output.environmentName),
events: output.events != null ? deserializeAws_restJson1ComponentEvents(output.events, context) : undefined,
id: __expectString(output.id),
modifiedAt: output.modifiedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.modifiedAt)) : undefined,
modifiedAt:
output.modifiedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.modifiedAt)) : undefined,
name: __expectString(output.name),
overrides:
output.overrides != null ? deserializeAws_restJson1ComponentOverrides(output.overrides, context) : undefined,
Expand Down Expand Up @@ -3337,10 +3339,12 @@ const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): Rec
const deserializeAws_restJson1Theme = (output: any, context: __SerdeContext): Theme => {
return {
appId: __expectString(output.appId),
createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
createdAt:
output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
environmentName: __expectString(output.environmentName),
id: __expectString(output.id),
modifiedAt: output.modifiedAt != null ? __expectNonNull(__parseRfc3339DateTime(output.modifiedAt)) : undefined,
modifiedAt:
output.modifiedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.modifiedAt)) : undefined,
name: __expectString(output.name),
overrides:
output.overrides != null ? deserializeAws_restJson1ThemeValuesList(output.overrides, context) : undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
expectObject as __expectObject,
expectString as __expectString,
map as __map,
parseRfc3339DateTime as __parseRfc3339DateTime,
parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset,
resolvedPath as __resolvedPath,
throwDefaultError,
} from "@aws-sdk/smithy-client";
Expand Down Expand Up @@ -173,13 +173,13 @@ export const deserializeAws_restJson1GetConnectionCommand = async (
});
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
if (data.connectedAt != null) {
contents.ConnectedAt = __expectNonNull(__parseRfc3339DateTime(data.connectedAt));
contents.ConnectedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.connectedAt));
}
if (data.identity != null) {
contents.Identity = deserializeAws_restJson1Identity(data.identity, context);
}
if (data.lastActiveAt != null) {
contents.LastActiveAt = __expectNonNull(__parseRfc3339DateTime(data.lastActiveAt));
contents.LastActiveAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastActiveAt));
}
return contents;
};
Expand Down
Loading