Skip to content

delete_what_if_analysis

delete_what_if_analysis(
    what_if_analysis_arn: Arn,
    *,
    config_overrides: Optional[forecastClientConfig] = None,
) -> None

Deletes a what-if analysis created using the CreateWhatIfAnalysis operation. You can delete only what-if analyses that have a status of ACTIVE or CREATE_FAILED. To get the status, use the DescribeWhatIfAnalysis operation.

You can't delete a what-if analysis while any of its forecasts are being exported.

Parameters:

  • what_if_analysis_arn (Arn) –

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

Raises:

Source code in docs_src/capo_forecast/_services/forecast.py
def delete_what_if_analysis(
    self,
    what_if_analysis_arn: "capo_forecast.types.arn.Arn",
    *,
    config_overrides: Optional[forecastClientConfig] = None,
) -> None:
    """<p>Deletes a what-if analysis created using the <a>CreateWhatIfAnalysis</a> operation. You can delete only what-if analyses that have a status of <code>ACTIVE</code> or <code>CREATE_FAILED</code>. To get the status, use the <a>DescribeWhatIfAnalysis</a> operation. </p> <p>You can't delete a what-if analysis while any of its forecasts are being exported.</p>

    Args:
        what_if_analysis_arn: <p>The Amazon Resource Name (ARN) of the what-if analysis 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.
    """

    def _handler(
        req: "OperationRequest[capo_forecast.types.delete_what_if_analysis_request.DeleteWhatIfAnalysisRequest]",
    ) -> OperationResponse[None]:
        import capo_forecast._operations.amazon_forecast.delete_what_if_analysis

        output, http_response = (
            capo_forecast._operations.amazon_forecast.delete_what_if_analysis.delete_what_if_analysis(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteWhatIfAnalysis")
    )
    input_: capo_forecast.types.delete_what_if_analysis_request.DeleteWhatIfAnalysisRequest = {
        "what_if_analysis_arn": what_if_analysis_arn
    }

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