Create Amazon Web Services service usage that you want to model in a Bill Scenario.
The BatchCreateBillScenarioUsageModification operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission bcm-pricing-calculator:CreateBillScenarioUsageModification in your policies.
Parameters:
-
bill_scenario_id
(ResourceId)
–
The ID of the Bill Scenario for which you want to create the modeled usage.
-
usage_modifications
(BatchCreateBillScenarioUsageModificationEntries)
–
List of usage that you want to model in the Bill Scenario.
-
client_token
(Optional[ClientToken], default:
None
)
–
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
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.
-
ConflictException
–
The request couldn't be processed because the resource is in a conflicting state. Verify the resource's current state and retry the request.
-
DataUnavailableException
–
The requested data is currently unavailable.
-
ResourceNotFoundException
–
The specified resource wasn't found.
-
ServiceQuotaExceededException
–
The request would cause you to exceed your service quota.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_bcm_pricing_calculator/_services/bcm_pricing_calculator.py
| def batch_create_bill_scenario_usage_modification(
self,
bill_scenario_id: "capo_bcm_pricing_calculator.types.resource_id.ResourceId",
usage_modifications: "capo_bcm_pricing_calculator.types.batch_create_bill_scenario_usage_modification_entries.BatchCreateBillScenarioUsageModificationEntries",
*,
config_overrides: Optional[BCMPricingCalculatorClientConfig] = None,
client_token: Optional[
"capo_bcm_pricing_calculator.types.client_token.ClientToken"
] = None,
) -> "capo_bcm_pricing_calculator.types.batch_create_bill_scenario_usage_modification_response.BatchCreateBillScenarioUsageModificationResponse":
"""<p> Create Amazon Web Services service usage that you want to model in a Bill Scenario. </p> <note> <p>The <code>BatchCreateBillScenarioUsageModification</code> operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission <code>bcm-pricing-calculator:CreateBillScenarioUsageModification</code> in your policies.</p> </note>
Args:
bill_scenario_id: <p> The ID of the Bill Scenario for which you want to create the modeled usage. </p>
usage_modifications: <p> List of usage that you want to model in the Bill Scenario. </p>
client_token: <p> A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. </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.conflict_exception.ConflictException: <p> The request couldn't be processed because the resource is in a conflicting state. Verify the resource's current state and retry the request. </p>
capo_bcm_pricing_calculator.errors.data_unavailable_exception.DataUnavailableException: <p> The requested data is currently unavailable. </p>
capo_bcm_pricing_calculator.errors.resource_not_found_exception.ResourceNotFoundException: <p> The specified resource wasn't found. </p>
capo_bcm_pricing_calculator.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> The request would cause you to exceed your service quota. </p>
capo_bcm_pricing_calculator.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_bcm_pricing_calculator.types.batch_create_bill_scenario_usage_modification_request.BatchCreateBillScenarioUsageModificationRequest]",
) -> OperationResponse[
"capo_bcm_pricing_calculator.types.batch_create_bill_scenario_usage_modification_response.BatchCreateBillScenarioUsageModificationResponse"
]:
import capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.batch_create_bill_scenario_usage_modification
output, http_response = (
capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.batch_create_bill_scenario_usage_modification.batch_create_bill_scenario_usage_modification(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("BatchCreateBillScenarioUsageModification"),
)
input_: capo_bcm_pricing_calculator.types.batch_create_bill_scenario_usage_modification_request.BatchCreateBillScenarioUsageModificationRequest = {
"bill_scenario_id": bill_scenario_id,
"usage_modifications": usage_modifications,
}
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|