Skip to content

delete_cost_category_definition

delete_cost_category_definition(
    cost_category_arn: Arn,
    *,
    config_overrides: Optional[CostExplorerClientConfig] = 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/cost_explorer.py
def delete_cost_category_definition(
    self,
    cost_category_arn: "capo_cost_explorer.types.arn.Arn",
    *,
    config_overrides: Optional[CostExplorerClientConfig] = 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.
    """

    def _handler(
        req: "OperationRequest[capo_cost_explorer.types.delete_cost_category_definition_request.DeleteCostCategoryDefinitionRequest]",
    ) -> OperationResponse[
        "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 = (
            capo_cost_explorer._operations.aws_insights_index_service.delete_cost_category_definition.delete_cost_category_definition(
                req.options, req.input
            )
        )
        return OperationResponse(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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output