Skip to content

list_contractual_investments

list_contractual_investments(
    contract_arn: ArnString,
    investment_summary_id: IdentifierString,
    *,
    config_overrides: Optional[BillingClientConfig] = None,
    next_token: Optional[PageToken] = None,
    max_results: Optional[int] = None,
) -> ListContractualInvestmentsResponse

Lists the investments within a specific investment summary. This operation is read-only and paginated.

Parameters:

  • contract_arn (ArnString) –

    The Amazon Resource Name (ARN) of the contract that contains the investment summary.

  • investment_summary_id (IdentifierString) –

    The identifier of the investment summary whose investments you want to list.

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

    The pagination token that indicates the next set of results to retrieve.

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

    The maximum number of investments to return in a single call. Minimum value of 1, maximum value of 100.

Raises:

Examples:

Invoke ListContractualInvestments

>>> client.list_contractual_investments(contract_arn='arn:aws:billing::123456789012:contract/1a2b3c4d-5e6f-7a8b-9c0d-111122223333', investment_summary_id='Example-Investment-Summary-Id', max_results=100)
Source code in docs_src/capo_billing/_services/billing.py
def list_contractual_investments(
    self,
    contract_arn: "capo_billing.types.arn_string.ArnString",
    investment_summary_id: "capo_billing.types.identifier_string.IdentifierString",
    *,
    config_overrides: Optional[BillingClientConfig] = None,
    next_token: Optional["capo_billing.types.page_token.PageToken"] = None,
    max_results: Optional[int] = None,
) -> "capo_billing.types.list_contractual_investments_response.ListContractualInvestmentsResponse":
    """<p>Lists the investments within a specific investment summary. This operation is read-only and paginated.</p>

    Args:
        contract_arn: <p>The Amazon Resource Name (ARN) of the contract that contains the investment summary.</p>
        investment_summary_id: <p>The identifier of the investment summary whose investments you want to list.</p>
        next_token: <p>The pagination token that indicates the next set of results to retrieve.</p>
        max_results: <p>The maximum number of investments to return in a single call. Minimum value of 1, maximum value of 100.</p>

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

    Examples:
        Invoke ListContractualInvestments

        >>> client.list_contractual_investments(contract_arn='arn:aws:billing::123456789012:contract/1a2b3c4d-5e6f-7a8b-9c0d-111122223333', investment_summary_id='Example-Investment-Summary-Id', max_results=100)
    """

    def _handler(
        req: "OperationRequest[capo_billing.types.list_contractual_investments_request.ListContractualInvestmentsRequest]",
    ) -> OperationResponse[
        "capo_billing.types.list_contractual_investments_response.ListContractualInvestmentsResponse"
    ]:
        import capo_billing._operations.aws_billing.list_contractual_investments

        output, http_response = (
            capo_billing._operations.aws_billing.list_contractual_investments.list_contractual_investments(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListContractualInvestments")
    )
    input_: capo_billing.types.list_contractual_investments_request.ListContractualInvestmentsRequest = {
        "contract_arn": contract_arn,
        "investment_summary_id": investment_summary_id,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output