Skip to content

chore(clients): use Record type in place of Object #3658

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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 22 additions & 22 deletions clients/client-accessanalyzer/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface CreateArchiveRuleRequest {
/**
* <p>The criteria for the rule.</p>
*/
filter: { [key: string]: Criterion } | undefined;
filter: Record<string, Criterion> | undefined;

/**
* <p>A client token.</p>
Expand Down Expand Up @@ -364,7 +364,7 @@ export interface ArchiveRuleSummary {
/**
* <p>A filter used to define the archive rule.</p>
*/
filter: { [key: string]: Criterion } | undefined;
filter: Record<string, Criterion> | undefined;

/**
* <p>The time at which the archive rule was created.</p>
Expand Down Expand Up @@ -476,7 +476,7 @@ export interface UpdateArchiveRuleRequest {
* <p>A filter to match for the rules to update. Only rules that match the filter are
* updated.</p>
*/
filter: { [key: string]: Criterion } | undefined;
filter: Record<string, Criterion> | undefined;

/**
* <p>A client token.</p>
Expand Down Expand Up @@ -506,7 +506,7 @@ export interface InlineArchiveRule {
/**
* <p>The condition and values for a criterion.</p>
*/
filter: { [key: string]: Criterion } | undefined;
filter: Record<string, Criterion> | undefined;
}

export namespace InlineArchiveRule {
Expand Down Expand Up @@ -545,7 +545,7 @@ export interface CreateAnalyzerRequest {
/**
* <p>The tags to apply to the analyzer.</p>
*/
tags?: { [key: string]: string };
tags?: Record<string, string>;

/**
* <p>A client token.</p>
Expand Down Expand Up @@ -692,7 +692,7 @@ export interface AnalyzerSummary {
/**
* <p>The tags added to the analyzer.</p>
*/
tags?: { [key: string]: string };
tags?: Record<string, string>;

/**
* <p>The status of the analyzer. An <code>Active</code> analyzer successfully monitors
Expand Down Expand Up @@ -895,15 +895,15 @@ export interface KmsGrantConstraints {
* context in the request is the same as the encryption context specified in this
* constraint.</p>
*/
encryptionContextEquals?: { [key: string]: string };
encryptionContextEquals?: Record<string, string>;

/**
* <p>A list of key-value pairs that must be included in the encryption context of the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic
* operation</a> request. The grant allows the cryptographic operation only when the
* encryption context in the request includes the key-value pairs specified in this
* constraint, although it can include additional key-value pairs.</p>
*/
encryptionContextSubset?: { [key: string]: string };
encryptionContextSubset?: Record<string, string>;
}

export namespace KmsGrantConstraints {
Expand Down Expand Up @@ -994,7 +994,7 @@ export interface KmsKeyConfiguration {
* the key policy is <code>default</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default">Default key
* policy</a>.</p>
*/
keyPolicies?: { [key: string]: string };
keyPolicies?: Record<string, string>;

/**
* <p>A list of proposed grant configurations for the KMS key. If the proposed grant
Expand Down Expand Up @@ -1314,7 +1314,7 @@ export interface S3BucketConfiguration {
* <p>The configuration of Amazon S3 access points or multi-region access points for the bucket.
* You can propose up to 10 new access points per bucket.</p>
*/
accessPoints?: { [key: string]: S3AccessPointConfiguration };
accessPoints?: Record<string, S3AccessPointConfiguration>;
}

export namespace S3BucketConfiguration {
Expand Down Expand Up @@ -1529,7 +1529,7 @@ export interface CreateAccessPreviewRequest {
* with the proposed access control configuration. The configuration must contain exactly one
* element.</p>
*/
configurations: { [key: string]: Configuration } | undefined;
configurations: Record<string, Configuration> | undefined;

/**
* <p>A client token.</p>
Expand Down Expand Up @@ -1643,7 +1643,7 @@ export interface AccessPreview {
/**
* <p>A map of resource ARNs for the proposed resource configuration.</p>
*/
configurations: { [key: string]: Configuration } | undefined;
configurations: Record<string, Configuration> | undefined;

/**
* <p>The time at which the access preview was created.</p>
Expand Down Expand Up @@ -1928,7 +1928,7 @@ export interface Finding {
/**
* <p>The external principal that access to a resource within the zone of trust.</p>
*/
principal?: { [key: string]: string };
principal?: Record<string, string>;

/**
* <p>The action in the analyzed policy statement that an external principal has permission to
Expand All @@ -1955,7 +1955,7 @@ export interface Finding {
/**
* <p>The condition in the analyzed policy statement that resulted in a finding.</p>
*/
condition: { [key: string]: string } | undefined;
condition: Record<string, string> | undefined;

/**
* <p>The time at which the finding was generated.</p>
Expand Down Expand Up @@ -2319,7 +2319,7 @@ export interface ListAccessPreviewFindingsRequest {
/**
* <p>Criteria to filter the returned findings.</p>
*/
filter?: { [key: string]: Criterion };
filter?: Record<string, Criterion>;

/**
* <p>A token used for pagination of results returned.</p>
Expand Down Expand Up @@ -2372,7 +2372,7 @@ export interface AccessPreviewFinding {
/**
* <p>The external principal that has access to a resource within the zone of trust.</p>
*/
principal?: { [key: string]: string };
principal?: Record<string, string>;

/**
* <p>The action in the analyzed policy statement that an external principal has permission to
Expand All @@ -2383,7 +2383,7 @@ export interface AccessPreviewFinding {
/**
* <p>The condition in the analyzed policy statement that resulted in a finding.</p>
*/
condition?: { [key: string]: string };
condition?: Record<string, string>;

/**
* <p>The resource that an external principal has access to. This is the resource associated
Expand Down Expand Up @@ -2721,7 +2721,7 @@ export interface ListFindingsRequest {
/**
* <p>A filter to match for the findings to return.</p>
*/
filter?: { [key: string]: Criterion };
filter?: Record<string, Criterion>;

/**
* <p>The sort order for the findings returned.</p>
Expand Down Expand Up @@ -2760,7 +2760,7 @@ export interface FindingSummary {
/**
* <p>The external principal that has access to a resource within the zone of trust.</p>
*/
principal?: { [key: string]: string };
principal?: Record<string, string>;

/**
* <p>The action in the analyzed policy statement that an external principal has permission to
Expand All @@ -2787,7 +2787,7 @@ export interface FindingSummary {
/**
* <p>The condition in the analyzed policy statement that resulted in a finding.</p>
*/
condition: { [key: string]: string } | undefined;
condition: Record<string, string> | undefined;

/**
* <p>The time at which the finding was created.</p>
Expand Down Expand Up @@ -2979,7 +2979,7 @@ export interface ListTagsForResourceResponse {
/**
* <p>The tags that are applied to the specified resource.</p>
*/
tags?: { [key: string]: string };
tags?: Record<string, string>;
}

export namespace ListTagsForResourceResponse {
Expand Down Expand Up @@ -3172,7 +3172,7 @@ export interface TagResourceRequest {
/**
* <p>The tags to add to the resource.</p>
*/
tags: { [key: string]: string } | undefined;
tags: Record<string, string> | undefined;
}

export namespace TagResourceRequest {
Expand Down
47 changes: 22 additions & 25 deletions clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,7 @@ const serializeAws_restJson1Configuration = (input: Configuration, context: __Se
};

const serializeAws_restJson1ConfigurationsMap = (
input: { [key: string]: Configuration },
input: Record<string, Configuration>,
context: __SerdeContext
): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
Expand All @@ -2785,7 +2785,7 @@ const serializeAws_restJson1Criterion = (input: Criterion, context: __SerdeConte
};
};

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

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

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

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

const serializeAws_restJson1TagsMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
const serializeAws_restJson1TagsMap = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
if (value === null) {
return acc;
Expand Down Expand Up @@ -3399,8 +3399,8 @@ const deserializeAws_restJson1CloudTrailProperties = (output: any, context: __Se
} as any;
};

const deserializeAws_restJson1ConditionKeyMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
const deserializeAws_restJson1ConditionKeyMap = (output: any, context: __SerdeContext): Record<string, string> => {
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3446,8 +3446,8 @@ const deserializeAws_restJson1Configuration = (output: any, context: __SerdeCont
const deserializeAws_restJson1ConfigurationsMap = (
output: any,
context: __SerdeContext
): { [key: string]: Configuration } => {
return Object.entries(output).reduce((acc: { [key: string]: Configuration }, [key, value]: [string, any]) => {
): Record<string, Configuration> => {
return Object.entries(output).reduce((acc: Record<string, Configuration>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand All @@ -3474,11 +3474,8 @@ const deserializeAws_restJson1Criterion = (output: any, context: __SerdeContext)
} as any;
};

const deserializeAws_restJson1FilterCriteriaMap = (
output: any,
context: __SerdeContext
): { [key: string]: Criterion } => {
return Object.entries(output).reduce((acc: { [key: string]: Criterion }, [key, value]: [string, any]) => {
const deserializeAws_restJson1FilterCriteriaMap = (output: any, context: __SerdeContext): Record<string, Criterion> => {
return Object.entries(output).reduce((acc: Record<string, Criterion>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3690,8 +3687,8 @@ const deserializeAws_restJson1JobError = (output: any, context: __SerdeContext):
} as any;
};

const deserializeAws_restJson1KmsConstraintsMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
const deserializeAws_restJson1KmsConstraintsMap = (output: any, context: __SerdeContext): Record<string, string> => {
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3774,8 +3771,8 @@ const deserializeAws_restJson1KmsKeyConfiguration = (output: any, context: __Ser
} as any;
};

const deserializeAws_restJson1KmsKeyPoliciesMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
const deserializeAws_restJson1KmsKeyPoliciesMap = (output: any, context: __SerdeContext): Record<string, string> => {
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3894,8 +3891,8 @@ const deserializeAws_restJson1Position = (output: any, context: __SerdeContext):
} as any;
};

const deserializeAws_restJson1PrincipalMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
const deserializeAws_restJson1PrincipalMap = (output: any, context: __SerdeContext): Record<string, string> => {
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -3938,9 +3935,9 @@ const deserializeAws_restJson1S3AccessPointConfiguration = (
const deserializeAws_restJson1S3AccessPointConfigurationsMap = (
output: any,
context: __SerdeContext
): { [key: string]: S3AccessPointConfiguration } => {
): Record<string, S3AccessPointConfiguration> => {
return Object.entries(output).reduce(
(acc: { [key: string]: S3AccessPointConfiguration }, [key, value]: [string, any]) => {
(acc: Record<string, S3AccessPointConfiguration>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down Expand Up @@ -4063,8 +4060,8 @@ const deserializeAws_restJson1Substring = (output: any, context: __SerdeContext)
} as any;
};

const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext): Record<string, string> => {
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
if (value === null) {
return acc;
}
Expand Down
4 changes: 2 additions & 2 deletions clients/client-alexa-for-business/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@ export interface SkillDetails {
* </p>
* <p>The list of reviews for the skill, including Key and Value pair.</p>
*/
Reviews?: { [key: string]: string };
Reviews?: Record<string, string>;

/**
* <p>The details about the developer that published the skill.</p>
Expand Down Expand Up @@ -4430,7 +4430,7 @@ export interface PutSkillAuthorizationRequest {
* <p>The authorization result specific to OAUTH code grant output. "Code” must be
* populated in the AuthorizationResult map to establish the authorization.</p>
*/
AuthorizationResult: { [key: string]: string } | undefined;
AuthorizationResult: Record<string, string> | undefined;

/**
* <p>The unique identifier of a skill.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6139,7 +6139,7 @@ const serializeAws_json1_1AudioList = (input: Audio[], context: __SerdeContext):
});
};

const serializeAws_json1_1AuthorizationResult = (input: { [key: string]: string }, context: __SerdeContext): any => {
const serializeAws_json1_1AuthorizationResult = (input: Record<string, string>, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
if (value === null) {
return acc;
Expand Down Expand Up @@ -8761,8 +8761,8 @@ const deserializeAws_json1_1ResourceInUseException = (output: any, context: __Se
} as any;
};

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