-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-billingconductor): Billing Conductor is releasing a new A…
…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
Showing
12 changed files
with
833 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
187 changes: 187 additions & 0 deletions
187
clients/client-billingconductor/src/commands/GetBillingGroupCostReportCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.