-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-pricing): This release adds 2 new APIs - ListPriceLists w…
…hich returns a list of applicable price lists, and GetPriceListFileUrl which outputs a URL to retrieve your price lists from the generated file from ListPriceLists
- Loading branch information
awstools
committed
Mar 1, 2023
1 parent
6458cf1
commit f7201bf
Showing
12 changed files
with
1,620 additions
and
262 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
128 changes: 128 additions & 0 deletions
128
clients/client-pricing/src/commands/GetPriceListFileUrlCommand.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,128 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { | ||
GetPriceListFileUrlRequest, | ||
GetPriceListFileUrlRequestFilterSensitiveLog, | ||
GetPriceListFileUrlResponse, | ||
GetPriceListFileUrlResponseFilterSensitiveLog, | ||
} from "../models/models_0"; | ||
import { PricingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../PricingClient"; | ||
import { | ||
deserializeAws_json1_1GetPriceListFileUrlCommand, | ||
serializeAws_json1_1GetPriceListFileUrlCommand, | ||
} from "../protocols/Aws_json1_1"; | ||
|
||
/** | ||
* The input for {@link GetPriceListFileUrlCommand}. | ||
*/ | ||
export interface GetPriceListFileUrlCommandInput extends GetPriceListFileUrlRequest {} | ||
/** | ||
* The output of {@link GetPriceListFileUrlCommand}. | ||
*/ | ||
export interface GetPriceListFileUrlCommandOutput extends GetPriceListFileUrlResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p> | ||
* <i> | ||
* <b>This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the <a href="https://aws.amazon.com/service-terms/">Amazon Web Services Service Terms</a> (Section 1.10).</b> | ||
* </i> | ||
* </p> | ||
* <p>This returns the URL that you can retrieve your Price List file from. This URL is based on | ||
* the <code>PriceListArn</code> and <code>FileFormat</code> that you retrieve from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> | ||
* <code>ListPriceLists</code> | ||
* </a> response. </p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { PricingClient, GetPriceListFileUrlCommand } from "@aws-sdk/client-pricing"; // ES Modules import | ||
* // const { PricingClient, GetPriceListFileUrlCommand } = require("@aws-sdk/client-pricing"); // CommonJS import | ||
* const client = new PricingClient(config); | ||
* const command = new GetPriceListFileUrlCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link GetPriceListFileUrlCommandInput} for command's `input` shape. | ||
* @see {@link GetPriceListFileUrlCommandOutput} for command's `response` shape. | ||
* @see {@link PricingClientResolvedConfig | config} for PricingClient's `config` shape. | ||
* | ||
*/ | ||
export class GetPriceListFileUrlCommand extends $Command< | ||
GetPriceListFileUrlCommandInput, | ||
GetPriceListFileUrlCommandOutput, | ||
PricingClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
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" }, | ||
}; | ||
} | ||
|
||
constructor(readonly input: GetPriceListFileUrlCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: PricingClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<GetPriceListFileUrlCommandInput, GetPriceListFileUrlCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use( | ||
getEndpointPlugin(configuration, GetPriceListFileUrlCommand.getEndpointParameterInstructions()) | ||
); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "PricingClient"; | ||
const commandName = "GetPriceListFileUrlCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: GetPriceListFileUrlRequestFilterSensitiveLog, | ||
outputFilterSensitiveLog: GetPriceListFileUrlResponseFilterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: GetPriceListFileUrlCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_json1_1GetPriceListFileUrlCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetPriceListFileUrlCommandOutput> { | ||
return deserializeAws_json1_1GetPriceListFileUrlCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
Oops, something went wrong.