Skip to content

delete_flow async

delete_flow(
    flow_name: FlowName,
    *,
    config_overrides: Optional[AsyncAppflowClientConfig] = None,
    force_delete: Optional[Boolean] = None,
) -> DeleteFlowResponse

Enables your application to delete an existing flow. Before deleting the flow, Amazon AppFlow validates the request by checking the flow configuration and status. You can delete flows one at a time.

Parameters:

  • flow_name (FlowName) –

    The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only.

  • force_delete (Optional[Boolean], default: None ) –

    Indicates whether Amazon AppFlow should delete the flow, even if it is currently in use.

Raises:

  • ConflictException –

    There was a conflict when processing the request (for example, a flow with the given name already exists within the account. Check for conflicting resource names and try again.

  • InternalServerException –

    An internal service error occurred during the processing of your request. Try again later.

  • ResourceNotFoundException –

    The resource specified in the request (such as the source or destination connector profile) is not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_appflow/_services/async_appflow.py
async def delete_flow(
    self,
    flow_name: "capo_appflow.types.flow_name.FlowName",
    *,
    config_overrides: Optional[AsyncAppflowClientConfig] = None,
    force_delete: Optional["capo_appflow.types.boolean.Boolean"] = None,
) -> "capo_appflow.types.delete_flow_response.DeleteFlowResponse":
    """<p> Enables your application to delete an existing flow. Before deleting the flow, Amazon AppFlow validates the request by checking the flow configuration and status. You can delete flows one at a time. </p>

    Args:
        flow_name: <p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>
        force_delete: <p> Indicates whether Amazon AppFlow should delete the flow, even if it is currently in use. </p>

    Raises:
        capo_appflow.errors.conflict_exception.ConflictException: <p> There was a conflict when processing the request (for example, a flow with the given name already exists within the account. Check for conflicting resource names and try again. </p>
        capo_appflow.errors.internal_server_exception.InternalServerException: <p> An internal service error occurred during the processing of your request. Try again later. </p>
        capo_appflow.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource specified in the request (such as the source or destination connector profile) is not found. </p>
        capo_appflow.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appflow.types.delete_flow_request.DeleteFlowRequest]",
    ) -> AsyncOperationResponse[
        "capo_appflow.types.delete_flow_response.DeleteFlowResponse"
    ]:
        import capo_appflow._operations.sandstone_configuration_service_lambda.delete_flow

        (
            output,
            http_response,
        ) = await capo_appflow._operations.sandstone_configuration_service_lambda.delete_flow.async_delete_flow(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteFlow")
    )
    input_: capo_appflow.types.delete_flow_request.DeleteFlowRequest = {
        "flow_name": flow_name
    }
    if force_delete is not None:
        input_["force_delete"] = force_delete

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