Skip to content

Commit

Permalink
feat(client-billingconductor): Billing Conductor is releasing a new A…
Browse files Browse the repository at this point in the history
…PI, GetBillingGroupCostReport, which provides the ability to retrieve/view the Billing Group Cost Report broken down by attributes for a specific billing group.
  • Loading branch information
awstools committed Dec 14, 2023
1 parent 9c8b6c6 commit ba49477
Show file tree
Hide file tree
Showing 12 changed files with 833 additions and 45 deletions.
27 changes: 18 additions & 9 deletions clients/client-billingconductor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@

AWS SDK for JavaScript Billingconductor Client for Node.js, Browser and React Native.

<p>Amazon Web Services Billing Conductor is a fully managed service that you can use
to customize a <a href="https://docs.aws.amazon.com/billingconductor/latest/userguide/understanding-eb.html#eb-other-definitions">pro forma</a> version of your billing data each month, to accurately show or chargeback
your end customers. Amazon Web Services Billing Conductor doesn't change the way
you're billed by Amazon Web Services each month by design. Instead, it provides you with a
mechanism to configure, generate, and display rates to certain customers over a given billing
period. You can also analyze the difference between the rates you apply to your accounting
groupings relative to your actual rates from Amazon Web Services. As a result of your Amazon Web Services Billing Conductor configuration, the payer account can also see the
custom rate applied on the billing details page of the <a href="https://console.aws.amazon.com/billing">Amazon Web Services Billing console</a>, or configure a cost and usage report per
billing group.</p>
<p>Amazon Web Services Billing Conductor is a fully managed service that you can use to
customize a <a href="https://docs.aws.amazon.com/billingconductor/latest/userguide/understanding-eb.html#eb-other-definitions">proforma</a> version of your billing data each month, to accurately show or chargeback
your end customers. Amazon Web Services Billing Conductor doesn't change the way you're billed
by Amazon Web Services each month by design. Instead, it provides you with a mechanism to
configure, generate, and display rates to certain customers over a given billing period. You
can also analyze the difference between the rates you apply to your accounting groupings
relative to your actual rates from Amazon Web Services. As a result of your Amazon Web Services
Billing Conductor configuration, the payer account can also see the custom rate applied on the
billing details page of the <a href="https://console.aws.amazon.com/billing">Amazon Web Services Billing
console</a>, or configure a cost and usage report per billing group.</p>
<p>This documentation shows how you can configure Amazon Web Services Billing Conductor using its
API. For more information about using the <a href="https://console.aws.amazon.com/billingconductor/">Amazon Web Services
Billing Conductor</a> user interface, see the <a href="https://docs.aws.amazon.com/billingconductor/latest/userguide/what-is-billingconductor.html"> Amazon Web Services Billing Conductor User Guide</a>.</p>
Expand Down Expand Up @@ -325,6 +326,14 @@ DisassociatePricingRules

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billingconductor/command/DisassociatePricingRulesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billingconductor/Interface/DisassociatePricingRulesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billingconductor/Interface/DisassociatePricingRulesCommandOutput/)

</details>
<details>
<summary>
GetBillingGroupCostReport
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billingconductor/command/GetBillingGroupCostReportCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billingconductor/Interface/GetBillingGroupCostReportCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billingconductor/Interface/GetBillingGroupCostReportCommandOutput/)

</details>
<details>
<summary>
Expand Down
42 changes: 33 additions & 9 deletions clients/client-billingconductor/src/Billingconductor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ import {
DisassociatePricingRulesCommandInput,
DisassociatePricingRulesCommandOutput,
} from "./commands/DisassociatePricingRulesCommand";
import {
GetBillingGroupCostReportCommand,
GetBillingGroupCostReportCommandInput,
GetBillingGroupCostReportCommandOutput,
} from "./commands/GetBillingGroupCostReportCommand";
import {
ListAccountAssociationsCommand,
ListAccountAssociationsCommandInput,
Expand Down Expand Up @@ -170,6 +175,7 @@ const commands = {
DeletePricingRuleCommand,
DisassociateAccountsCommand,
DisassociatePricingRulesCommand,
GetBillingGroupCostReportCommand,
ListAccountAssociationsCommand,
ListBillingGroupCostReportsCommand,
ListBillingGroupsCommand,
Expand Down Expand Up @@ -428,6 +434,23 @@ export interface Billingconductor {
cb: (err: any, data?: DisassociatePricingRulesCommandOutput) => void
): void;

/**
* @see {@link GetBillingGroupCostReportCommand}
*/
getBillingGroupCostReport(
args: GetBillingGroupCostReportCommandInput,
options?: __HttpHandlerOptions
): Promise<GetBillingGroupCostReportCommandOutput>;
getBillingGroupCostReport(
args: GetBillingGroupCostReportCommandInput,
cb: (err: any, data?: GetBillingGroupCostReportCommandOutput) => void
): void;
getBillingGroupCostReport(
args: GetBillingGroupCostReportCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetBillingGroupCostReportCommandOutput) => void
): void;

/**
* @see {@link ListAccountAssociationsCommand}
*/
Expand Down Expand Up @@ -708,15 +731,16 @@ export interface Billingconductor {

/**
* @public
* <p>Amazon Web Services Billing Conductor is a fully managed service that you can use
* to customize a <a href="https://docs.aws.amazon.com/billingconductor/latest/userguide/understanding-eb.html#eb-other-definitions">pro forma</a> version of your billing data each month, to accurately show or chargeback
* your end customers. Amazon Web Services Billing Conductor doesn't change the way
* you're billed by Amazon Web Services each month by design. Instead, it provides you with a
* mechanism to configure, generate, and display rates to certain customers over a given billing
* period. You can also analyze the difference between the rates you apply to your accounting
* groupings relative to your actual rates from Amazon Web Services. As a result of your Amazon Web Services Billing Conductor configuration, the payer account can also see the
* custom rate applied on the billing details page of the <a href="https://console.aws.amazon.com/billing">Amazon Web Services Billing console</a>, or configure a cost and usage report per
* billing group.</p>
* <p>Amazon Web Services Billing Conductor is a fully managed service that you can use to
* customize a <a href="https://docs.aws.amazon.com/billingconductor/latest/userguide/understanding-eb.html#eb-other-definitions">proforma</a> version of your billing data each month, to accurately show or chargeback
* your end customers. Amazon Web Services Billing Conductor doesn't change the way you're billed
* by Amazon Web Services each month by design. Instead, it provides you with a mechanism to
* configure, generate, and display rates to certain customers over a given billing period. You
* can also analyze the difference between the rates you apply to your accounting groupings
* relative to your actual rates from Amazon Web Services. As a result of your Amazon Web Services
* Billing Conductor configuration, the payer account can also see the custom rate applied on the
* billing details page of the <a href="https://console.aws.amazon.com/billing">Amazon Web Services Billing
* console</a>, or configure a cost and usage report per billing group.</p>
* <p>This documentation shows how you can configure Amazon Web Services Billing Conductor using its
* API. For more information about using the <a href="https://console.aws.amazon.com/billingconductor/">Amazon Web Services
* Billing Conductor</a> user interface, see the <a href="https://docs.aws.amazon.com/billingconductor/latest/userguide/what-is-billingconductor.html"> Amazon Web Services Billing Conductor User Guide</a>.</p>
Expand Down
25 changes: 16 additions & 9 deletions clients/client-billingconductor/src/BillingconductorClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ import {
DisassociatePricingRulesCommandInput,
DisassociatePricingRulesCommandOutput,
} from "./commands/DisassociatePricingRulesCommand";
import {
GetBillingGroupCostReportCommandInput,
GetBillingGroupCostReportCommandOutput,
} from "./commands/GetBillingGroupCostReportCommand";
import {
ListAccountAssociationsCommandInput,
ListAccountAssociationsCommandOutput,
Expand Down Expand Up @@ -156,6 +160,7 @@ export type ServiceInputTypes =
| DeletePricingRuleCommandInput
| DisassociateAccountsCommandInput
| DisassociatePricingRulesCommandInput
| GetBillingGroupCostReportCommandInput
| ListAccountAssociationsCommandInput
| ListBillingGroupCostReportsCommandInput
| ListBillingGroupsCommandInput
Expand Down Expand Up @@ -192,6 +197,7 @@ export type ServiceOutputTypes =
| DeletePricingRuleCommandOutput
| DisassociateAccountsCommandOutput
| DisassociatePricingRulesCommandOutput
| GetBillingGroupCostReportCommandOutput
| ListAccountAssociationsCommandOutput
| ListBillingGroupCostReportsCommandOutput
| ListBillingGroupsCommandOutput
Expand Down Expand Up @@ -382,15 +388,16 @@ export interface BillingconductorClientResolvedConfig extends BillingconductorCl

/**
* @public
* <p>Amazon Web Services Billing Conductor is a fully managed service that you can use
* to customize a <a href="https://docs.aws.amazon.com/billingconductor/latest/userguide/understanding-eb.html#eb-other-definitions">pro forma</a> version of your billing data each month, to accurately show or chargeback
* your end customers. Amazon Web Services Billing Conductor doesn't change the way
* you're billed by Amazon Web Services each month by design. Instead, it provides you with a
* mechanism to configure, generate, and display rates to certain customers over a given billing
* period. You can also analyze the difference between the rates you apply to your accounting
* groupings relative to your actual rates from Amazon Web Services. As a result of your Amazon Web Services Billing Conductor configuration, the payer account can also see the
* custom rate applied on the billing details page of the <a href="https://console.aws.amazon.com/billing">Amazon Web Services Billing console</a>, or configure a cost and usage report per
* billing group.</p>
* <p>Amazon Web Services Billing Conductor is a fully managed service that you can use to
* customize a <a href="https://docs.aws.amazon.com/billingconductor/latest/userguide/understanding-eb.html#eb-other-definitions">proforma</a> version of your billing data each month, to accurately show or chargeback
* your end customers. Amazon Web Services Billing Conductor doesn't change the way you're billed
* by Amazon Web Services each month by design. Instead, it provides you with a mechanism to
* configure, generate, and display rates to certain customers over a given billing period. You
* can also analyze the difference between the rates you apply to your accounting groupings
* relative to your actual rates from Amazon Web Services. As a result of your Amazon Web Services
* Billing Conductor configuration, the payer account can also see the custom rate applied on the
* billing details page of the <a href="https://console.aws.amazon.com/billing">Amazon Web Services Billing
* console</a>, or configure a cost and usage report per billing group.</p>
* <p>This documentation shows how you can configure Amazon Web Services Billing Conductor using its
* API. For more information about using the <a href="https://console.aws.amazon.com/billingconductor/">Amazon Web Services
* Billing Conductor</a> user interface, see the <a href="https://docs.aws.amazon.com/billingconductor/latest/userguide/what-is-billingconductor.html"> Amazon Web Services Billing Conductor User Guide</a>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export interface CreateCustomLineItemCommandOutput extends CreateCustomLineItemO

/**
* @public
* <p>
* Creates a custom line item that can be used to create a one-time fixed charge that can be applied to a single billing group for the current or previous billing period. The one-time fixed charge is either a fee or discount.
* </p>
* <p>Creates a custom line item that can be used to create a one-time fixed charge that can be
* applied to a single billing group for the current or previous billing period. The one-time
* fixed charge is either a fee or discount. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import { BillingconductorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingconductorClient";
import { GetBillingGroupCostReportInput, GetBillingGroupCostReportOutput } from "../models/models_0";
import { de_GetBillingGroupCostReportCommand, se_GetBillingGroupCostReportCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link GetBillingGroupCostReportCommand}.
*/
export interface GetBillingGroupCostReportCommandInput extends GetBillingGroupCostReportInput {}
/**
* @public
*
* The output of {@link GetBillingGroupCostReportCommand}.
*/
export interface GetBillingGroupCostReportCommandOutput extends GetBillingGroupCostReportOutput, __MetadataBearer {}

/**
* @public
* <p>Retrieves the margin summary report, which includes the Amazon Web Services cost and charged
* amount (pro forma cost) by Amazon Web Service for a specific billing group.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { BillingconductorClient, GetBillingGroupCostReportCommand } from "@aws-sdk/client-billingconductor"; // ES Modules import
* // const { BillingconductorClient, GetBillingGroupCostReportCommand } = require("@aws-sdk/client-billingconductor"); // CommonJS import
* const client = new BillingconductorClient(config);
* const input = { // GetBillingGroupCostReportInput
* Arn: "STRING_VALUE", // required
* BillingPeriodRange: { // BillingPeriodRange
* InclusiveStartBillingPeriod: "STRING_VALUE", // required
* ExclusiveEndBillingPeriod: "STRING_VALUE", // required
* },
* GroupBy: [ // GroupByAttributesList
* "STRING_VALUE",
* ],
* MaxResults: Number("int"),
* NextToken: "STRING_VALUE",
* };
* const command = new GetBillingGroupCostReportCommand(input);
* const response = await client.send(command);
* // { // GetBillingGroupCostReportOutput
* // BillingGroupCostReportResults: [ // BillingGroupCostReportResultsList
* // { // BillingGroupCostReportResultElement
* // Arn: "STRING_VALUE",
* // AWSCost: "STRING_VALUE",
* // ProformaCost: "STRING_VALUE",
* // Margin: "STRING_VALUE",
* // MarginPercentage: "STRING_VALUE",
* // Currency: "STRING_VALUE",
* // Attributes: [ // AttributesList
* // { // Attribute
* // Key: "STRING_VALUE",
* // Value: "STRING_VALUE",
* // },
* // ],
* // },
* // ],
* // NextToken: "STRING_VALUE",
* // };
*
* ```
*
* @param GetBillingGroupCostReportCommandInput - {@link GetBillingGroupCostReportCommandInput}
* @returns {@link GetBillingGroupCostReportCommandOutput}
* @see {@link GetBillingGroupCostReportCommandInput} for command's `input` shape.
* @see {@link GetBillingGroupCostReportCommandOutput} for command's `response` shape.
* @see {@link BillingconductorClientResolvedConfig | config} for BillingconductorClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You do not have sufficient access to perform this action.
* </p>
*
* @throws {@link InternalServerException} (server fault)
* <p>An unexpected error occurred while processing a request.
* </p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The request references a resource that doesn't exist.
* </p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The request was denied due to request throttling.
* </p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input doesn't match with the constraints specified by Amazon Web Services.</p>
*
* @throws {@link BillingconductorServiceException}
* <p>Base exception class for all service exceptions from Billingconductor service.</p>
*
*/
export class GetBillingGroupCostReportCommand extends $Command<
GetBillingGroupCostReportCommandInput,
GetBillingGroupCostReportCommandOutput,
BillingconductorClientResolvedConfig
> {
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: GetBillingGroupCostReportCommandInput) {
super();
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: BillingconductorClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetBillingGroupCostReportCommandInput, GetBillingGroupCostReportCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, GetBillingGroupCostReportCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "BillingconductorClient";
const commandName = "GetBillingGroupCostReportCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "AWSBillingConductor",
operation: "GetBillingGroupCostReport",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(input: GetBillingGroupCostReportCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_GetBillingGroupCostReportCommand(input, context);
}

/**
* @internal
*/
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<GetBillingGroupCostReportCommandOutput> {
return de_GetBillingGroupCostReportCommand(output, context);
}
}
1 change: 1 addition & 0 deletions clients/client-billingconductor/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from "./DeletePricingPlanCommand";
export * from "./DeletePricingRuleCommand";
export * from "./DisassociateAccountsCommand";
export * from "./DisassociatePricingRulesCommand";
export * from "./GetBillingGroupCostReportCommand";
export * from "./ListAccountAssociationsCommand";
export * from "./ListBillingGroupCostReportsCommand";
export * from "./ListBillingGroupsCommand";
Expand Down
Loading

0 comments on commit ba49477

Please sign in to comment.