Skip to content

list_pricing_plans async

list_pricing_plans(
    *,
    config_overrides: Optional[AsyncbillingconductorClientConfig] = None,
    billing_period: Optional[BillingPeriod] = None,
    filters: Optional[ListPricingPlansFilter] = None,
    max_results: Optional[MaxPricingPlanResults] = None,
    next_token: Optional[Token] = None,
) -> ListPricingPlansOutput

A paginated call to get pricing plans for the given billing period. If you don't provide a billing period, the current billing period is used.

Parameters:

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

    The preferred billing period to get pricing plan.

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

    A ListPricingPlansFilter that specifies the Amazon Resource Name (ARNs) of pricing plans to retrieve pricing plans information.

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

    The maximum number of pricing plans to retrieve.

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

    The pagination token that's used on subsequent call to get pricing plans.

Raises:

Source code in docs_src/capo_billingconductor/_services/async_billingconductor.py
async def list_pricing_plans(
    self,
    *,
    config_overrides: Optional[AsyncbillingconductorClientConfig] = None,
    billing_period: Optional[
        "capo_billingconductor.types.billing_period.BillingPeriod"
    ] = None,
    filters: Optional[
        "capo_billingconductor.types.list_pricing_plans_filter.ListPricingPlansFilter"
    ] = None,
    max_results: Optional[
        "capo_billingconductor.types.max_pricing_plan_results.MaxPricingPlanResults"
    ] = None,
    next_token: Optional["capo_billingconductor.types.token.Token"] = None,
) -> "capo_billingconductor.types.list_pricing_plans_output.ListPricingPlansOutput":
    """<p>A paginated call to get pricing plans for the given billing period. If you don't provide a billing period, the current billing period is used. </p>

    Args:
        billing_period: <p>The preferred billing period to get pricing plan. </p>
        filters: <p>A <code>ListPricingPlansFilter</code> that specifies the Amazon Resource Name (ARNs) of pricing plans to retrieve pricing plans information.</p>
        max_results: <p>The maximum number of pricing plans to retrieve.</p>
        next_token: <p>The pagination token that's used on subsequent call to get pricing plans. </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.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_pricing_plans_input.ListPricingPlansInput]",
    ) -> AsyncOperationResponse[
        "capo_billingconductor.types.list_pricing_plans_output.ListPricingPlansOutput"
    ]:
        import capo_billingconductor._operations.aws_billing_conductor.list_pricing_plans

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

    def _redact_output(
        output: "capo_billingconductor.types.list_pricing_plans_output.ListPricingPlansOutput",
    ) -> dict[str, Any]:
        import capo_billingconductor.types.list_pricing_plans_output

        return (
            capo_billingconductor.types.list_pricing_plans_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListPricingPlans", redact_output=_redact_output),
    )
    input_: capo_billingconductor.types.list_pricing_plans_input.ListPricingPlansInput = {}
    if billing_period is not None:
        input_["billing_period"] = billing_period
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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