Skip to content

update_invoice_unit async

update_invoice_unit(
    invoice_unit_arn: InvoiceUnitArnString,
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
    description: Optional[DescriptionString] = None,
    tax_inheritance_disabled: Optional[TaxInheritanceDisabledFlag] = None,
    rule: Optional[InvoiceUnitRule] = None,
    client_token: Optional[BasicStringWithoutSpace] = None,
) -> UpdateInvoiceUnitResponse

You can update the invoice unit configuration at any time, and Amazon Web Services will use the latest configuration at the end of the month.

Parameters:

  • invoice_unit_arn (InvoiceUnitArnString) –

    The ARN to identify an invoice unit. This information can't be modified or deleted.

  • description (Optional[DescriptionString], default: None ) –

    The assigned description for an invoice unit. This information can't be modified or deleted.

  • tax_inheritance_disabled (Optional[TaxInheritanceDisabledFlag], default: None ) –

    Whether the invoice unit based tax inheritance is/ should be enabled or disabled.

  • rule (Optional[InvoiceUnitRule], default: None ) –

    The InvoiceUnitRule object used to update invoice units.

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

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

Raises:

Examples:

UpdateInvoiceUnit with all updatable fields

>>> await client.update_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/12345678', description='Updated IU description', tax_inheritance_disabled=False, rule={'LinkedAccounts': ['111111111111', '222222222222']}, client_token='e362c68e-4e74-48d7-9228-0bc5aa447b42')
UpdateInvoiceUnit with specific fields
>>> await client.update_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/12345678', description='Updated IU description. All other fields remain unchanged', client_token='e362c68e-4e74-48d7-9228-0bc5aa447b43')
Source code in docs_src/capo_invoicing/_services/async_invoicing.py
async def update_invoice_unit(
    self,
    invoice_unit_arn: "capo_invoicing.types.invoice_unit_arn_string.InvoiceUnitArnString",
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
    description: Optional[
        "capo_invoicing.types.description_string.DescriptionString"
    ] = None,
    tax_inheritance_disabled: Optional[
        "capo_invoicing.types.tax_inheritance_disabled_flag.TaxInheritanceDisabledFlag"
    ] = None,
    rule: Optional["capo_invoicing.types.invoice_unit_rule.InvoiceUnitRule"] = None,
    client_token: Optional[
        "capo_invoicing.types.basic_string_without_space.BasicStringWithoutSpace"
    ] = None,
) -> "capo_invoicing.types.update_invoice_unit_response.UpdateInvoiceUnitResponse":
    """<p>You can update the invoice unit configuration at any time, and Amazon Web Services will use the latest configuration at the end of the month.</p>

    Args:
        invoice_unit_arn: <p>The ARN to identify an invoice unit. This information can't be modified or deleted. </p>
        description: <p>The assigned description for an invoice unit. This information can't be modified or deleted. </p>
        tax_inheritance_disabled: <p>Whether the invoice unit based tax inheritance is/ should be enabled or disabled. </p>
        rule: <p>The <code>InvoiceUnitRule</code> object used to update invoice units. </p>
        client_token: <p> A unique, case-sensitive identifier that you provide to ensure idempotency of the request. </p>

    Raises:
        capo_invoicing.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
        capo_invoicing.errors.internal_server_exception.InternalServerException: <p>The processing request failed because of an unknown error, exception, or failure. </p>
        capo_invoicing.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found. </p>
        capo_invoicing.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_invoicing.errors.validation_exception.ValidationException: <p> The input fails to satisfy the constraints specified by an Amazon Web Services service. </p>
        capo_invoicing.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        UpdateInvoiceUnit with all updatable fields

        >>> await client.update_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/12345678', description='Updated IU description', tax_inheritance_disabled=False, rule={'LinkedAccounts': ['111111111111', '222222222222']}, client_token='e362c68e-4e74-48d7-9228-0bc5aa447b42')
        UpdateInvoiceUnit with specific fields

        >>> await client.update_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/12345678', description='Updated IU description. All other fields remain unchanged', client_token='e362c68e-4e74-48d7-9228-0bc5aa447b43')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_invoicing.types.update_invoice_unit_request.UpdateInvoiceUnitRequest]",
    ) -> AsyncOperationResponse[
        "capo_invoicing.types.update_invoice_unit_response.UpdateInvoiceUnitResponse"
    ]:
        import capo_invoicing._operations.invoicing.update_invoice_unit

        (
            output,
            http_response,
        ) = await capo_invoicing._operations.invoicing.update_invoice_unit.async_update_invoice_unit(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateInvoiceUnit")
    )
    input_: capo_invoicing.types.update_invoice_unit_request.UpdateInvoiceUnitRequest = {
        "invoice_unit_arn": invoice_unit_arn
    }
    if description is not None:
        input_["description"] = description
    if tax_inheritance_disabled is not None:
        input_["tax_inheritance_disabled"] = tax_inheritance_disabled
    if rule is not None:
        input_["rule"] = rule
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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