Skip to content

Commit

Permalink
feat(client-billingconductor): This release adds a new filter to List…
Browse files Browse the repository at this point in the history
…AccountAssociations API and a new filter to ListBillingGroups API.
  • Loading branch information
awstools committed Mar 17, 2023
1 parent ffb7403 commit ce232dd
Show file tree
Hide file tree
Showing 5 changed files with 669 additions and 470 deletions.
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
59 changes: 30 additions & 29 deletions clients/client-billingconductor/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,34 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/billingconductor.json */

const y="type",
z="fn",
A="argv",
B="ref";
const a=true,
b=false,
c="String",
d="PartitionResult",
e="tree",
f="error",
g="endpoint",
h="stringEquals",
i="getAttr",
j={"required":true,"default":false,[y]:"Boolean"},
k={[B]:"Region"},
l={[B]:"Endpoint"},
m={},
n={[B]:d},
o={[f]:"FIPS and DualStack are enabled, but this partition does not support one or both",[y]:f},
p={[f]:"FIPS is enabled but this partition does not support FIPS",[y]:f},
q={[f]:"DualStack is enabled but this partition does not support DualStack",[y]:f},
r={"url":"https://billingconductor.us-east-1.amazonaws.com","properties":{"authSchemes":[{"name":"sigv4","signingRegion":"us-east-1","signingName":"billingconductor"}]},"headers":{}},
s=[{[z]:"booleanEquals",[A]:[{[B]:"UseFIPS"},true]}],
t=[{[z]:"booleanEquals",[A]:[{[B]:"UseDualStack"},true]}],
u=[{[z]:"booleanEquals",[A]:[{[B]:"UseFIPS"},true]},{[z]:"booleanEquals",[A]:[{[B]:"UseDualStack"},true]}],
v=[{[z]:"booleanEquals",[A]:[true,{[z]:i,[A]:[n,"supportsFIPS"]}]},{[z]:"booleanEquals",[A]:[true,{[z]:i,[A]:[n,"supportsDualStack"]}]}],
w=[{[z]:"booleanEquals",[A]:[true,{[z]:i,[A]:[n,"supportsFIPS"]}]}],
x=[{[z]:"booleanEquals",[A]:[true,{[z]:i,[A]:[n,"supportsDualStack"]}]}];
const _data={version:"1.0",parameters:{Region:{required:a,[y]:c},UseDualStack:j,UseFIPS:j,Endpoint:{required:b,[y]:c}},rules:[{conditions:[{[z]:"aws.partition",[A]:[k],assign:d}],[y]:e,rules:[{conditions:[{[z]:"isSet",[A]:[l]}],[y]:e,rules:[{conditions:s,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[y]:f},{[y]:e,rules:[{conditions:t,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[y]:f},{endpoint:{url:l,properties:m,headers:m},[y]:g}]}]},{conditions:[{[z]:h,[A]:[{[z]:i,[A]:[n,"name"]},"aws"]}],[y]:e,rules:[{conditions:u,[y]:e,rules:[{conditions:v,[y]:e,rules:[{endpoint:{url:"https://billingconductor-fips.{Region}.api.aws",properties:m,headers:m},[y]:g}]},o]},{conditions:s,[y]:e,rules:[{conditions:w,[y]:e,rules:[{endpoint:{url:"https://billingconductor-fips.{Region}.amazonaws.com",properties:m,headers:m},[y]:g}]},p]},{conditions:t,[y]:e,rules:[{conditions:x,[y]:e,rules:[{endpoint:{url:"https://billingconductor.{Region}.api.aws",properties:m,headers:m},[y]:g}]},q]},{endpoint:r,[y]:g}]},{conditions:u,[y]:e,rules:[{conditions:v,[y]:e,rules:[{[y]:e,rules:[{endpoint:{url:"https://billingconductor-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},[y]:g}]}]},o]},{conditions:s,[y]:e,rules:[{conditions:w,[y]:e,rules:[{[y]:e,rules:[{endpoint:{url:"https://billingconductor-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},[y]:g}]}]},p]},{conditions:t,[y]:e,rules:[{conditions:x,[y]:e,rules:[{[y]:e,rules:[{endpoint:{url:"https://billingconductor.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},[y]:g}]}]},q]},{[y]:e,rules:[{conditions:[{[z]:h,[A]:[k,"aws-global"]}],endpoint:r,[y]:g},{endpoint:{url:"https://billingconductor.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},[y]:g}]}]}]};
const y="required",
z="type",
A="fn",
B="argv",
C="ref";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e="PartitionResult",
f="stringEquals",
g="getAttr",
h={[y]:false,[z]:"String"},
i={[y]:true,"default":false,[z]:"Boolean"},
j={[C]:"Endpoint"},
k={},
l={[C]:"Region"},
m={[C]:e},
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://billingconductor.us-east-1.amazonaws.com","properties":{"authSchemes":[{"name":"sigv4","signingName":"billingconductor","signingRegion":"us-east-1"}]},"headers":{}},
r=[{[A]:"booleanEquals",[B]:[{[C]:"UseFIPS"},true]}],
s=[{[A]:"booleanEquals",[B]:[{[C]:"UseDualStack"},true]}],
t=[l],
u=[{[A]:"booleanEquals",[B]:[{[C]:"UseFIPS"},true]},{[A]:"booleanEquals",[B]:[{[C]:"UseDualStack"},true]}],
v=[{[A]:"booleanEquals",[B]:[true,{[A]:g,[B]:[m,"supportsFIPS"]}]},{[A]:"booleanEquals",[B]:[true,{[A]:g,[B]:[m,"supportsDualStack"]}]}],
w=[{[A]:"booleanEquals",[B]:[true,{[A]:g,[B]:[m,"supportsFIPS"]}]}],
x=[{[A]:"booleanEquals",[B]:[true,{[A]:g,[B]:[m,"supportsDualStack"]}]}];
const _data={version:"1.0",parameters:{Region:h,UseDualStack:i,UseFIPS:i,Endpoint:h},rules:[{conditions:[{[A]:a,[B]:[j]}],[z]:b,rules:[{conditions:r,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[z]:c},{[z]:b,rules:[{conditions:s,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[z]:c},{endpoint:{url:j,properties:k,headers:k},[z]:d}]}]},{[z]:b,rules:[{conditions:[{[A]:a,[B]:t}],[z]:b,rules:[{conditions:[{[A]:"aws.partition",[B]:t,assign:e}],[z]:b,rules:[{conditions:[{[A]:f,[B]:[{[A]:g,[B]:[m,"name"]},"aws"]}],[z]:b,rules:[{conditions:u,[z]:b,rules:[{conditions:v,[z]:b,rules:[{endpoint:{url:"https://billingconductor-fips.{Region}.api.aws",properties:k,headers:k},[z]:d}]},n]},{conditions:r,[z]:b,rules:[{conditions:w,[z]:b,rules:[{endpoint:{url:"https://billingconductor-fips.{Region}.amazonaws.com",properties:k,headers:k},[z]:d}]},o]},{conditions:s,[z]:b,rules:[{conditions:x,[z]:b,rules:[{endpoint:{url:"https://billingconductor.{Region}.api.aws",properties:k,headers:k},[z]:d}]},p]},{endpoint:q,[z]:d}]},{conditions:u,[z]:b,rules:[{conditions:v,[z]:b,rules:[{[z]:b,rules:[{endpoint:{url:"https://billingconductor-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},[z]:d}]}]},n]},{conditions:r,[z]:b,rules:[{conditions:w,[z]:b,rules:[{[z]:b,rules:[{endpoint:{url:"https://billingconductor-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},[z]:d}]}]},o]},{conditions:s,[z]:b,rules:[{conditions:x,[z]:b,rules:[{[z]:b,rules:[{endpoint:{url:"https://billingconductor.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},[z]:d}]}]},p]},{[z]:b,rules:[{conditions:[{[A]:f,[B]:[l,"aws-global"]}],endpoint:q,[z]:d},{endpoint:{url:"https://billingconductor.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},[z]:d}]}]}]},{error:"Invalid Configuration: Missing Region",[z]:c}]}]};
export const ruleSet: RuleSetObject = _data;
60 changes: 55 additions & 5 deletions clients/client-billingconductor/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,22 @@ export enum ValidationExceptionReason {
ILLEGAL_ENDED_BILLINGGROUP = "ILLEGAL_ENDED_BILLINGGROUP",
ILLEGAL_EXPRESSION = "ILLEGAL_EXPRESSION",
ILLEGAL_MODIFIER_PERCENTAGE = "ILLEGAL_MODIFIER_PERCENTAGE",
ILLEGAL_OPERATION = "ILLEGAL_OPERATION",
ILLEGAL_PRIMARY_ACCOUNT = "ILLEGAL_PRIMARY_ACCOUNT",
ILLEGAL_RESOURCE_ARNS = "ILLEGAL_RESOURCE_ARNS",
ILLEGAL_SCOPE = "ILLEGAL_SCOPE",
ILLEGAL_SERVICE = "ILLEGAL_SERVICE",
ILLEGAL_TIERING_INPUT = "ILLEGAL_TIERING_INPUT",
ILLEGAL_TYPE = "ILLEGAL_TYPE",
ILLEGAL_UPDATE_CHARGE_DETAILS = "ILLEGAL_UPDATE_CHARGE_DETAILS",
ILLEGAL_USAGE_TYPE = "ILLEGAL_USAGE_TYPE",
INVALID_ARN = "INVALID_ARN",
INVALID_BILLINGVIEW_ARN = "INVALID_BILLINGVIEW_ARN",
INVALID_BILLING_GROUP = "INVALID_BILLING_GROUP",
INVALID_BILLING_GROUP_STATUS = "INVALID_BILLING_GROUP_STATUS",
INVALID_BILLING_PERIOD_FOR_OPERATION = "INVALID_BILLING_PERIOD_FOR_OPERATION",
INVALID_FILTER = "INVALID_FILTER",
INVALID_SKU_COMBO = "INVALID_SKU_COMBO",
INVALID_TIME_RANGE = "INVALID_TIME_RANGE",
MISMATCHED_BILLINGGROUP_ARN = "MISMATCHED_BILLINGGROUP_ARN",
MISMATCHED_BILLINGVIEW_ARN = "MISMATCHED_BILLINGVIEW_ARN",
Expand Down Expand Up @@ -563,6 +567,11 @@ export interface DisassociateAccountsOutput {
Arn?: string;
}

export enum BillingGroupStatus {
ACTIVE = "ACTIVE",
PRIMARY_ACCOUNT_MISSING = "PRIMARY_ACCOUNT_MISSING",
}

/**
* <p>The filter that specifies the billing groups and pricing plans to retrieve billing group information.
* </p>
Expand All @@ -577,6 +586,13 @@ export interface ListBillingGroupsFilter {
* <p>The pricing plan Amazon Resource Names (ARNs) to retrieve information. </p>
*/
PricingPlan?: string;

/**
* <p>
* A list of billing groups to retrieve their current status for a specific time range
* </p>
*/
Statuses?: (BillingGroupStatus | string)[];
}

export interface ListBillingGroupsInput {
Expand Down Expand Up @@ -605,11 +621,6 @@ export interface ListBillingGroupsInput {
Filters?: ListBillingGroupsFilter;
}

export enum BillingGroupStatus {
ACTIVE = "ACTIVE",
PRIMARY_ACCOUNT_MISSING = "PRIMARY_ACCOUNT_MISSING",
}

/**
* <p>A representation of a billing group.
* </p>
Expand Down Expand Up @@ -1357,6 +1368,20 @@ export interface CustomLineItemVersionListElement {
* <p>The end billing period of the custom line item version.</p>
*/
EndBillingPeriod?: string;

/**
* <p>
* A list of custom line item Amazon Resource Names (ARNs) to retrieve information.
* </p>
*/
Arn?: string;

/**
* <p>
* The inclusive start time.
* </p>
*/
StartTime?: number;
}

export interface ListCustomLineItemVersionsOutput {
Expand Down Expand Up @@ -1639,6 +1664,13 @@ export interface ListAccountAssociationsFilter {
* </p>
*/
AccountId?: string;

/**
* <p>
* The list of Amazon Web Services IDs to retrieve their associated billing group for a given time range.
* </p>
*/
AccountIds?: string[];
}

export interface ListAccountAssociationsInput {
Expand Down Expand Up @@ -2080,6 +2112,7 @@ export enum PricingRuleScope {
BILLING_ENTITY = "BILLING_ENTITY",
GLOBAL = "GLOBAL",
SERVICE = "SERVICE",
SKU = "SKU",
}

/**
Expand Down Expand Up @@ -2376,6 +2409,23 @@ export interface PricingRuleListElement {
* </p>
*/
Tiering?: Tiering;

/**
* <p>
* Usage type is the unit that each service uses to measure the usage of a specific type of resource.</p>
* <p>If the <code>Scope</code> attribute is set to <code>SKU</code>, this attribute indicates which usage type the <code>PricingRule</code> is modifying. For example, <code>USW2-BoxUsage:m2.2xlarge</code> describes an<code> M2 High Memory Double Extra Large</code> instance in the US West (Oregon) Region.
*
* </p>
*/
UsageType?: string;

/**
* <p>
* Operation is the specific Amazon Web Services action covered by this line item. This describes the specific usage of the line item.</p>
* <p>
* If the <code>Scope</code> attribute is set to <code>SKU</code>, this attribute indicates which operation the <code>PricingRule</code> is modifying. For example, a value of <code>RunInstances:0202</code> indicates the operation of running an Amazon EC2 instance.</p>
*/
Operation?: string;
}

export interface ListPricingRulesOutput {
Expand Down
28 changes: 28 additions & 0 deletions clients/client-billingconductor/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ import {
AssociateResourceResponseElement,
BillingGroupCostReportElement,
BillingGroupListElement,
BillingGroupStatus,
ComputationPreference,
ConflictException,
CreateFreeTierConfig,
Expand Down Expand Up @@ -3041,6 +3042,14 @@ const serializeAws_restJson1AccountGrouping = (input: AccountGrouping, context:
};
};

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

const serializeAws_restJson1AccountIdList = (input: string[], context: __SerdeContext): any => {
return input
.filter((e: any) => e != null)
Expand All @@ -3057,6 +3066,17 @@ const serializeAws_restJson1BillingGroupArnList = (input: string[], context: __S
});
};

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

const serializeAws_restJson1ComputationPreference = (input: ComputationPreference, context: __SerdeContext): any => {
return {
...(input.PricingPlanArn != null && { PricingPlanArn: input.PricingPlanArn }),
Expand Down Expand Up @@ -3170,6 +3190,9 @@ const serializeAws_restJson1ListAccountAssociationsFilter = (
): any => {
return {
...(input.AccountId != null && { AccountId: input.AccountId }),
...(input.AccountIds != null && {
AccountIds: serializeAws_restJson1AccountIdFilterList(input.AccountIds, context),
}),
...(input.Association != null && { Association: input.Association }),
};
};
Expand All @@ -3192,6 +3215,7 @@ const serializeAws_restJson1ListBillingGroupsFilter = (
return {
...(input.Arns != null && { Arns: serializeAws_restJson1BillingGroupArnList(input.Arns, context) }),
...(input.PricingPlan != null && { PricingPlan: input.PricingPlan }),
...(input.Statuses != null && { Statuses: serializeAws_restJson1BillingGroupStatusList(input.Statuses, context) }),
};
};

Expand Down Expand Up @@ -3525,6 +3549,7 @@ const deserializeAws_restJson1CustomLineItemVersionListElement = (
context: __SerdeContext
): CustomLineItemVersionListElement => {
return {
Arn: __expectString(output.Arn),
AssociationSize: __expectLong(output.AssociationSize),
BillingGroupArn: __expectString(output.BillingGroupArn),
ChargeDetails:
Expand All @@ -3539,6 +3564,7 @@ const deserializeAws_restJson1CustomLineItemVersionListElement = (
Name: __expectString(output.Name),
ProductCode: __expectString(output.ProductCode),
StartBillingPeriod: __expectString(output.StartBillingPeriod),
StartTime: __expectLong(output.StartTime),
} as any;
};

Expand Down Expand Up @@ -3709,10 +3735,12 @@ const deserializeAws_restJson1PricingRuleListElement = (
LastModifiedTime: __expectLong(output.LastModifiedTime),
ModifierPercentage: __limitedParseDouble(output.ModifierPercentage),
Name: __expectString(output.Name),
Operation: __expectString(output.Operation),
Scope: __expectString(output.Scope),
Service: __expectString(output.Service),
Tiering: output.Tiering != null ? deserializeAws_restJson1Tiering(output.Tiering, context) : undefined,
Type: __expectString(output.Type),
UsageType: __expectString(output.UsageType),
} as any;
};

Expand Down
Loading

0 comments on commit ce232dd

Please sign in to comment.