Retrieves the estimated cost of a list of usage lines. Each usage line identifies a billing line by its service code, usage type, and operation, and includes the usage amount to price. The estimate is based on Amazon Web Services pricing data and the rate type you choose. It doesn't include taxes, and your actual charges depend on your usage.
The response includes the estimated cost of each usage line that was priced. It also includes each usage line that couldn't be priced, and the reason it couldn't be priced.
Parameters:
-
usage
(GetUsageLinesEstimatedCostInputList)
–
The usage lines that you want to estimate. You can include up to 500 usage lines in a request.
-
rate_type
(RateType)
–
The type of pricing rates to use to estimate the cost of the usage lines. You can only use a rate type that your Pricing Calculator rate preferences allow. If you use billing transfer as a bill source account, you can only use BEFORE_DISCOUNTS
Raises:
-
AccessDeniedException
–
The request is denied because you don't have sufficient permissions to perform this operation. Verify that you have the required permissions and try again.
-
InternalServerException
–
An internal error has occurred. Retry your request, but if the problem persists, contact Amazon Web Services support.
-
ThrottlingException
–
The request was denied due to request throttling.
-
ValidationException
–
The input provided fails to satisfy the constraints specified by an Amazon Web Services service.
-
DataUnavailableException
–
The requested data is currently unavailable.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_bcm_pricing_calculator/_services/async_bcm_pricing_calculator.py
| async def get_usage_lines_estimated_cost(
self,
usage: "capo_bcm_pricing_calculator.types.get_usage_lines_estimated_cost_input_list.GetUsageLinesEstimatedCostInputList",
rate_type: "capo_bcm_pricing_calculator.types.rate_type.RateType",
*,
config_overrides: Optional[AsyncBCMPricingCalculatorClientConfig] = None,
) -> "capo_bcm_pricing_calculator.types.get_usage_lines_estimated_cost_response.GetUsageLinesEstimatedCostResponse":
"""<p> Retrieves the estimated cost of a list of usage lines. Each usage line identifies a billing line by its service code, usage type, and operation, and includes the usage amount to price. The estimate is based on Amazon Web Services pricing data and the rate type you choose. It doesn't include taxes, and your actual charges depend on your usage. </p> <p> The response includes the estimated cost of each usage line that was priced. It also includes each usage line that couldn't be priced, and the reason it couldn't be priced. </p>
Args:
usage: <p> The usage lines that you want to estimate. You can include up to 500 usage lines in a request. </p>
rate_type: <p> The type of pricing rates to use to estimate the cost of the usage lines. You can only use a rate type that your Pricing Calculator rate preferences allow. If you use billing transfer as a bill source account, you can only use BEFORE_DISCOUNTS </p>
Raises:
capo_bcm_pricing_calculator.errors.access_denied_exception.AccessDeniedException: <p> The request is denied because you don't have sufficient permissions to perform this operation. Verify that you have the required permissions and try again. </p>
capo_bcm_pricing_calculator.errors.internal_server_exception.InternalServerException: <p> An internal error has occurred. Retry your request, but if the problem persists, contact Amazon Web Services support. </p>
capo_bcm_pricing_calculator.errors.throttling_exception.ThrottlingException: <p> The request was denied due to request throttling. </p>
capo_bcm_pricing_calculator.errors.validation_exception.ValidationException: <p> The input provided fails to satisfy the constraints specified by an Amazon Web Services service. </p>
capo_bcm_pricing_calculator.errors.data_unavailable_exception.DataUnavailableException: <p> The requested data is currently unavailable. </p>
capo_bcm_pricing_calculator.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_bcm_pricing_calculator.types.get_usage_lines_estimated_cost_request.GetUsageLinesEstimatedCostRequest]",
) -> AsyncOperationResponse[
"capo_bcm_pricing_calculator.types.get_usage_lines_estimated_cost_response.GetUsageLinesEstimatedCostResponse"
]:
import capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.get_usage_lines_estimated_cost
(
output,
http_response,
) = await capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.get_usage_lines_estimated_cost.async_get_usage_lines_estimated_cost(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetUsageLinesEstimatedCost")
)
input_: capo_bcm_pricing_calculator.types.get_usage_lines_estimated_cost_request.GetUsageLinesEstimatedCostRequest = {
"usage": usage,
"rate_type": rate_type,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|