Skip to content

describe_savings_plans async

describe_savings_plans(
    *,
    config_overrides: Optional[AsyncsavingsplansClientConfig] = None,
    savings_plan_arns: Optional[SavingsPlanArnList] = None,
    savings_plan_ids: Optional[SavingsPlanIdList] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
    states: Optional[SavingsPlanStateList] = None,
    filters: Optional[SavingsPlanFilterList] = None,
) -> DescribeSavingsPlansResponse

Describes the specified Savings Plans.

Parameters:

Raises:

Source code in docs_src/capo_savingsplans/_services/async_savingsplans.py
async def describe_savings_plans(
    self,
    *,
    config_overrides: Optional[AsyncsavingsplansClientConfig] = None,
    savings_plan_arns: Optional[
        "capo_savingsplans.types.savings_plan_arn_list.SavingsPlanArnList"
    ] = None,
    savings_plan_ids: Optional[
        "capo_savingsplans.types.savings_plan_id_list.SavingsPlanIdList"
    ] = None,
    next_token: Optional[
        "capo_savingsplans.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional["capo_savingsplans.types.max_results.MaxResults"] = None,
    states: Optional[
        "capo_savingsplans.types.savings_plan_state_list.SavingsPlanStateList"
    ] = None,
    filters: Optional[
        "capo_savingsplans.types.savings_plan_filter_list.SavingsPlanFilterList"
    ] = None,
) -> "capo_savingsplans.types.describe_savings_plans_response.DescribeSavingsPlansResponse":
    """<p>Describes the specified Savings Plans.</p>

    Args:
        savings_plan_arns: <p>The Amazon Resource Names (ARN) of the Savings Plans.</p>
        savings_plan_ids: <p>The IDs of the Savings Plans.</p>
        next_token: <p>The token for the next page of results.</p>
        max_results: <p>The maximum number of results to return with a single call. To retrieve additional results, make another call with the returned token value.</p>
        states: <p>The current states of the Savings Plans.</p>
        filters: <p>The filters.</p>

    Raises:
        capo_savingsplans.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred.</p>
        capo_savingsplans.errors.validation_exception.ValidationException: <p>One of the input parameters is not valid.</p>
        capo_savingsplans.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_savingsplans.types.describe_savings_plans_request.DescribeSavingsPlansRequest]",
    ) -> AsyncOperationResponse[
        "capo_savingsplans.types.describe_savings_plans_response.DescribeSavingsPlansResponse"
    ]:
        import capo_savingsplans._operations.aws_savings_plan.describe_savings_plans

        (
            output,
            http_response,
        ) = await capo_savingsplans._operations.aws_savings_plan.describe_savings_plans.async_describe_savings_plans(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeSavingsPlans")
    )
    input_: capo_savingsplans.types.describe_savings_plans_request.DescribeSavingsPlansRequest = {}
    if savings_plan_arns is not None:
        input_["savings_plan_arns"] = savings_plan_arns
    if savings_plan_ids is not None:
        input_["savings_plan_ids"] = savings_plan_ids
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if states is not None:
        input_["states"] = states
    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