Skip to content

delete_what_if_forecast async

delete_what_if_forecast(
    what_if_forecast_arn: LongArn,
    *,
    config_overrides: Optional[AsyncforecastClientConfig] = None,
) -> None

Deletes a what-if forecast created using the CreateWhatIfForecast operation. You can delete only what-if forecasts that have a status of ACTIVE or CREATE_FAILED. To get the status, use the DescribeWhatIfForecast operation.

You can't delete a what-if forecast while it is being exported. After a what-if forecast is deleted, you can no longer query the what-if analysis.

Parameters:

  • what_if_forecast_arn (LongArn) –

    The Amazon Resource Name (ARN) of the what-if forecast that you want to delete.

Raises:

Source code in docs_src/capo_forecast/_services/async_forecast.py
async def delete_what_if_forecast(
    self,
    what_if_forecast_arn: "capo_forecast.types.long_arn.LongArn",
    *,
    config_overrides: Optional[AsyncforecastClientConfig] = None,
) -> None:
    """<p>Deletes a what-if forecast created using the <a>CreateWhatIfForecast</a> operation. You can delete only what-if forecasts that have a status of <code>ACTIVE</code> or <code>CREATE_FAILED</code>. To get the status, use the <a>DescribeWhatIfForecast</a> operation. </p> <p>You can't delete a what-if forecast while it is being exported. After a what-if forecast is deleted, you can no longer query the what-if analysis.</p>

    Args:
        what_if_forecast_arn: <p>The Amazon Resource Name (ARN) of the what-if forecast that you want to delete.</p>

    Raises:
        capo_forecast.errors.invalid_input_exception.InvalidInputException: <p>We can't process the request because it includes an invalid value or a value that exceeds the valid range.</p>
        capo_forecast.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is in use.</p>
        capo_forecast.errors.resource_not_found_exception.ResourceNotFoundException: <p>We can't find a resource with that Amazon Resource Name (ARN). Check the ARN and try again.</p>
        capo_forecast.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_forecast.types.delete_what_if_forecast_request.DeleteWhatIfForecastRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_forecast._operations.amazon_forecast.delete_what_if_forecast

        (
            output,
            http_response,
        ) = await capo_forecast._operations.amazon_forecast.delete_what_if_forecast.async_delete_what_if_forecast(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteWhatIfForecast")
    )
    input_: capo_forecast.types.delete_what_if_forecast_request.DeleteWhatIfForecastRequest = {
        "what_if_forecast_arn": what_if_forecast_arn
    }

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