Skip to content

delete_invoice_unit async

delete_invoice_unit(
    invoice_unit_arn: InvoiceUnitArnString,
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
    client_token: Optional[BasicStringWithoutSpace] = None,
) -> DeleteInvoiceUnitResponse

This deletes an invoice unit with the provided invoice unit ARN.

Parameters:

  • invoice_unit_arn (InvoiceUnitArnString) –

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

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

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

Raises:

Examples:

DeleteInvoiceUnit

>>> await client.delete_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/12345678', client_token='e362c68e-4e74-48d7-9228-0bc5aa447b44')
Source code in docs_src/capo_invoicing/_services/async_invoicing.py
async def delete_invoice_unit(
    self,
    invoice_unit_arn: "capo_invoicing.types.invoice_unit_arn_string.InvoiceUnitArnString",
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
    client_token: Optional[
        "capo_invoicing.types.basic_string_without_space.BasicStringWithoutSpace"
    ] = None,
) -> "capo_invoicing.types.delete_invoice_unit_response.DeleteInvoiceUnitResponse":
    """<p>This deletes an invoice unit with the provided invoice unit ARN. </p>

    Args:
        invoice_unit_arn: <p> The ARN to identify an invoice unit. This information can't be modified or deleted. </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:
        DeleteInvoiceUnit

        >>> await client.delete_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/12345678', client_token='e362c68e-4e74-48d7-9228-0bc5aa447b44')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_invoicing.types.delete_invoice_unit_request.DeleteInvoiceUnitRequest]",
    ) -> AsyncOperationResponse[
        "capo_invoicing.types.delete_invoice_unit_response.DeleteInvoiceUnitResponse"
    ]:
        import capo_invoicing._operations.invoicing.delete_invoice_unit

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteInvoiceUnit")
    )
    input_: capo_invoicing.types.delete_invoice_unit_request.DeleteInvoiceUnitRequest = {
        "invoice_unit_arn": invoice_unit_arn
    }
    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