Skip to content

chore(codegen): use Record type instead of Object #3659

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 2 commits into from
Jun 3, 2022
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
12 changes: 6 additions & 6 deletions clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2764,7 +2764,7 @@ const serializeAws_restJson1ConfigurationsMap = (
input: Record<string, Configuration>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -2786,7 +2786,7 @@ const serializeAws_restJson1Criterion = (input: Criterion, context: __SerdeConte
};

const serializeAws_restJson1FilterCriteriaMap = (input: Record<string, Criterion>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -2838,7 +2838,7 @@ const serializeAws_restJson1InternetConfiguration = (input: InternetConfiguratio
};

const serializeAws_restJson1KmsConstraintsMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -2921,7 +2921,7 @@ const serializeAws_restJson1KmsKeyConfiguration = (input: KmsKeyConfiguration, c
};

const serializeAws_restJson1KmsKeyPoliciesMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -2987,7 +2987,7 @@ const serializeAws_restJson1S3AccessPointConfigurationsMap = (
input: Record<string, S3AccessPointConfiguration>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3080,7 +3080,7 @@ const serializeAws_restJson1SqsQueueConfiguration = (input: SqsQueueConfiguratio
};

const serializeAws_restJson1TagsMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6140,7 +6140,7 @@ const serializeAws_json1_1AudioList = (input: Audio[], context: __SerdeContext):
};

const serializeAws_json1_1AuthorizationResult = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-amp/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,7 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (
};

const serializeAws_restJson1TagMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
6 changes: 3 additions & 3 deletions clients/client-amplify/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3846,7 +3846,7 @@ const serializeAws_restJson1CustomRules = (input: CustomRule[], context: __Serde
};

const serializeAws_restJson1EnvironmentVariables = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -3858,7 +3858,7 @@ const serializeAws_restJson1EnvironmentVariables = (input: Record<string, string
};

const serializeAws_restJson1FileMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3888,7 +3888,7 @@ const serializeAws_restJson1SubDomainSettings = (input: SubDomainSetting[], cont
};

const serializeAws_restJson1TagMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
18 changes: 9 additions & 9 deletions clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ const serializeAws_restJson1ComponentBindingProperties = (
input: Record<string, ComponentBindingPropertiesValue>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -1607,7 +1607,7 @@ const serializeAws_restJson1ComponentCollectionProperties = (
input: Record<string, ComponentDataConfiguration>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -1660,7 +1660,7 @@ const serializeAws_restJson1ComponentEvent = (input: ComponentEvent, context: __
};

const serializeAws_restJson1ComponentEvents = (input: Record<string, ComponentEvent>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -1675,7 +1675,7 @@ const serializeAws_restJson1ComponentOverrides = (
input: Record<string, Record<string, string>>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -1687,7 +1687,7 @@ const serializeAws_restJson1ComponentOverrides = (
};

const serializeAws_restJson1ComponentOverridesValue = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -1702,7 +1702,7 @@ const serializeAws_restJson1ComponentProperties = (
input: Record<string, ComponentProperty>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -1791,7 +1791,7 @@ const serializeAws_restJson1ComponentVariants = (input: ComponentVariant[], cont
};

const serializeAws_restJson1ComponentVariantValues = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -1864,7 +1864,7 @@ const serializeAws_restJson1FormBindings = (
input: Record<string, FormBindingElement>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -1948,7 +1948,7 @@ const serializeAws_restJson1SortPropertyList = (input: SortProperty[], context:
};

const serializeAws_restJson1Tags = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
8 changes: 4 additions & 4 deletions clients/client-api-gateway/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13988,7 +13988,7 @@ const serializeAws_restJson1MapOfApiStageThrottleSettings = (
input: Record<string, ThrottleSettings>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -14000,7 +14000,7 @@ const serializeAws_restJson1MapOfApiStageThrottleSettings = (
};

const serializeAws_restJson1MapOfStringToBoolean = (input: Record<string, boolean>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -14012,7 +14012,7 @@ const serializeAws_restJson1MapOfStringToBoolean = (input: Record<string, boolea
};

const serializeAws_restJson1MapOfStringToList = (input: Record<string, string[]>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -14024,7 +14024,7 @@ const serializeAws_restJson1MapOfStringToList = (input: Record<string, string[]>
};

const serializeAws_restJson1MapOfStringToString = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
16 changes: 8 additions & 8 deletions clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8325,7 +8325,7 @@ const serializeAws_restJson1IdentitySourceList = (input: string[], context: __Se
};

const serializeAws_restJson1IntegrationParameters = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -8365,7 +8365,7 @@ const serializeAws_restJson1ResponseParameters = (
input: Record<string, Record<string, string>>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -8377,7 +8377,7 @@ const serializeAws_restJson1ResponseParameters = (
};

const serializeAws_restJson1RouteModels = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -8392,7 +8392,7 @@ const serializeAws_restJson1RouteParameters = (
input: Record<string, ParameterConstraints>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -8418,7 +8418,7 @@ const serializeAws_restJson1RouteSettings = (input: RouteSettings, context: __Se
};

const serializeAws_restJson1RouteSettingsMap = (input: Record<string, RouteSettings>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -8441,7 +8441,7 @@ const serializeAws_restJson1SecurityGroupIdList = (input: string[], context: __S
};

const serializeAws_restJson1StageVariablesMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -8464,7 +8464,7 @@ const serializeAws_restJson1SubnetIdList = (input: string[], context: __SerdeCon
};

const serializeAws_restJson1Tags = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -8476,7 +8476,7 @@ const serializeAws_restJson1Tags = (input: Record<string, string>, context: __Se
};

const serializeAws_restJson1TemplateMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-appconfig/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3680,7 +3680,7 @@ const serializeAws_restJson1MonitorList = (input: Monitor[], context: __SerdeCon
};

const serializeAws_restJson1TagMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
12 changes: 6 additions & 6 deletions clients/client-appflow/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2586,7 +2586,7 @@ const serializeAws_restJson1ConnectorTypeList = (input: (ConnectorType | string)
};

const serializeAws_restJson1CredentialsMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -2690,7 +2690,7 @@ const serializeAws_restJson1CustomerProfilesDestinationProperties = (
};

const serializeAws_restJson1CustomProperties = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3113,7 +3113,7 @@ const serializeAws_restJson1PrefixConfig = (input: PrefixConfig, context: __Serd
};

const serializeAws_restJson1ProfilePropertiesMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3588,7 +3588,7 @@ const serializeAws_restJson1SuccessResponseHandlingConfig = (
};

const serializeAws_restJson1TagMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3619,7 +3619,7 @@ const serializeAws_restJson1Task = (input: Task, context: __SerdeContext): any =

const serializeAws_restJson1TaskPropertiesMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce(
(acc: { [key: string]: any }, [key, value]: [OperatorPropertiesKeys | string, any]) => {
(acc: Record<string, any>, [key, value]: [OperatorPropertiesKeys | string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3647,7 +3647,7 @@ const serializeAws_restJson1TokenUrlCustomProperties = (
input: Record<string, string>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ const serializeAws_restJson1ScheduleConfiguration = (input: ScheduleConfiguratio
};

const serializeAws_restJson1TagMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-apprunner/src/protocols/Aws_json1_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,7 @@ const serializeAws_json1_0RuntimeEnvironmentVariables = (
input: Record<string, string>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-appstream/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5631,7 +5631,7 @@ const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, conte
};

const serializeAws_json1_1Tags = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-appsync/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5125,7 +5125,7 @@ const serializeAws_restJson1SyncConfig = (input: SyncConfig, context: __SerdeCon
};

const serializeAws_restJson1TagMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-athena/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2624,7 +2624,7 @@ const serializeAws_json1_1NamedQueryIdList = (input: string[], context: __SerdeC
};

const serializeAws_json1_1ParametersMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
Loading