Skip to content

delete_cost_category_definition async

delete_cost_category_definition(
    cost_category_arn: Arn,
    *,
    config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
) -> DeleteCostCategoryDefinitionResponse

Deletes a cost category. Expenses from this month going forward will no longer be categorized with this cost category.

Parameters:

  • cost_category_arn (Arn) –

    The unique identifier for your cost category.

Raises:

Source code in docs_src/capo_cost_explorer/_services/async_cost_explorer.py
async def delete_cost_category_definition(
    self,
    cost_category_arn: "capo_cost_explorer.types.arn.Arn",
    *,
    config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
) -> "capo_cost_explorer.types.delete_cost_category_definition_response.DeleteCostCategoryDefinitionResponse":
    """<p>Deletes a cost category. Expenses from this month going forward will no longer be categorized with this cost category.</p>

    Args:
        cost_category_arn: <p>The unique identifier for your cost category. </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.delete_cost_category_definition_request.DeleteCostCategoryDefinitionRequest]",
    ) -> AsyncOperationResponse[
        "capo_cost_explorer.types.delete_cost_category_definition_response.DeleteCostCategoryDefinitionResponse"
    ]:
        import capo_cost_explorer._operations.aws_insights_index_service.delete_cost_category_definition

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteCostCategoryDefinition")
    )
    input_: capo_cost_explorer.types.delete_cost_category_definition_request.DeleteCostCategoryDefinitionRequest = {
        "cost_category_arn": cost_category_arn
    }

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