Skip to content

update_pricing_plan async

update_pricing_plan(
    arn: PricingPlanArn,
    *,
    config_overrides: Optional[AsyncbillingconductorClientConfig] = None,
    name: Optional[PricingPlanName] = None,
    description: Optional[PricingPlanDescription] = None,
) -> UpdatePricingPlanOutput

This updates an existing pricing plan.

Parameters:

Raises:

Source code in docs_src/capo_billingconductor/_services/async_billingconductor.py
async def update_pricing_plan(
    self,
    arn: "capo_billingconductor.types.pricing_plan_arn.PricingPlanArn",
    *,
    config_overrides: Optional[AsyncbillingconductorClientConfig] = None,
    name: Optional[
        "capo_billingconductor.types.pricing_plan_name.PricingPlanName"
    ] = None,
    description: Optional[
        "capo_billingconductor.types.pricing_plan_description.PricingPlanDescription"
    ] = None,
) -> (
    "capo_billingconductor.types.update_pricing_plan_output.UpdatePricingPlanOutput"
):
    """<p>This updates an existing pricing plan. </p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the pricing plan that you're updating. </p>
        name: <p>The name of the pricing plan. The name must be unique to each pricing plan. </p>
        description: <p>The description of the pricing plan. </p>

    Raises:
        capo_billingconductor.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. </p>
        capo_billingconductor.errors.conflict_exception.ConflictException: <p>You can cause an inconsistent state by updating or deleting a resource. </p>
        capo_billingconductor.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing a request. </p>
        capo_billingconductor.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that doesn't exist. </p>
        capo_billingconductor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. </p>
        capo_billingconductor.errors.validation_exception.ValidationException: <p>The input doesn't match with the constraints specified by Amazon Web Services services.</p>
        capo_billingconductor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_billingconductor.types.update_pricing_plan_input.UpdatePricingPlanInput]",
    ) -> AsyncOperationResponse[
        "capo_billingconductor.types.update_pricing_plan_output.UpdatePricingPlanOutput"
    ]:
        import capo_billingconductor._operations.aws_billing_conductor.update_pricing_plan

        (
            output,
            http_response,
        ) = await capo_billingconductor._operations.aws_billing_conductor.update_pricing_plan.async_update_pricing_plan(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_billingconductor.types.update_pricing_plan_input.UpdatePricingPlanInput",
    ) -> dict[str, Any]:
        import capo_billingconductor.types.update_pricing_plan_input

        return (
            capo_billingconductor.types.update_pricing_plan_input.redact_sensitive(
                input_
            )
        )

    def _redact_output(
        output: "capo_billingconductor.types.update_pricing_plan_output.UpdatePricingPlanOutput",
    ) -> dict[str, Any]:
        import capo_billingconductor.types.update_pricing_plan_output

        return (
            capo_billingconductor.types.update_pricing_plan_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdatePricingPlan",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_billingconductor.types.update_pricing_plan_input.UpdatePricingPlanInput = {
        "arn": arn
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description

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