Skip to content

Commit

Permalink
fix(client-support): apply sparse string list for metadata (#4500)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe authored Mar 8, 2023
1 parent aea457a commit 22048eb
Show file tree
Hide file tree
Showing 4 changed files with 1,118 additions and 1,076 deletions.
2 changes: 1 addition & 1 deletion clients/client-support/src/endpoint/EndpointParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = <T>(
};

export interface EndpointParameters extends __EndpointParameters {
Region: string;
Region?: string;
UseDualStack?: boolean;
UseFIPS?: boolean;
Endpoint?: string;
Expand Down
89 changes: 45 additions & 44 deletions clients/client-support/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,49 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/support.json */

const E="type",
F="rules",
G="conditions",
H="fn",
I="argv",
J="ref",
K="url",
L="properties",
M="headers",
N="authSchemes",
O="name",
P="signingRegion",
Q="signingName";
const a=true,
b=false,
c="String",
d="PartitionResult",
e="tree",
f="error",
g="endpoint",
h="stringEquals",
i={"required":true,"default":false,[E]:"Boolean"},
j={[J]:"Region"},
k={[J]:"Endpoint"},
l={},
m={[H]:"getAttr",[I]:[{[J]:d},"name"]},
n={[G]:[{[H]:"booleanEquals",[I]:[{[J]:"UseFIPS"},true]},{[H]:"booleanEquals",[I]:[{[J]:"UseDualStack"},true]}],[E]:e,[F]:[{[G]:[{[H]:"booleanEquals",[I]:[true,{[H]:"getAttr",[I]:[{[J]:d},"supportsFIPS"]}]},{[H]:"booleanEquals",[I]:[true,{[H]:"getAttr",[I]:[{[J]:d},"supportsDualStack"]}]}],[E]:e,[F]:[{[g]:{[K]:"https://support-fips.{Region}.api.aws",[L]:{},[M]:{}},[E]:g}]},{[f]:"FIPS and DualStack are enabled, but this partition does not support one or both",[E]:f}]},
o={[f]:"FIPS and DualStack are enabled, but this partition does not support one or both",[E]:f},
p={[G]:[{[H]:"booleanEquals",[I]:[{[J]:"UseFIPS"},true]}],[E]:e,[F]:[{[G]:[{[H]:"booleanEquals",[I]:[true,{[H]:"getAttr",[I]:[{[J]:d},"supportsFIPS"]}]}],[E]:e,[F]:[{[g]:{[K]:"https://support-fips.{Region}.amazonaws.com",[L]:{},[M]:{}},[E]:g}]},{[f]:"FIPS is enabled but this partition does not support FIPS",[E]:f}]},
q={[f]:"FIPS is enabled but this partition does not support FIPS",[E]:f},
r={[G]:[{[H]:"booleanEquals",[I]:[{[J]:"UseDualStack"},true]}],[E]:e,[F]:[{[G]:[{[H]:"booleanEquals",[I]:[true,{[H]:"getAttr",[I]:[{[J]:d},"supportsDualStack"]}]}],[E]:e,[F]:[{[g]:{[K]:"https://support.{Region}.api.aws",[L]:{},[M]:{}},[E]:g}]},{[f]:"DualStack is enabled but this partition does not support DualStack",[E]:f}]},
s={[f]:"DualStack is enabled but this partition does not support DualStack",[E]:f},
t={[K]:"https://support.us-east-1.amazonaws.com",[L]:{[N]:[{[O]:"sigv4",[P]:"us-east-1",[Q]:"support"}]},[M]:{}},
u={[K]:"https://support.cn-north-1.amazonaws.com.cn",[L]:{[N]:[{[O]:"sigv4",[P]:"cn-north-1",[Q]:"support"}]},[M]:{}},
v={[K]:"https://support.us-gov-west-1.amazonaws.com",[L]:{[N]:[{[O]:"sigv4",[P]:"us-gov-west-1",[Q]:"support"}]},[M]:{}},
w={[K]:"https://support.us-iso-east-1.c2s.ic.gov",[L]:{[N]:[{[O]:"sigv4",[P]:"us-iso-east-1",[Q]:"support"}]},[M]:{}},
x={[K]:"https://support.us-isob-east-1.sc2s.sgov.gov",[L]:{[N]:[{[O]:"sigv4",[P]:"us-isob-east-1",[Q]:"support"}]},[M]:{}},
y=[{[H]:"booleanEquals",[I]:[{[J]:"UseFIPS"},true]}],
z=[{[H]:"booleanEquals",[I]:[{[J]:"UseDualStack"},true]}],
A=[{[H]:"booleanEquals",[I]:[{[J]:"UseFIPS"},true]},{[H]:"booleanEquals",[I]:[{[J]:"UseDualStack"},true]}],
B=[{[H]:"booleanEquals",[I]:[true,{[H]:"getAttr",[I]:[{[J]:d},"supportsFIPS"]}]},{[H]:"booleanEquals",[I]:[true,{[H]:"getAttr",[I]:[{[J]:d},"supportsDualStack"]}]}],
C=[{[H]:"booleanEquals",[I]:[true,{[H]:"getAttr",[I]:[{[J]:d},"supportsFIPS"]}]}],
D=[{[H]:"booleanEquals",[I]:[true,{[H]:"getAttr",[I]:[{[J]:d},"supportsDualStack"]}]}];
const _data={version:"1.0",parameters:{Region:{required:a,[E]:c},UseDualStack:i,UseFIPS:i,Endpoint:{required:b,[E]:c}},[F]:[{[G]:[{[H]:"aws.partition",[I]:[j],assign:d}],[E]:e,[F]:[{[G]:[{[H]:"isSet",[I]:[k]}],[E]:e,[F]:[{[G]:y,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[E]:f},{[E]:e,[F]:[{[G]:z,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[E]:f},{endpoint:{[K]:k,[L]:l,[M]:l},[E]:g}]}]},{[G]:[{[H]:h,[I]:[m,"aws"]}],[E]:e,[F]:[n,p,r,{endpoint:t,[E]:g}]},{[G]:[{[H]:h,[I]:[m,"aws-cn"]}],[E]:e,[F]:[{[G]:A,[E]:e,[F]:[{[G]:B,[E]:e,[F]:[{endpoint:{[K]:"https://support-fips.{Region}.api.amazonwebservices.com.cn",[L]:l,[M]:l},[E]:g}]},o]},{[G]:y,[E]:e,[F]:[{[G]:C,[E]:e,[F]:[{endpoint:{[K]:"https://support-fips.{Region}.amazonaws.com.cn",[L]:l,[M]:l},[E]:g}]},q]},{[G]:z,[E]:e,[F]:[{[G]:D,[E]:e,[F]:[{endpoint:{[K]:"https://support.{Region}.api.amazonwebservices.com.cn",[L]:l,[M]:l},[E]:g}]},s]},{endpoint:u,[E]:g}]},{[G]:[{[H]:h,[I]:[m,"aws-us-gov"]}],[E]:e,[F]:[n,p,r,{endpoint:v,[E]:g}]},{[G]:[{[H]:h,[I]:[m,"aws-iso"]}],[E]:e,[F]:[{[G]:y,[E]:e,[F]:[{[G]:C,[E]:e,[F]:[{endpoint:{[K]:"https://support-fips.{Region}.c2s.ic.gov",[L]:l,[M]:l},[E]:g}]},q]},{endpoint:w,[E]:g}]},{[G]:[{[H]:h,[I]:[m,"aws-iso-b"]}],[E]:e,[F]:[{[G]:y,[E]:e,[F]:[{[G]:C,[E]:e,[F]:[{endpoint:{[K]:"https://support-fips.{Region}.sc2s.sgov.gov",[L]:l,[M]:l},[E]:g}]},q]},{endpoint:x,[E]:g}]},{[G]:A,[E]:e,[F]:[{[G]:B,[E]:e,[F]:[{[E]:e,[F]:[{endpoint:{[K]:"https://support-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",[L]:l,[M]:l},[E]:g}]}]},o]},{[G]:y,[E]:e,[F]:[{[G]:C,[E]:e,[F]:[{[E]:e,[F]:[{endpoint:{[K]:"https://support-fips.{Region}.{PartitionResult#dnsSuffix}",[L]:l,[M]:l},[E]:g}]}]},q]},{[G]:z,[E]:e,[F]:[{[G]:D,[E]:e,[F]:[{[E]:e,[F]:[{endpoint:{[K]:"https://support.{Region}.{PartitionResult#dualStackDnsSuffix}",[L]:l,[M]:l},[E]:g}]}]},s]},{[E]:e,[F]:[{[G]:[{[H]:h,[I]:[j,"aws-global"]}],endpoint:t,[E]:g},{[G]:[{[H]:h,[I]:[j,"aws-cn-global"]}],endpoint:u,[E]:g},{[G]:[{[H]:h,[I]:[j,"aws-us-gov-global"]}],endpoint:v,[E]:g},{[G]:[{[H]:h,[I]:[j,"aws-iso-global"]}],endpoint:w,[E]:g},{[G]:[{[H]:h,[I]:[j,"aws-iso-b-global"]}],endpoint:x,[E]:g},{endpoint:{[K]:"https://support.{Region}.{PartitionResult#dnsSuffix}",[L]:l,[M]:l},[E]:g}]}]}]};
const E="required",
F="type",
G="rules",
H="conditions",
I="fn",
J="argv",
K="ref",
L="url",
M="properties",
N="headers",
O="authSchemes",
P="name",
Q="signingName",
R="signingRegion";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e="PartitionResult",
f="stringEquals",
g={[E]:false,[F]:"String"},
h={[E]:true,"default":false,[F]:"Boolean"},
i={[K]:"Endpoint"},
j={},
k={[K]:"Region"},
l={[I]:"getAttr",[J]:[{[K]:e},"name"]},
m={[H]:[{[I]:"booleanEquals",[J]:[{[K]:"UseFIPS"},true]},{[I]:"booleanEquals",[J]:[{[K]:"UseDualStack"},true]}],[F]:b,[G]:[{[H]:[{[I]:"booleanEquals",[J]:[true,{[I]:"getAttr",[J]:[{[K]:e},"supportsFIPS"]}]},{[I]:"booleanEquals",[J]:[true,{[I]:"getAttr",[J]:[{[K]:e},"supportsDualStack"]}]}],[F]:b,[G]:[{[d]:{[L]:"https://support-fips.{Region}.api.aws",[M]:{},[N]:{}},[F]:d}]},{[c]:"FIPS and DualStack are enabled, but this partition does not support one or both",[F]:c}]},
n={[c]:"FIPS and DualStack are enabled, but this partition does not support one or both",[F]:c},
o={[H]:[{[I]:"booleanEquals",[J]:[{[K]:"UseFIPS"},true]}],[F]:b,[G]:[{[H]:[{[I]:"booleanEquals",[J]:[true,{[I]:"getAttr",[J]:[{[K]:e},"supportsFIPS"]}]}],[F]:b,[G]:[{[d]:{[L]:"https://support-fips.{Region}.amazonaws.com",[M]:{},[N]:{}},[F]:d}]},{[c]:"FIPS is enabled but this partition does not support FIPS",[F]:c}]},
p={[c]:"FIPS is enabled but this partition does not support FIPS",[F]:c},
q={[H]:[{[I]:"booleanEquals",[J]:[{[K]:"UseDualStack"},true]}],[F]:b,[G]:[{[H]:[{[I]:"booleanEquals",[J]:[true,{[I]:"getAttr",[J]:[{[K]:e},"supportsDualStack"]}]}],[F]:b,[G]:[{[d]:{[L]:"https://support.{Region}.api.aws",[M]:{},[N]:{}},[F]:d}]},{[c]:"DualStack is enabled but this partition does not support DualStack",[F]:c}]},
r={[c]:"DualStack is enabled but this partition does not support DualStack",[F]:c},
s={[L]:"https://support.us-east-1.amazonaws.com",[M]:{[O]:[{[P]:"sigv4",[Q]:"support",[R]:"us-east-1"}]},[N]:{}},
t={[L]:"https://support.cn-north-1.amazonaws.com.cn",[M]:{[O]:[{[P]:"sigv4",[Q]:"support",[R]:"cn-north-1"}]},[N]:{}},
u={[L]:"https://support.us-gov-west-1.amazonaws.com",[M]:{[O]:[{[P]:"sigv4",[Q]:"support",[R]:"us-gov-west-1"}]},[N]:{}},
v={[L]:"https://support.us-iso-east-1.c2s.ic.gov",[M]:{[O]:[{[P]:"sigv4",[Q]:"support",[R]:"us-iso-east-1"}]},[N]:{}},
w={[L]:"https://support.us-isob-east-1.sc2s.sgov.gov",[M]:{[O]:[{[P]:"sigv4",[Q]:"support",[R]:"us-isob-east-1"}]},[N]:{}},
x=[{[I]:"booleanEquals",[J]:[{[K]:"UseFIPS"},true]}],
y=[{[I]:"booleanEquals",[J]:[{[K]:"UseDualStack"},true]}],
z=[k],
A=[{[I]:"booleanEquals",[J]:[{[K]:"UseFIPS"},true]},{[I]:"booleanEquals",[J]:[{[K]:"UseDualStack"},true]}],
B=[{[I]:"booleanEquals",[J]:[true,{[I]:"getAttr",[J]:[{[K]:e},"supportsFIPS"]}]},{[I]:"booleanEquals",[J]:[true,{[I]:"getAttr",[J]:[{[K]:e},"supportsDualStack"]}]}],
C=[{[I]:"booleanEquals",[J]:[true,{[I]:"getAttr",[J]:[{[K]:e},"supportsFIPS"]}]}],
D=[{[I]:"booleanEquals",[J]:[true,{[I]:"getAttr",[J]:[{[K]:e},"supportsDualStack"]}]}];
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},[G]:[{[H]:[{[I]:a,[J]:[i]}],[F]:b,[G]:[{[H]:x,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[F]:c},{[F]:b,[G]:[{[H]:y,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[F]:c},{endpoint:{[L]:i,[M]:j,[N]:j},[F]:d}]}]},{[F]:b,[G]:[{[H]:[{[I]:a,[J]:z}],[F]:b,[G]:[{[H]:[{[I]:"aws.partition",[J]:z,assign:e}],[F]:b,[G]:[{[H]:[{[I]:f,[J]:[l,"aws"]}],[F]:b,[G]:[m,o,q,{endpoint:s,[F]:d}]},{[H]:[{[I]:f,[J]:[l,"aws-cn"]}],[F]:b,[G]:[{[H]:A,[F]:b,[G]:[{[H]:B,[F]:b,[G]:[{endpoint:{[L]:"https://support-fips.{Region}.api.amazonwebservices.com.cn",[M]:j,[N]:j},[F]:d}]},n]},{[H]:x,[F]:b,[G]:[{[H]:C,[F]:b,[G]:[{endpoint:{[L]:"https://support-fips.{Region}.amazonaws.com.cn",[M]:j,[N]:j},[F]:d}]},p]},{[H]:y,[F]:b,[G]:[{[H]:D,[F]:b,[G]:[{endpoint:{[L]:"https://support.{Region}.api.amazonwebservices.com.cn",[M]:j,[N]:j},[F]:d}]},r]},{endpoint:t,[F]:d}]},{[H]:[{[I]:f,[J]:[l,"aws-us-gov"]}],[F]:b,[G]:[m,o,q,{endpoint:u,[F]:d}]},{[H]:[{[I]:f,[J]:[l,"aws-iso"]}],[F]:b,[G]:[{[H]:x,[F]:b,[G]:[{[H]:C,[F]:b,[G]:[{endpoint:{[L]:"https://support-fips.{Region}.c2s.ic.gov",[M]:j,[N]:j},[F]:d}]},p]},{endpoint:v,[F]:d}]},{[H]:[{[I]:f,[J]:[l,"aws-iso-b"]}],[F]:b,[G]:[{[H]:x,[F]:b,[G]:[{[H]:C,[F]:b,[G]:[{endpoint:{[L]:"https://support-fips.{Region}.sc2s.sgov.gov",[M]:j,[N]:j},[F]:d}]},p]},{endpoint:w,[F]:d}]},{[H]:A,[F]:b,[G]:[{[H]:B,[F]:b,[G]:[{[F]:b,[G]:[{endpoint:{[L]:"https://support-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",[M]:j,[N]:j},[F]:d}]}]},n]},{[H]:x,[F]:b,[G]:[{[H]:C,[F]:b,[G]:[{[F]:b,[G]:[{endpoint:{[L]:"https://support-fips.{Region}.{PartitionResult#dnsSuffix}",[M]:j,[N]:j},[F]:d}]}]},p]},{[H]:y,[F]:b,[G]:[{[H]:D,[F]:b,[G]:[{[F]:b,[G]:[{endpoint:{[L]:"https://support.{Region}.{PartitionResult#dualStackDnsSuffix}",[M]:j,[N]:j},[F]:d}]}]},r]},{[F]:b,[G]:[{[H]:[{[I]:f,[J]:[k,"aws-global"]}],endpoint:s,[F]:d},{[H]:[{[I]:f,[J]:[k,"aws-cn-global"]}],endpoint:t,[F]:d},{[H]:[{[I]:f,[J]:[k,"aws-us-gov-global"]}],endpoint:u,[F]:d},{[H]:[{[I]:f,[J]:[k,"aws-iso-global"]}],endpoint:v,[F]:d},{[H]:[{[I]:f,[J]:[k,"aws-iso-b-global"]}],endpoint:w,[F]:d},{endpoint:{[L]:"https://support.{Region}.{PartitionResult#dnsSuffix}",[M]:j,[N]:j},[F]:d}]}]}]},{error:"Invalid Configuration: Missing Region",[F]:c}]}]};
export const ruleSet: RuleSetObject = _data;
25 changes: 12 additions & 13 deletions clients/client-support/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1217,11 +1217,12 @@ const serializeAws_json1_1ServiceCodeList = (input: string[], context: __SerdeCo
};

const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => {
return input
.filter((e: any) => e != null)
.map((entry) => {
return entry;
});
return input.map((entry) => {
if (entry === null) {
return null as any;
}
return entry;
});
};

const deserializeAws_json1_1AddAttachmentsToSetResponse = (
Expand Down Expand Up @@ -1597,14 +1598,12 @@ const deserializeAws_json1_1SeverityLevelsList = (output: any, context: __SerdeC
};

const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => {
const retVal = (output || [])
.filter((e: any) => e != null)
.map((entry: any) => {
if (entry === null) {
return null as any;
}
return __expectString(entry) as any;
});
const retVal = (output || []).map((entry: any) => {
if (entry === null) {
return null as any;
}
return __expectString(entry) as any;
});
return retVal;
};

Expand Down
Loading

0 comments on commit 22048eb

Please sign in to comment.