Skip to content

Commit

Permalink
docs(client-savingsplans): Savings Plans endpoints update
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Jul 20, 2023
1 parent 71e1e2b commit f4513f2
Show file tree
Hide file tree
Showing 7 changed files with 1,000 additions and 760 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface DescribeSavingsPlanRatesCommandOutput extends DescribeSavingsPl
* savingsPlanId: "STRING_VALUE", // required
* filters: [ // SavingsPlanRateFilterList
* { // SavingsPlanRateFilter
* name: "STRING_VALUE",
* name: "region" || "instanceType" || "productDescription" || "tenancy" || "productType" || "serviceCode" || "usageType" || "operation",
* values: [ // ListOfStrings
* "STRING_VALUE",
* ],
Expand All @@ -63,15 +63,15 @@ export interface DescribeSavingsPlanRatesCommandOutput extends DescribeSavingsPl
* // searchResults: [ // SavingsPlanRateList
* // { // SavingsPlanRate
* // rate: "STRING_VALUE",
* // currency: "STRING_VALUE",
* // unit: "STRING_VALUE",
* // productType: "STRING_VALUE",
* // serviceCode: "STRING_VALUE",
* // currency: "CNY" || "USD",
* // unit: "Hrs" || "Lambda-GB-Second" || "Request",
* // productType: "EC2" || "Fargate" || "Lambda" || "SageMaker",
* // serviceCode: "AmazonEC2" || "AmazonECS" || "AmazonEKS" || "AWSLambda" || "AmazonSageMaker",
* // usageType: "STRING_VALUE",
* // operation: "STRING_VALUE",
* // properties: [ // SavingsPlanRatePropertyList
* // { // SavingsPlanRateProperty
* // name: "STRING_VALUE",
* // name: "region" || "instanceType" || "instanceFamily" || "productDescription" || "tenancy",
* // value: "STRING_VALUE",
* // },
* // ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ export interface DescribeSavingsPlansCommandOutput extends DescribeSavingsPlansR
* nextToken: "STRING_VALUE",
* maxResults: Number("int"),
* states: [ // SavingsPlanStateList
* "STRING_VALUE",
* "payment-pending" || "payment-failed" || "active" || "retired" || "queued" || "queued-deleted",
* ],
* filters: [ // SavingsPlanFilterList
* { // SavingsPlanFilter
* name: "STRING_VALUE",
* name: "region" || "ec2-instance-family" || "commitment" || "upfront" || "term" || "savings-plan-type" || "payment-option" || "start" || "end",
* values: [ // ListOfStrings
* "STRING_VALUE",
* ],
Expand All @@ -75,15 +75,15 @@ export interface DescribeSavingsPlansCommandOutput extends DescribeSavingsPlansR
* // description: "STRING_VALUE",
* // start: "STRING_VALUE",
* // end: "STRING_VALUE",
* // state: "STRING_VALUE",
* // state: "payment-pending" || "payment-failed" || "active" || "retired" || "queued" || "queued-deleted",
* // region: "STRING_VALUE",
* // ec2InstanceFamily: "STRING_VALUE",
* // savingsPlanType: "STRING_VALUE",
* // paymentOption: "STRING_VALUE",
* // savingsPlanType: "Compute" || "EC2Instance" || "SageMaker",
* // paymentOption: "All Upfront" || "Partial Upfront" || "No Upfront",
* // productTypes: [ // SavingsPlanProductTypeList
* // "STRING_VALUE",
* // "EC2" || "Fargate" || "Lambda" || "SageMaker",
* // ],
* // currency: "STRING_VALUE",
* // currency: "CNY" || "USD",
* // commitment: "STRING_VALUE",
* // upfrontPaymentAmount: "STRING_VALUE",
* // recurringPaymentAmount: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ export interface DescribeSavingsPlansOfferingRatesCommandOutput
* "STRING_VALUE",
* ],
* savingsPlanPaymentOptions: [ // SavingsPlanPaymentOptionList
* "STRING_VALUE",
* "All Upfront" || "Partial Upfront" || "No Upfront",
* ],
* savingsPlanTypes: [ // SavingsPlanTypeList
* "STRING_VALUE",
* "Compute" || "EC2Instance" || "SageMaker",
* ],
* products: [ // SavingsPlanProductTypeList
* "STRING_VALUE",
* "EC2" || "Fargate" || "Lambda" || "SageMaker",
* ],
* serviceCodes: [ // SavingsPlanRateServiceCodeList
* "STRING_VALUE",
* "AmazonEC2" || "AmazonECS" || "AmazonEKS" || "AWSLambda" || "AmazonSageMaker",
* ],
* usageTypes: [ // SavingsPlanRateUsageTypeList
* "STRING_VALUE",
Expand All @@ -75,7 +75,7 @@ export interface DescribeSavingsPlansOfferingRatesCommandOutput
* ],
* filters: [ // SavingsPlanOfferingRateFiltersList
* { // SavingsPlanOfferingRateFilterElement
* name: "STRING_VALUE",
* name: "region" || "instanceFamily" || "instanceType" || "productDescription" || "tenancy" || "productId",
* values: [ // FilterValuesList
* "STRING_VALUE",
* ],
Expand All @@ -91,16 +91,16 @@ export interface DescribeSavingsPlansOfferingRatesCommandOutput
* // { // SavingsPlanOfferingRate
* // savingsPlanOffering: { // ParentSavingsPlanOffering
* // offeringId: "STRING_VALUE",
* // paymentOption: "STRING_VALUE",
* // planType: "STRING_VALUE",
* // paymentOption: "All Upfront" || "Partial Upfront" || "No Upfront",
* // planType: "Compute" || "EC2Instance" || "SageMaker",
* // durationSeconds: Number("long"),
* // currency: "STRING_VALUE",
* // currency: "CNY" || "USD",
* // planDescription: "STRING_VALUE",
* // },
* // rate: "STRING_VALUE",
* // unit: "STRING_VALUE",
* // productType: "STRING_VALUE",
* // serviceCode: "STRING_VALUE",
* // unit: "Hrs" || "Lambda-GB-Second" || "Request",
* // productType: "EC2" || "Fargate" || "Lambda" || "SageMaker",
* // serviceCode: "AmazonEC2" || "AmazonECS" || "AmazonEKS" || "AWSLambda" || "AmazonSageMaker",
* // usageType: "STRING_VALUE",
* // operation: "STRING_VALUE",
* // properties: [ // SavingsPlanOfferingRatePropertyList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ export interface DescribeSavingsPlansOfferingsCommandOutput
* "STRING_VALUE",
* ],
* paymentOptions: [ // SavingsPlanPaymentOptionList
* "STRING_VALUE",
* "All Upfront" || "Partial Upfront" || "No Upfront",
* ],
* productType: "STRING_VALUE",
* productType: "EC2" || "Fargate" || "Lambda" || "SageMaker",
* planTypes: [ // SavingsPlanTypeList
* "STRING_VALUE",
* "Compute" || "EC2Instance" || "SageMaker",
* ],
* durations: [ // DurationsList
* Number("long"),
* ],
* currencies: [ // CurrencyList
* "STRING_VALUE",
* "CNY" || "USD",
* ],
* descriptions: [ // SavingsPlanDescriptionsList
* "STRING_VALUE",
Expand All @@ -79,7 +79,7 @@ export interface DescribeSavingsPlansOfferingsCommandOutput
* ],
* filters: [ // SavingsPlanOfferingFiltersList
* { // SavingsPlanOfferingFilterElement
* name: "STRING_VALUE",
* name: "region" || "instanceFamily",
* values: [ // FilterValuesList
* "STRING_VALUE",
* ],
Expand All @@ -95,19 +95,19 @@ export interface DescribeSavingsPlansOfferingsCommandOutput
* // { // SavingsPlanOffering
* // offeringId: "STRING_VALUE",
* // productTypes: [ // SavingsPlanProductTypeList
* // "STRING_VALUE",
* // "EC2" || "Fargate" || "Lambda" || "SageMaker",
* // ],
* // planType: "STRING_VALUE",
* // planType: "Compute" || "EC2Instance" || "SageMaker",
* // description: "STRING_VALUE",
* // paymentOption: "STRING_VALUE",
* // paymentOption: "All Upfront" || "Partial Upfront" || "No Upfront",
* // durationSeconds: Number("long"),
* // currency: "STRING_VALUE",
* // currency: "CNY" || "USD",
* // serviceCode: "STRING_VALUE",
* // usageType: "STRING_VALUE",
* // operation: "STRING_VALUE",
* // properties: [ // SavingsPlanOfferingPropertyList
* // { // SavingsPlanOfferingProperty
* // name: "STRING_VALUE",
* // name: "region" || "instanceFamily",
* // value: "STRING_VALUE",
* // },
* // ],
Expand Down
57 changes: 27 additions & 30 deletions clients/client-savingsplans/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,31 @@ import { RuleSetObject } from "@smithy/types";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/savingsplans.json */

const y="required",
z="type",
A="fn",
B="argv",
C="ref";
const a="PartitionResult",
b="tree",
c="error",
d="endpoint",
e="stringEquals",
f="getAttr",
g={[y]:false,[z]:"String"},
h={[y]:true,"default":false,[z]:"Boolean"},
i={[C]:"Region"},
j={[C]:"Endpoint"},
k={},
l={[C]:a},
m={"authSchemes":[{"name":"sigv4","signingName":"savingsplans","signingRegion":"us-east-1"}]},
n={[c]:"FIPS and DualStack are enabled, but this partition does not support one or both",[z]:c},
o={[c]:"FIPS is enabled but this partition does not support FIPS",[z]:c},
p={[c]:"DualStack is enabled but this partition does not support DualStack",[z]:c},
q={"url":"https://savingsplans.amazonaws.com","properties":m,"headers":{}},
r=[j],
s=[{[A]:"booleanEquals",[B]:[{[C]:"UseFIPS"},true]}],
t=[{[A]:"booleanEquals",[B]:[{[C]:"UseDualStack"},true]}],
u=[{[A]:"booleanEquals",[B]:[{[C]:"UseFIPS"},true]},{[A]:"booleanEquals",[B]:[{[C]:"UseDualStack"},true]}],
v=[{[A]:"booleanEquals",[B]:[true,{[A]:f,[B]:[l,"supportsFIPS"]}]},{[A]:"booleanEquals",[B]:[true,{[A]:f,[B]:[l,"supportsDualStack"]}]}],
w=[{[A]:"booleanEquals",[B]:[true,{[A]:f,[B]:[l,"supportsFIPS"]}]}],
x=[{[A]:"booleanEquals",[B]:[true,{[A]:f,[B]:[l,"supportsDualStack"]}]}];
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[A]:"aws.partition",[B]:[i],assign:a}],[z]:b,rules:[{conditions:[{[A]:"isSet",[B]:r},{[A]:"parseURL",[B]:r,assign:"url"}],[z]:b,rules:[{conditions:s,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[z]:c},{[z]:b,rules:[{conditions:t,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[z]:c},{endpoint:{url:j,properties:k,headers:k},[z]:d}]}]},{conditions:[{[A]:e,[B]:[{[A]:f,[B]:[l,"name"]},"aws"]}],[z]:b,rules:[{conditions:u,[z]:b,rules:[{conditions:v,[z]:b,rules:[{endpoint:{url:"https://savingsplans-fips.{Region}.api.aws",properties:m,headers:k},[z]:d}]},n]},{conditions:s,[z]:b,rules:[{conditions:w,[z]:b,rules:[{endpoint:{url:"https://savingsplans-fips.{Region}.amazonaws.com",properties:m,headers:k},[z]:d}]},o]},{conditions:t,[z]:b,rules:[{conditions:x,[z]:b,rules:[{endpoint:{url:"https://savingsplans.{Region}.api.aws",properties:m,headers:k},[z]:d}]},p]},{endpoint:q,[z]:d}]},{conditions:u,[z]:b,rules:[{conditions:v,[z]:b,rules:[{endpoint:{url:"https://savingsplans-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},[z]:d}]},n]},{conditions:s,[z]:b,rules:[{conditions:w,[z]:b,rules:[{[z]:b,rules:[{endpoint:{url:"https://savingsplans-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},[z]:d}]}]},o]},{conditions:t,[z]:b,rules:[{conditions:x,[z]:b,rules:[{endpoint:{url:"https://savingsplans.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},[z]:d}]},p]},{[z]:b,rules:[{conditions:[{[A]:e,[B]:[i,"aws-global"]}],endpoint:q,[z]:d},{endpoint:{url:"https://savingsplans.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},[z]:d}]}]}]};
const w="required",
x="fn",
y="argv",
z="ref";
const a=false,
b="isSet",
c="tree",
d="booleanEquals",
e="error",
f="endpoint",
g="PartitionResult",
h="getAttr",
i={[w]:false,"type":"String"},
j={[w]:true,"default":false,"type":"Boolean"},
k={[z]:"Endpoint"},
l={[x]:d,[y]:[{[z]:"UseFIPS"},true]},
m={[z]:"UseFIPS"},
n={[x]:d,[y]:[{[z]:"UseDualStack"},true]},
o={[z]:"UseDualStack"},
p={},
q={[z]:g},
r={[x]:d,[y]:[true,{[x]:h,[y]:[q,"supportsFIPS"]}]},
s={[x]:d,[y]:[true,{[x]:h,[y]:[q,"supportsDualStack"]}]},
t=[l],
u=[n],
v=[{[z]:"Region"}];
const _data={version:"1.0",parameters:{Region:i,UseDualStack:j,UseFIPS:j,Endpoint:i},rules:[{conditions:[{[x]:b,[y]:[k]}],type:c,rules:[{conditions:t,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:e},{type:c,rules:[{conditions:u,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:e},{endpoint:{url:k,properties:p,headers:p},type:f}]}]},{type:c,rules:[{conditions:[{[x]:b,[y]:v}],type:c,rules:[{conditions:[{[x]:"aws.partition",[y]:v,assign:g}],type:c,rules:[{conditions:[{[x]:"stringEquals",[y]:[{[x]:h,[y]:[q,"name"]},"aws"]},{[x]:d,[y]:[m,a]},{[x]:d,[y]:[o,a]}],endpoint:{url:"https://savingsplans.amazonaws.com",properties:{authSchemes:[{name:"sigv4",signingName:"savingsplans",signingRegion:"us-east-1"}]},headers:p},type:f},{conditions:[l,n],type:c,rules:[{conditions:[r,s],type:c,rules:[{type:c,rules:[{endpoint:{url:"https://savingsplans-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:p,headers:p},type:f}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:e}]},{conditions:t,type:c,rules:[{conditions:[r],type:c,rules:[{type:c,rules:[{endpoint:{url:"https://savingsplans-fips.{Region}.{PartitionResult#dnsSuffix}",properties:p,headers:p},type:f}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:e}]},{conditions:u,type:c,rules:[{conditions:[s],type:c,rules:[{type:c,rules:[{endpoint:{url:"https://savingsplans.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:p,headers:p},type:f}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:e}]},{type:c,rules:[{endpoint:{url:"https://savingsplans.{Region}.{PartitionResult#dnsSuffix}",properties:p,headers:p},type:f}]}]}]},{error:"Invalid Configuration: Missing Region",type:e}]}]};
export const ruleSet: RuleSetObject = _data;
13 changes: 11 additions & 2 deletions clients/client-savingsplans/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,19 @@ export interface DescribeSavingsPlanRatesRequest {
maxResults?: number;
}

/**
* @public
* @enum
*/
export const CurrencyCode = {
CNY: "CNY",
USD: "USD",
} as const;

/**
* @public
*/
export type CurrencyCode = "CNY" | "USD";
export type CurrencyCode = (typeof CurrencyCode)[keyof typeof CurrencyCode];

/**
* @public
Expand Down Expand Up @@ -355,7 +364,7 @@ export interface DescribeSavingsPlanRatesResponse {

/**
* <p>The token to use to retrieve the next page of results. This value is null when there are no more
* results to return.</p>
* results to return. </p>
*/
nextToken?: string;
}
Expand Down
Loading

0 comments on commit f4513f2

Please sign in to comment.