Skip to content

describe_cost_category_definition async

describe_cost_category_definition(
    cost_category_arn: Arn,
    *,
    config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
    effective_on: Optional[ZonedDateTime] = None,
) -> DescribeCostCategoryDefinitionResponse

Returns the name, Amazon Resource Name (ARN), rules, definition, and effective dates of a cost category that's defined in the account.

You have the option to use EffectiveOn to return a cost category that's active on a specific date. If there's no EffectiveOn specified, you see a Cost Category that's effective on the current date. If cost category is still effective, EffectiveEnd is omitted in the response.

Parameters:

  • cost_category_arn (Arn) –

    The unique identifier for your cost category.

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

    The date when the cost category was effective.

Raises:

Source code in docs_src/capo_cost_explorer/_services/async_cost_explorer.py
async def describe_cost_category_definition(
    self,
    cost_category_arn: "capo_cost_explorer.types.arn.Arn",
    *,
    config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
    effective_on: Optional[
        "capo_cost_explorer.types.zoned_date_time.ZonedDateTime"
    ] = None,
) -> "capo_cost_explorer.types.describe_cost_category_definition_response.DescribeCostCategoryDefinitionResponse":
    """<p>Returns the name, Amazon Resource Name (ARN), rules, definition, and effective dates of a cost category that's defined in the account.</p> <p>You have the option to use <code>EffectiveOn</code> to return a cost category that's active on a specific date. If there's no <code>EffectiveOn</code> specified, you see a Cost Category that's effective on the current date. If cost category is still effective, <code>EffectiveEnd</code> is omitted in the response. </p>

    Args:
        cost_category_arn: <p>The unique identifier for your cost category. </p>
        effective_on: <p>The date when the cost category was effective. </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.resource_not_found_exception.ResourceNotFoundException: <p> The specified ARN in the request doesn't exist. </p>
        capo_cost_explorer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cost_explorer.types.describe_cost_category_definition_request.DescribeCostCategoryDefinitionRequest]",
    ) -> AsyncOperationResponse[
        "capo_cost_explorer.types.describe_cost_category_definition_response.DescribeCostCategoryDefinitionResponse"
    ]:
        import capo_cost_explorer._operations.aws_insights_index_service.describe_cost_category_definition

        (
            output,
            http_response,
        ) = await capo_cost_explorer._operations.aws_insights_index_service.describe_cost_category_definition.async_describe_cost_category_definition(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeCostCategoryDefinition")
    )
    input_: capo_cost_explorer.types.describe_cost_category_definition_request.DescribeCostCategoryDefinitionRequest = {
        "cost_category_arn": cost_category_arn
    }
    if effective_on is not None:
        input_["effective_on"] = effective_on

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