Skip to content

get_invoice_unit async

get_invoice_unit(
    invoice_unit_arn: InvoiceUnitArnString,
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
    as_of: Optional[AsOfTimestamp] = None,
) -> GetInvoiceUnitResponse

This retrieves the invoice unit definition.

Parameters:

  • invoice_unit_arn (InvoiceUnitArnString) –

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

  • as_of (Optional[AsOfTimestamp], default: None ) –

    The state of an invoice unit at a specified time. You can see legacy invoice units that are currently deleted if the AsOf time is set to before it was deleted. If an AsOf is not provided, the default value is the current time.

Raises:

Examples:

GetInvoiceUnit as of current time

>>> await client.get_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/12345678')
GetInvoiceUnit as of specified time
>>> await client.get_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/87654321', as_of=1733097600)
Source code in docs_src/capo_invoicing/_services/async_invoicing.py
async def get_invoice_unit(
    self,
    invoice_unit_arn: "capo_invoicing.types.invoice_unit_arn_string.InvoiceUnitArnString",
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
    as_of: Optional["capo_invoicing.types.as_of_timestamp.AsOfTimestamp"] = None,
) -> "capo_invoicing.types.get_invoice_unit_response.GetInvoiceUnitResponse":
    """<p>This retrieves the invoice unit definition.</p>

    Args:
        invoice_unit_arn: <p> The ARN to identify an invoice unit. This information can't be modified or deleted. </p>
        as_of: <p> The state of an invoice unit at a specified time. You can see legacy invoice units that are currently deleted if the <code>AsOf</code> time is set to before it was deleted. If an <code>AsOf</code> is not provided, the default value is the current time. </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:
        GetInvoiceUnit as of current time

        >>> await client.get_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/12345678')
        GetInvoiceUnit as of specified time

        >>> await client.get_invoice_unit(invoice_unit_arn='arn:aws:invoicing::000000000000:invoice-unit/87654321', as_of=1733097600)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_invoicing.types.get_invoice_unit_request.GetInvoiceUnitRequest]",
    ) -> AsyncOperationResponse[
        "capo_invoicing.types.get_invoice_unit_response.GetInvoiceUnitResponse"
    ]:
        import capo_invoicing._operations.invoicing.get_invoice_unit

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetInvoiceUnit")
    )
    input_: capo_invoicing.types.get_invoice_unit_request.GetInvoiceUnitRequest = {
        "invoice_unit_arn": invoice_unit_arn
    }
    if as_of is not None:
        input_["as_of"] = as_of

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