Skip to content

update_custom_line_item async

update_custom_line_item(
    arn: CustomLineItemArn,
    *,
    config_overrides: Optional[AsyncbillingconductorClientConfig] = None,
    name: Optional[CustomLineItemName] = None,
    description: Optional[CustomLineItemDescription] = None,
    charge_details: Optional[UpdateCustomLineItemChargeDetails] = None,
    billing_period_range: Optional[CustomLineItemBillingPeriodRange] = None,
) -> UpdateCustomLineItemOutput

Update an existing custom line item in the current or previous billing period.

Parameters:

Raises:

Source code in docs_src/capo_billingconductor/_services/async_billingconductor.py
async def update_custom_line_item(
    self,
    arn: "capo_billingconductor.types.custom_line_item_arn.CustomLineItemArn",
    *,
    config_overrides: Optional[AsyncbillingconductorClientConfig] = None,
    name: Optional[
        "capo_billingconductor.types.custom_line_item_name.CustomLineItemName"
    ] = None,
    description: Optional[
        "capo_billingconductor.types.custom_line_item_description.CustomLineItemDescription"
    ] = None,
    charge_details: Optional[
        "capo_billingconductor.types.update_custom_line_item_charge_details.UpdateCustomLineItemChargeDetails"
    ] = None,
    billing_period_range: Optional[
        "capo_billingconductor.types.custom_line_item_billing_period_range.CustomLineItemBillingPeriodRange"
    ] = None,
) -> "capo_billingconductor.types.update_custom_line_item_output.UpdateCustomLineItemOutput":
    """<p> Update an existing custom line item in the current or previous billing period. </p>

    Args:
        arn: <p> The ARN of the custom line item to be updated. </p>
        name: <p> The new name for the custom line item. </p>
        description: <p> The new line item description of the custom line item. </p>
        charge_details: <p> A <code>ListCustomLineItemChargeDetails</code> containing the new charge details for the custom line item. </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_custom_line_item_input.UpdateCustomLineItemInput]",
    ) -> AsyncOperationResponse[
        "capo_billingconductor.types.update_custom_line_item_output.UpdateCustomLineItemOutput"
    ]:
        import capo_billingconductor._operations.aws_billing_conductor.update_custom_line_item

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

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

        return capo_billingconductor.types.update_custom_line_item_input.redact_sensitive(
            input_
        )

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

        return capo_billingconductor.types.update_custom_line_item_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateCustomLineItem",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_billingconductor.types.update_custom_line_item_input.UpdateCustomLineItemInput = {
        "arn": arn
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if charge_details is not None:
        input_["charge_details"] = charge_details
    if billing_period_range is not None:
        input_["billing_period_range"] = billing_period_range

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