Skip to content

create_bill_scenario async

create_bill_scenario(
    name: BillScenarioName,
    *,
    config_overrides: Optional[AsyncBCMPricingCalculatorClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[Tags] = None,
    group_sharing_preference: Optional[GroupSharingPreferenceEnum] = None,
    cost_category_group_sharing_preference_arn: Optional[CostCategoryArn] = None,
) -> CreateBillScenarioResponse

Creates a new bill scenario to model potential changes to Amazon Web Services usage and costs.

Parameters:

  • name (BillScenarioName) –

    A descriptive name for the bill scenario.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier to ensure idempotency of the request.

  • tags (Optional[Tags], default: None ) –

    The tags to apply to the bill scenario.

  • group_sharing_preference (Optional[GroupSharingPreferenceEnum], default: None ) –

    The setting for the reserved instance and savings plan group sharing used in this estimate.

  • cost_category_group_sharing_preference_arn (Optional[CostCategoryArn], default: None ) –

    The arn of the cost category used in the reserved and prioritized group sharing.

Raises:

Source code in docs_src/capo_bcm_pricing_calculator/_services/async_bcm_pricing_calculator.py
async def create_bill_scenario(
    self,
    name: "capo_bcm_pricing_calculator.types.bill_scenario_name.BillScenarioName",
    *,
    config_overrides: Optional[AsyncBCMPricingCalculatorClientConfig] = None,
    client_token: Optional[
        "capo_bcm_pricing_calculator.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_bcm_pricing_calculator.types.tags.Tags"] = None,
    group_sharing_preference: Optional[
        "capo_bcm_pricing_calculator.types.group_sharing_preference_enum.GroupSharingPreferenceEnum"
    ] = None,
    cost_category_group_sharing_preference_arn: Optional[
        "capo_bcm_pricing_calculator.types.cost_category_arn.CostCategoryArn"
    ] = None,
) -> "capo_bcm_pricing_calculator.types.create_bill_scenario_response.CreateBillScenarioResponse":
    """<p> Creates a new bill scenario to model potential changes to Amazon Web Services usage and costs. </p>

    Args:
        name: <p> A descriptive name for the bill scenario. </p>
        client_token: <p> A unique, case-sensitive identifier to ensure idempotency of the request. </p>
        tags: <p> The tags to apply to the bill scenario. </p>
        group_sharing_preference: <p>The setting for the reserved instance and savings plan group sharing used in this estimate.</p>
        cost_category_group_sharing_preference_arn: <p>The arn of the cost category used in the reserved and prioritized group sharing.</p>

    Raises:
        capo_bcm_pricing_calculator.errors.access_denied_exception.AccessDeniedException: <p> You do not have sufficient access to perform this action. </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 could not be processed because of conflict in the current state of the resource. </p>
        capo_bcm_pricing_calculator.errors.data_unavailable_exception.DataUnavailableException: <p> The requested data is currently unavailable. </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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bcm_pricing_calculator.types.create_bill_scenario_request.CreateBillScenarioRequest]",
    ) -> AsyncOperationResponse[
        "capo_bcm_pricing_calculator.types.create_bill_scenario_response.CreateBillScenarioResponse"
    ]:
        import capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.create_bill_scenario

        (
            output,
            http_response,
        ) = await capo_bcm_pricing_calculator._operations.awsbcm_pricing_calculator.create_bill_scenario.async_create_bill_scenario(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateBillScenario")
    )
    input_: capo_bcm_pricing_calculator.types.create_bill_scenario_request.CreateBillScenarioRequest = {
        "name": name
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags
    if group_sharing_preference is not None:
        input_["group_sharing_preference"] = group_sharing_preference
    if cost_category_group_sharing_preference_arn is not None:
        input_["cost_category_group_sharing_preference_arn"] = (
            cost_category_group_sharing_preference_arn
        )

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output