Skip to content

list_cost_category_definitions

list_cost_category_definitions(
    *,
    config_overrides: Optional[CostExplorerClientConfig] = None,
    effective_on: Optional[ZonedDateTime] = None,
    next_token: Optional[NextPageToken] = None,
    max_results: Optional[CostCategoryMaxResults] = None,
    supported_resource_types: Optional[ResourceTypesFilterInput] = None,
) -> ListCostCategoryDefinitionsResponse

Returns the name, Amazon Resource Name (ARN), NumberOfRules and effective dates of all cost categories defined in the account. You have the option to use EffectiveOn and SupportedResourceTypes to return a list of cost categories that were active on a specific date. If there is no EffectiveOn specified, you’ll see cost categories that are effective on the current date. If cost category is still effective, EffectiveEnd is omitted in the response. ListCostCategoryDefinitions supports pagination. The request can have a MaxResults range up to 100.

Parameters:

  • effective_on (Optional[ZonedDateTime], default: None ) –

    The date when the cost category was effective.

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

    The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

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

    The number of entries a paginated response contains.

  • supported_resource_types (Optional[ResourceTypesFilterInput], default: None ) –

    Filter cost category definitions that are supported by given resource types based on the latest version. If the filter is present, the result only includes Cost Categories that supports input resource type. If the filter isn't provided, no filtering is applied. The valid values are billing:rispgroupsharing, billing:billingview, and billing:creditsharing.

Raises:

Source code in docs_src/capo_cost_explorer/_services/cost_explorer.py
def list_cost_category_definitions(
    self,
    *,
    config_overrides: Optional[CostExplorerClientConfig] = None,
    effective_on: Optional[
        "capo_cost_explorer.types.zoned_date_time.ZonedDateTime"
    ] = None,
    next_token: Optional[
        "capo_cost_explorer.types.next_page_token.NextPageToken"
    ] = None,
    max_results: Optional[
        "capo_cost_explorer.types.cost_category_max_results.CostCategoryMaxResults"
    ] = None,
    supported_resource_types: Optional[
        "capo_cost_explorer.types.resource_types_filter_input.ResourceTypesFilterInput"
    ] = None,
) -> "capo_cost_explorer.types.list_cost_category_definitions_response.ListCostCategoryDefinitionsResponse":
    """<p>Returns the name, Amazon Resource Name (ARN), <code>NumberOfRules</code> and effective dates of all cost categories defined in the account. You have the option to use <code>EffectiveOn</code> and <code>SupportedResourceTypes</code> to return a list of cost categories that were active on a specific date. If there is no <code>EffectiveOn</code> specified, you’ll see cost categories that are effective on the current date. If cost category is still effective, <code>EffectiveEnd</code> is omitted in the response. <code>ListCostCategoryDefinitions</code> supports pagination. The request can have a <code>MaxResults</code> range up to 100.</p>

    Args:
        effective_on: <p>The date when the cost category was effective. </p>
        next_token: <p>The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size. </p>
        max_results: <p>The number of entries a paginated response contains. </p>
        supported_resource_types: <p> Filter cost category definitions that are supported by given resource types based on the latest version. If the filter is present, the result only includes Cost Categories that supports input resource type. If the filter isn't provided, no filtering is applied. The valid values are <code>billing:rispgroupsharing</code>, <code>billing:billingview</code>, and <code>billing:creditsharing</code>. </p>

    Raises:
        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_cost_category_definitions_request.ListCostCategoryDefinitionsRequest]",
    ) -> OperationResponse[
        "capo_cost_explorer.types.list_cost_category_definitions_response.ListCostCategoryDefinitionsResponse"
    ]:
        import capo_cost_explorer._operations.aws_insights_index_service.list_cost_category_definitions

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCostCategoryDefinitions")
    )
    input_: capo_cost_explorer.types.list_cost_category_definitions_request.ListCostCategoryDefinitionsRequest = {}
    if effective_on is not None:
        input_["effective_on"] = effective_on
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if supported_resource_types is not None:
        input_["supported_resource_types"] = supported_resource_types

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