Skip to content

list_savings_plans_purchase_recommendation_generation

list_savings_plans_purchase_recommendation_generation(
    *,
    config_overrides: Optional[CostExplorerClientConfig] = None,
    generation_status: Optional[GenerationStatus] = None,
    recommendation_ids: Optional[RecommendationIdList] = None,
    page_size: Optional[RecommendationsPageSize] = None,
    next_page_token: Optional[NextPageToken] = None,
) -> ListSavingsPlansPurchaseRecommendationGenerationResponse

Retrieves a list of your historical recommendation generations within the past 30 days.

Parameters:

Raises:

Source code in docs_src/capo_cost_explorer/_services/cost_explorer.py
def list_savings_plans_purchase_recommendation_generation(
    self,
    *,
    config_overrides: Optional[CostExplorerClientConfig] = None,
    generation_status: Optional[
        "capo_cost_explorer.types.generation_status.GenerationStatus"
    ] = None,
    recommendation_ids: Optional[
        "capo_cost_explorer.types.recommendation_id_list.RecommendationIdList"
    ] = None,
    page_size: Optional[
        "capo_cost_explorer.types.recommendations_page_size.RecommendationsPageSize"
    ] = None,
    next_page_token: Optional[
        "capo_cost_explorer.types.next_page_token.NextPageToken"
    ] = None,
) -> "capo_cost_explorer.types.list_savings_plans_purchase_recommendation_generation_response.ListSavingsPlansPurchaseRecommendationGenerationResponse":
    """<p>Retrieves a list of your historical recommendation generations within the past 30 days.</p>

    Args:
        generation_status: <p>The status of the recommendation generation.</p>
        recommendation_ids: <p>The IDs for each specific recommendation.</p>
        page_size: <p>The number of recommendations that you want returned in a single response object.</p>
        next_page_token: <p>The token to retrieve the next set of results.</p>

    Raises:
        capo_cost_explorer.errors.data_unavailable_exception.DataUnavailableException: <p>The requested data is unavailable.</p>
        capo_cost_explorer.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The pagination token is invalid. Try again without a pagination token.</p>
        capo_cost_explorer.errors.limit_exceeded_exception.LimitExceededException: <p>You made too many calls in a short period of time. Try again later.</p>
        capo_cost_explorer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cost_explorer.types.list_savings_plans_purchase_recommendation_generation_request.ListSavingsPlansPurchaseRecommendationGenerationRequest]",
    ) -> OperationResponse[
        "capo_cost_explorer.types.list_savings_plans_purchase_recommendation_generation_response.ListSavingsPlansPurchaseRecommendationGenerationResponse"
    ]:
        import capo_cost_explorer._operations.aws_insights_index_service.list_savings_plans_purchase_recommendation_generation

        output, http_response = (
            capo_cost_explorer._operations.aws_insights_index_service.list_savings_plans_purchase_recommendation_generation.list_savings_plans_purchase_recommendation_generation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListSavingsPlansPurchaseRecommendationGeneration"),
    )
    input_: capo_cost_explorer.types.list_savings_plans_purchase_recommendation_generation_request.ListSavingsPlansPurchaseRecommendationGenerationRequest = {}
    if generation_status is not None:
        input_["generation_status"] = generation_status
    if recommendation_ids is not None:
        input_["recommendation_ids"] = recommendation_ids
    if page_size is not None:
        input_["page_size"] = page_size
    if next_page_token is not None:
        input_["next_page_token"] = next_page_token

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