Skip to content

list_resources_associated_to_custom_line_item async

list_resources_associated_to_custom_line_item(
    arn: CustomLineItemArn,
    *,
    config_overrides: Optional[AsyncbillingconductorClientConfig] = None,
    billing_period: Optional[BillingPeriod] = None,
    max_results: Optional[MaxCustomLineItemResults] = None,
    next_token: Optional[Token] = None,
    filters: Optional[ListResourcesAssociatedToCustomLineItemFilter] = None,
) -> ListResourcesAssociatedToCustomLineItemOutput

List the resources that are associated to a custom line item.

Parameters:

  • billing_period (Optional[BillingPeriod], default: None ) –

    The billing period for which the resource associations will be listed.

  • arn (CustomLineItemArn) –

    The ARN of the custom line item for which the resource associations will be listed.

  • max_results (Optional[MaxCustomLineItemResults], default: None ) –

    (Optional) The maximum number of resource associations to be retrieved.

  • next_token (Optional[Token], default: None ) –

    (Optional) The pagination token that's returned by a previous request.

  • filters (Optional[ListResourcesAssociatedToCustomLineItemFilter], default: None ) –

    (Optional) A ListResourcesAssociatedToCustomLineItemFilter that can specify the types of resources that should be retrieved.

Raises:

Source code in docs_src/capo_billingconductor/_services/async_billingconductor.py
async def list_resources_associated_to_custom_line_item(
    self,
    arn: "capo_billingconductor.types.custom_line_item_arn.CustomLineItemArn",
    *,
    config_overrides: Optional[AsyncbillingconductorClientConfig] = None,
    billing_period: Optional[
        "capo_billingconductor.types.billing_period.BillingPeriod"
    ] = None,
    max_results: Optional[
        "capo_billingconductor.types.max_custom_line_item_results.MaxCustomLineItemResults"
    ] = None,
    next_token: Optional["capo_billingconductor.types.token.Token"] = None,
    filters: Optional[
        "capo_billingconductor.types.list_resources_associated_to_custom_line_item_filter.ListResourcesAssociatedToCustomLineItemFilter"
    ] = None,
) -> "capo_billingconductor.types.list_resources_associated_to_custom_line_item_output.ListResourcesAssociatedToCustomLineItemOutput":
    """<p> List the resources that are associated to a custom line item. </p>

    Args:
        billing_period: <p> The billing period for which the resource associations will be listed. </p>
        arn: <p> The ARN of the custom line item for which the resource associations will be listed. </p>
        max_results: <p> (Optional) The maximum number of resource associations to be retrieved. </p>
        next_token: <p> (Optional) The pagination token that's returned by a previous request. </p>
        filters: <p> (Optional) A <code>ListResourcesAssociatedToCustomLineItemFilter</code> that can specify the types of resources that should be retrieved. </p>

    Raises:
        capo_billingconductor.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. </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.list_resources_associated_to_custom_line_item_input.ListResourcesAssociatedToCustomLineItemInput]",
    ) -> AsyncOperationResponse[
        "capo_billingconductor.types.list_resources_associated_to_custom_line_item_output.ListResourcesAssociatedToCustomLineItemOutput"
    ]:
        import capo_billingconductor._operations.aws_billing_conductor.list_resources_associated_to_custom_line_item

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

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListResourcesAssociatedToCustomLineItem"),
    )
    input_: capo_billingconductor.types.list_resources_associated_to_custom_line_item_input.ListResourcesAssociatedToCustomLineItemInput = {
        "arn": arn
    }
    if billing_period is not None:
        input_["billing_period"] = billing_period
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if filters is not None:
        input_["filters"] = filters

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