Skip to content

update_billing_view async

update_billing_view(
    arn: BillingViewArn,
    *,
    config_overrides: Optional[AsyncBillingClientConfig] = None,
    name: Optional[BillingViewName] = None,
    description: Optional[BillingViewDescription] = None,
    data_filter_expression: Optional[Expression] = None,
) -> UpdateBillingViewResponse

An API to update the attributes of the billing view.

Parameters:

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this action.

  • BillingViewHealthStatusException –

    Exception thrown when a billing view's health status prevents an operation from being performed. This may occur if the billing view is in a state other than HEALTHY.

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

  • InternalServerException –

    The request processing failed because of an unknown error, exception, or failure.

  • ResourceNotFoundException –

    The specified ARN in the request doesn't exist.

  • ServiceQuotaExceededException –

    You've reached the limit of resources you can create, or exceeded the size of an individual resource.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by an Amazon Web Services service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Invoke UpdateBillingView

>>> await client.update_billing_view(name='Example Custom Billing View', arn='arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899', description='Custom Billing View Example -- updated description', data_filter_expression={'dimensions': {'key': 'LINKED_ACCOUNT', 'values': ['000000000000']}})
Source code in docs_src/capo_billing/_services/async_billing.py
async def update_billing_view(
    self,
    arn: "capo_billing.types.billing_view_arn.BillingViewArn",
    *,
    config_overrides: Optional[AsyncBillingClientConfig] = None,
    name: Optional["capo_billing.types.billing_view_name.BillingViewName"] = None,
    description: Optional[
        "capo_billing.types.billing_view_description.BillingViewDescription"
    ] = None,
    data_filter_expression: Optional[
        "capo_billing.types.expression.Expression"
    ] = None,
) -> "capo_billing.types.update_billing_view_response.UpdateBillingViewResponse":
    """<p>An API to update the attributes of the billing view. </p>

    Args:
        arn: <p> The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. </p>
        name: <p> The name of the billing view. </p>
        description: <p> The description of the billing view. </p>
        data_filter_expression: <p>See <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_billing_Expression.html">Expression</a>. Billing view only supports <code>LINKED_ACCOUNT</code>, <code>Tags</code>, and <code>CostCategories</code>. </p>

    Raises:
        capo_billing.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
        capo_billing.errors.billing_view_health_status_exception.BillingViewHealthStatusException: <p> Exception thrown when a billing view's health status prevents an operation from being performed. This may occur if the billing view is in a state other than <code>HEALTHY</code>.</p>
        capo_billing.errors.conflict_exception.ConflictException: <p> The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
        capo_billing.errors.internal_server_exception.InternalServerException: <p>The request processing failed because of an unknown error, exception, or failure. </p>
        capo_billing.errors.resource_not_found_exception.ResourceNotFoundException: <p> The specified ARN in the request doesn't exist. </p>
        capo_billing.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> You've reached the limit of resources you can create, or exceeded the size of an individual resource. </p>
        capo_billing.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. </p>
        capo_billing.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service. </p>
        capo_billing.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Invoke UpdateBillingView

        >>> await client.update_billing_view(name='Example Custom Billing View', arn='arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899', description='Custom Billing View Example -- updated description', data_filter_expression={'dimensions': {'key': 'LINKED_ACCOUNT', 'values': ['000000000000']}})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_billing.types.update_billing_view_request.UpdateBillingViewRequest]",
    ) -> AsyncOperationResponse[
        "capo_billing.types.update_billing_view_response.UpdateBillingViewResponse"
    ]:
        import capo_billing._operations.aws_billing.update_billing_view

        (
            output,
            http_response,
        ) = await capo_billing._operations.aws_billing.update_billing_view.async_update_billing_view(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_billing.types.update_billing_view_request.UpdateBillingViewRequest",
    ) -> dict[str, Any]:
        import capo_billing.types.update_billing_view_request

        return capo_billing.types.update_billing_view_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateBillingView", redact_input=_redact_input),
    )
    input_: capo_billing.types.update_billing_view_request.UpdateBillingViewRequest = {
        "arn": arn
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if data_filter_expression is not None:
        input_["data_filter_expression"] = data_filter_expression

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