Skip to content

Commit 776214d

Browse files
authored
chore(clients): use Record type in place of Object (#3658)
* chore(clients): use Record type in place of Object * chore(protocoltests): use Record instead of Object
1 parent a4e7041 commit 776214d

File tree

426 files changed

+4308
-4647
lines changed

Some content is hidden

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

426 files changed

+4308
-4647
lines changed

clients/client-accessanalyzer/src/models/models_0.ts

+22-22
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export interface CreateArchiveRuleRequest {
104104
/**
105105
* <p>The criteria for the rule.</p>
106106
*/
107-
filter: { [key: string]: Criterion } | undefined;
107+
filter: Record<string, Criterion> | undefined;
108108

109109
/**
110110
* <p>A client token.</p>
@@ -364,7 +364,7 @@ export interface ArchiveRuleSummary {
364364
/**
365365
* <p>A filter used to define the archive rule.</p>
366366
*/
367-
filter: { [key: string]: Criterion } | undefined;
367+
filter: Record<string, Criterion> | undefined;
368368

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

481481
/**
482482
* <p>A client token.</p>
@@ -506,7 +506,7 @@ export interface InlineArchiveRule {
506506
/**
507507
* <p>The condition and values for a criterion.</p>
508508
*/
509-
filter: { [key: string]: Criterion } | undefined;
509+
filter: Record<string, Criterion> | undefined;
510510
}
511511

512512
export namespace InlineArchiveRule {
@@ -545,7 +545,7 @@ export interface CreateAnalyzerRequest {
545545
/**
546546
* <p>The tags to apply to the analyzer.</p>
547547
*/
548-
tags?: { [key: string]: string };
548+
tags?: Record<string, string>;
549549

550550
/**
551551
* <p>A client token.</p>
@@ -692,7 +692,7 @@ export interface AnalyzerSummary {
692692
/**
693693
* <p>The tags added to the analyzer.</p>
694694
*/
695-
tags?: { [key: string]: string };
695+
tags?: Record<string, string>;
696696

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

900900
/**
901901
* <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
902902
* operation</a> request. The grant allows the cryptographic operation only when the
903903
* encryption context in the request includes the key-value pairs specified in this
904904
* constraint, although it can include additional key-value pairs.</p>
905905
*/
906-
encryptionContextSubset?: { [key: string]: string };
906+
encryptionContextSubset?: Record<string, string>;
907907
}
908908

909909
export namespace KmsGrantConstraints {
@@ -994,7 +994,7 @@ export interface KmsKeyConfiguration {
994994
* 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
995995
* policy</a>.</p>
996996
*/
997-
keyPolicies?: { [key: string]: string };
997+
keyPolicies?: Record<string, string>;
998998

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

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

15341534
/**
15351535
* <p>A client token.</p>
@@ -1643,7 +1643,7 @@ export interface AccessPreview {
16431643
/**
16441644
* <p>A map of resource ARNs for the proposed resource configuration.</p>
16451645
*/
1646-
configurations: { [key: string]: Configuration } | undefined;
1646+
configurations: Record<string, Configuration> | undefined;
16471647

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

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

19601960
/**
19611961
* <p>The time at which the finding was generated.</p>
@@ -2319,7 +2319,7 @@ export interface ListAccessPreviewFindingsRequest {
23192319
/**
23202320
* <p>Criteria to filter the returned findings.</p>
23212321
*/
2322-
filter?: { [key: string]: Criterion };
2322+
filter?: Record<string, Criterion>;
23232323

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

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

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

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

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

27922792
/**
27932793
* <p>The time at which the finding was created.</p>
@@ -2979,7 +2979,7 @@ export interface ListTagsForResourceResponse {
29792979
/**
29802980
* <p>The tags that are applied to the specified resource.</p>
29812981
*/
2982-
tags?: { [key: string]: string };
2982+
tags?: Record<string, string>;
29832983
}
29842984

29852985
export namespace ListTagsForResourceResponse {
@@ -3172,7 +3172,7 @@ export interface TagResourceRequest {
31723172
/**
31733173
* <p>The tags to add to the resource.</p>
31743174
*/
3175-
tags: { [key: string]: string } | undefined;
3175+
tags: Record<string, string> | undefined;
31763176
}
31773177

31783178
export namespace TagResourceRequest {

clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts

+22-25
Original file line numberDiff line numberDiff line change
@@ -2761,7 +2761,7 @@ const serializeAws_restJson1Configuration = (input: Configuration, context: __Se
27612761
};
27622762

27632763
const serializeAws_restJson1ConfigurationsMap = (
2764-
input: { [key: string]: Configuration },
2764+
input: Record<string, Configuration>,
27652765
context: __SerdeContext
27662766
): any => {
27672767
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
@@ -2785,7 +2785,7 @@ const serializeAws_restJson1Criterion = (input: Criterion, context: __SerdeConte
27852785
};
27862786
};
27872787

2788-
const serializeAws_restJson1FilterCriteriaMap = (input: { [key: string]: Criterion }, context: __SerdeContext): any => {
2788+
const serializeAws_restJson1FilterCriteriaMap = (input: Record<string, Criterion>, context: __SerdeContext): any => {
27892789
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
27902790
if (value === null) {
27912791
return acc;
@@ -2837,7 +2837,7 @@ const serializeAws_restJson1InternetConfiguration = (input: InternetConfiguratio
28372837
return {};
28382838
};
28392839

2840-
const serializeAws_restJson1KmsConstraintsMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
2840+
const serializeAws_restJson1KmsConstraintsMap = (input: Record<string, string>, context: __SerdeContext): any => {
28412841
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
28422842
if (value === null) {
28432843
return acc;
@@ -2920,7 +2920,7 @@ const serializeAws_restJson1KmsKeyConfiguration = (input: KmsKeyConfiguration, c
29202920
};
29212921
};
29222922

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

29862986
const serializeAws_restJson1S3AccessPointConfigurationsMap = (
2987-
input: { [key: string]: S3AccessPointConfiguration },
2987+
input: Record<string, S3AccessPointConfiguration>,
29882988
context: __SerdeContext
29892989
): any => {
29902990
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
@@ -3079,7 +3079,7 @@ const serializeAws_restJson1SqsQueueConfiguration = (input: SqsQueueConfiguratio
30793079
};
30803080
};
30813081

3082-
const serializeAws_restJson1TagsMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
3082+
const serializeAws_restJson1TagsMap = (input: Record<string, string>, context: __SerdeContext): any => {
30833083
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
30843084
if (value === null) {
30853085
return acc;
@@ -3399,8 +3399,8 @@ const deserializeAws_restJson1CloudTrailProperties = (output: any, context: __Se
33993399
} as any;
34003400
};
34013401

3402-
const deserializeAws_restJson1ConditionKeyMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
3403-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
3402+
const deserializeAws_restJson1ConditionKeyMap = (output: any, context: __SerdeContext): Record<string, string> => {
3403+
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
34043404
if (value === null) {
34053405
return acc;
34063406
}
@@ -3446,8 +3446,8 @@ const deserializeAws_restJson1Configuration = (output: any, context: __SerdeCont
34463446
const deserializeAws_restJson1ConfigurationsMap = (
34473447
output: any,
34483448
context: __SerdeContext
3449-
): { [key: string]: Configuration } => {
3450-
return Object.entries(output).reduce((acc: { [key: string]: Configuration }, [key, value]: [string, any]) => {
3449+
): Record<string, Configuration> => {
3450+
return Object.entries(output).reduce((acc: Record<string, Configuration>, [key, value]: [string, any]) => {
34513451
if (value === null) {
34523452
return acc;
34533453
}
@@ -3474,11 +3474,8 @@ const deserializeAws_restJson1Criterion = (output: any, context: __SerdeContext)
34743474
} as any;
34753475
};
34763476

3477-
const deserializeAws_restJson1FilterCriteriaMap = (
3478-
output: any,
3479-
context: __SerdeContext
3480-
): { [key: string]: Criterion } => {
3481-
return Object.entries(output).reduce((acc: { [key: string]: Criterion }, [key, value]: [string, any]) => {
3477+
const deserializeAws_restJson1FilterCriteriaMap = (output: any, context: __SerdeContext): Record<string, Criterion> => {
3478+
return Object.entries(output).reduce((acc: Record<string, Criterion>, [key, value]: [string, any]) => {
34823479
if (value === null) {
34833480
return acc;
34843481
}
@@ -3690,8 +3687,8 @@ const deserializeAws_restJson1JobError = (output: any, context: __SerdeContext):
36903687
} as any;
36913688
};
36923689

3693-
const deserializeAws_restJson1KmsConstraintsMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
3694-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
3690+
const deserializeAws_restJson1KmsConstraintsMap = (output: any, context: __SerdeContext): Record<string, string> => {
3691+
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
36953692
if (value === null) {
36963693
return acc;
36973694
}
@@ -3774,8 +3771,8 @@ const deserializeAws_restJson1KmsKeyConfiguration = (output: any, context: __Ser
37743771
} as any;
37753772
};
37763773

3777-
const deserializeAws_restJson1KmsKeyPoliciesMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
3778-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
3774+
const deserializeAws_restJson1KmsKeyPoliciesMap = (output: any, context: __SerdeContext): Record<string, string> => {
3775+
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
37793776
if (value === null) {
37803777
return acc;
37813778
}
@@ -3894,8 +3891,8 @@ const deserializeAws_restJson1Position = (output: any, context: __SerdeContext):
38943891
} as any;
38953892
};
38963893

3897-
const deserializeAws_restJson1PrincipalMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
3898-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
3894+
const deserializeAws_restJson1PrincipalMap = (output: any, context: __SerdeContext): Record<string, string> => {
3895+
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
38993896
if (value === null) {
39003897
return acc;
39013898
}
@@ -3938,9 +3935,9 @@ const deserializeAws_restJson1S3AccessPointConfiguration = (
39383935
const deserializeAws_restJson1S3AccessPointConfigurationsMap = (
39393936
output: any,
39403937
context: __SerdeContext
3941-
): { [key: string]: S3AccessPointConfiguration } => {
3938+
): Record<string, S3AccessPointConfiguration> => {
39423939
return Object.entries(output).reduce(
3943-
(acc: { [key: string]: S3AccessPointConfiguration }, [key, value]: [string, any]) => {
3940+
(acc: Record<string, S3AccessPointConfiguration>, [key, value]: [string, any]) => {
39443941
if (value === null) {
39453942
return acc;
39463943
}
@@ -4063,8 +4060,8 @@ const deserializeAws_restJson1Substring = (output: any, context: __SerdeContext)
40634060
} as any;
40644061
};
40654062

4066-
const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
4067-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
4063+
const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext): Record<string, string> => {
4064+
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
40684065
if (value === null) {
40694066
return acc;
40704067
}

clients/client-alexa-for-business/src/models/models_0.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4107,7 +4107,7 @@ export interface SkillDetails {
41074107
* </p>
41084108
* <p>The list of reviews for the skill, including Key and Value pair.</p>
41094109
*/
4110-
Reviews?: { [key: string]: string };
4110+
Reviews?: Record<string, string>;
41114111

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

44354435
/**
44364436
* <p>The unique identifier of a skill.</p>

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -6139,7 +6139,7 @@ const serializeAws_json1_1AudioList = (input: Audio[], context: __SerdeContext):
61396139
});
61406140
};
61416141

6142-
const serializeAws_json1_1AuthorizationResult = (input: { [key: string]: string }, context: __SerdeContext): any => {
6142+
const serializeAws_json1_1AuthorizationResult = (input: Record<string, string>, context: __SerdeContext): any => {
61436143
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
61446144
if (value === null) {
61456145
return acc;
@@ -8761,8 +8761,8 @@ const deserializeAws_json1_1ResourceInUseException = (output: any, context: __Se
87618761
} as any;
87628762
};
87638763

8764-
const deserializeAws_json1_1Reviews = (output: any, context: __SerdeContext): { [key: string]: string } => {
8765-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
8764+
const deserializeAws_json1_1Reviews = (output: any, context: __SerdeContext): Record<string, string> => {
8765+
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
87668766
if (value === null) {
87678767
return acc;
87688768
}

0 commit comments

Comments
 (0)