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(endpoint): add codegen changes for endpoint ruleset compression #4301

Merged
merged 1 commit into from
Dec 20, 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
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CHANGELOG.md
.github/*
**/*.hbs
**/*/report.md
clients/*/src/endpoint/ruleset.ts
347 changes: 29 additions & 318 deletions clients/client-accessanalyzer/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
@@ -1,320 +1,31 @@
// smithy-typescript generated code
// @ts-nocheck
// generated code, do not edit
import { RuleSetObject } from "@aws-sdk/util-endpoints";

export const ruleSet: RuleSetObject = {
version: "1.0",
parameters: {
Region: {
builtIn: "AWS::Region",
required: true,
documentation: "The AWS region used to dispatch the request.",
type: "String",
},
UseDualStack: {
builtIn: "AWS::UseDualStack",
required: true,
default: false,
documentation:
"When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
type: "Boolean",
},
UseFIPS: {
builtIn: "AWS::UseFIPS",
required: true,
default: false,
documentation:
"When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
type: "Boolean",
},
Endpoint: {
builtIn: "SDK::Endpoint",
required: false,
documentation: "Override the endpoint used to send this request",
type: "String",
},
},
rules: [
{
conditions: [
{
fn: "aws.partition",
argv: [
{
ref: "Region",
},
],
assign: "PartitionResult",
},
],
type: "tree",
rules: [
{
conditions: [
{
fn: "isSet",
argv: [
{
ref: "Endpoint",
},
],
},
{
fn: "parseURL",
argv: [
{
ref: "Endpoint",
},
],
assign: "url",
},
],
type: "tree",
rules: [
{
conditions: [
{
fn: "booleanEquals",
argv: [
{
ref: "UseFIPS",
},
true,
],
},
],
error: "Invalid Configuration: FIPS and custom endpoint are not supported",
type: "error",
},
{
conditions: [],
type: "tree",
rules: [
{
conditions: [
{
fn: "booleanEquals",
argv: [
{
ref: "UseDualStack",
},
true,
],
},
],
error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
type: "error",
},
{
conditions: [],
endpoint: {
url: {
ref: "Endpoint",
},
properties: {},
headers: {},
},
type: "endpoint",
},
],
},
],
},
{
conditions: [
{
fn: "booleanEquals",
argv: [
{
ref: "UseFIPS",
},
true,
],
},
{
fn: "booleanEquals",
argv: [
{
ref: "UseDualStack",
},
true,
],
},
],
type: "tree",
rules: [
{
conditions: [
{
fn: "booleanEquals",
argv: [
true,
{
fn: "getAttr",
argv: [
{
ref: "PartitionResult",
},
"supportsFIPS",
],
},
],
},
{
fn: "booleanEquals",
argv: [
true,
{
fn: "getAttr",
argv: [
{
ref: "PartitionResult",
},
"supportsDualStack",
],
},
],
},
],
type: "tree",
rules: [
{
conditions: [],
endpoint: {
url: "https://access-analyzer-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: {},
headers: {},
},
type: "endpoint",
},
],
},
{
conditions: [],
error: "FIPS and DualStack are enabled, but this partition does not support one or both",
type: "error",
},
],
},
{
conditions: [
{
fn: "booleanEquals",
argv: [
{
ref: "UseFIPS",
},
true,
],
},
],
type: "tree",
rules: [
{
conditions: [
{
fn: "booleanEquals",
argv: [
true,
{
fn: "getAttr",
argv: [
{
ref: "PartitionResult",
},
"supportsFIPS",
],
},
],
},
],
type: "tree",
rules: [
{
conditions: [],
type: "tree",
rules: [
{
conditions: [],
endpoint: {
url: "https://access-analyzer-fips.{Region}.{PartitionResult#dnsSuffix}",
properties: {},
headers: {},
},
type: "endpoint",
},
],
},
],
},
{
conditions: [],
error: "FIPS is enabled but this partition does not support FIPS",
type: "error",
},
],
},
{
conditions: [
{
fn: "booleanEquals",
argv: [
{
ref: "UseDualStack",
},
true,
],
},
],
type: "tree",
rules: [
{
conditions: [
{
fn: "booleanEquals",
argv: [
true,
{
fn: "getAttr",
argv: [
{
ref: "PartitionResult",
},
"supportsDualStack",
],
},
],
},
],
type: "tree",
rules: [
{
conditions: [],
endpoint: {
url: "https://access-analyzer.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: {},
headers: {},
},
type: "endpoint",
},
],
},
{
conditions: [],
error: "DualStack is enabled but this partition does not support DualStack",
type: "error",
},
],
},
{
conditions: [],
endpoint: {
url: "https://access-analyzer.{Region}.{PartitionResult#dnsSuffix}",
properties: {},
headers: {},
},
type: "endpoint",
},
],
},
],
};
/* This file is compressed. Log this object
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/accessanalyzer.json */

const s="fn",
t="argv",
u="ref";
const a=true,
b=false,
c="String",
d="Boolean",
e="PartitionResult",
f="tree",
g="error",
h="endpoint",
i={[u]:"Endpoint"},
j={[s]:"booleanEquals",[t]:[{[u]:"UseFIPS"},true]},
k={[s]:"booleanEquals",[t]:[{[u]:"UseDualStack"},true]},
l={},
m={[s]:"booleanEquals",[t]:[true,{[s]:"getAttr",[t]:[{[u]:e},"supportsFIPS"]}]},
n={[s]:"booleanEquals",[t]:[true,{[s]:"getAttr",[t]:[{[u]:e},"supportsDualStack"]}]},
o=[i],
p=[j],
q=[],
r=[k];
const _data={version:"1.0",parameters:{Region:{builtIn:"AWS::Region",required:a,documentation:"The AWS region used to dispatch the request.",type:c},UseDualStack:{builtIn:"AWS::UseDualStack",required:a,default:b,documentation:"When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",type:d},UseFIPS:{builtIn:"AWS::UseFIPS",required:a,default:b,documentation:"When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",type:d},Endpoint:{builtIn:"SDK::Endpoint",required:b,documentation:"Override the endpoint used to send this request",type:c}},rules:[{conditions:[{[s]:"aws.partition",[t]:[{[u]:"Region"}],assign:e}],type:f,rules:[{conditions:[{[s]:"isSet",[t]:o},{[s]:"parseURL",[t]:o,assign:"url"}],type:f,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:g},{conditions:q,type:f,rules:[{conditions:r,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:g},{conditions:q,endpoint:{url:i,properties:l,headers:l},type:h}]}]},{conditions:[j,k],type:f,rules:[{conditions:[m,n],type:f,rules:[{conditions:q,endpoint:{url:"https://access-analyzer-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:h}]},{conditions:q,error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:g}]},{conditions:p,type:f,rules:[{conditions:[m],type:f,rules:[{conditions:q,type:f,rules:[{conditions:q,endpoint:{url:"https://access-analyzer-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:h}]}]},{conditions:q,error:"FIPS is enabled but this partition does not support FIPS",type:g}]},{conditions:r,type:f,rules:[{conditions:[n],type:f,rules:[{conditions:q,endpoint:{url:"https://access-analyzer.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:h}]},{conditions:q,error:"DualStack is enabled but this partition does not support DualStack",type:g}]},{conditions:q,endpoint:{url:"https://access-analyzer.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:h}]}]};
export const ruleSet: RuleSetObject = _data;
Loading