Skip to content

delete_workflow_type async

delete_workflow_type(
    domain: DomainName,
    workflow_type: WorkflowType,
    *,
    config_overrides: Optional[AsyncSWFClientConfig] = None,
) -> None

Deletes the specified workflow type.

Note: Prior to deletion, workflow types must first be deprecated.

After a workflow type has been deleted, you cannot create new executions of that type. Executions that started before the type was deleted will continue to run.

Access Control

You can use IAM policies to control this action's access to Amazon SWF resources as follows:

  • Use a Resource element with the domain name to limit the action to only specified domains.

  • Use an Action element to allow or deny permission to call this action.

  • Constrain the following parameters by using a Condition element with the appropriate keys.

    • workflowType.name: String constraint. The key is swf:workflowType.name.

    • workflowType.version: String constraint. The key is swf:workflowType.version.

If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.

Parameters:

  • domain (DomainName) –

    The name of the domain in which the workflow type is registered.

  • workflow_type (WorkflowType) –

    The workflow type to delete.

Raises:

  • OperationNotPermittedFault –

    Returned when the caller doesn't have sufficient permissions to invoke the action.

  • TypeNotDeprecatedFault –

    Returned when the resource type has not been deprecated.

  • UnknownResourceFault –

    Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.

  • UnknownServiceError –

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

Source code in docs_src/capo_swf/_services/async_swf.py
async def delete_workflow_type(
    self,
    domain: "capo_swf.types.domain_name.DomainName",
    workflow_type: "capo_swf.types.workflow_type.WorkflowType",
    *,
    config_overrides: Optional[AsyncSWFClientConfig] = None,
) -> None:
    """<p>Deletes the specified <i>workflow type</i>.</p> <p>Note: Prior to deletion, workflow types must first be <b>deprecated</b>.</p> <p> After a workflow type has been deleted, you cannot create new executions of that type. Executions that started before the type was deleted will continue to run. </p> <p> <b>Access Control</b> </p> <p>You can use IAM policies to control this action's access to Amazon SWF resources as follows:</p> <ul> <li> <p>Use a <code>Resource</code> element with the domain name to limit the action to only specified domains.</p> </li> <li> <p>Use an <code>Action</code> element to allow or deny permission to call this action.</p> </li> <li> <p>Constrain the following parameters by using a <code>Condition</code> element with the appropriate keys.</p> <ul> <li> <p> <code>workflowType.name</code>: String constraint. The key is <code>swf:workflowType.name</code>.</p> </li> <li> <p> <code>workflowType.version</code>: String constraint. The key is <code>swf:workflowType.version</code>.</p> </li> </ul> </li> </ul> <p>If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's <code>cause</code> parameter is set to <code>OPERATION_NOT_PERMITTED</code>. For details and example IAM policies, see <a href="https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access to Amazon SWF Workflows</a> in the <i>Amazon SWF Developer Guide</i>.</p>

    Args:
        domain: <p>The name of the domain in which the workflow type is registered.</p>
        workflow_type: <p>The workflow type to delete.</p>

    Raises:
        capo_swf.errors.operation_not_permitted_fault.OperationNotPermittedFault: <p>Returned when the caller doesn't have sufficient permissions to invoke the action.</p>
        capo_swf.errors.type_not_deprecated_fault.TypeNotDeprecatedFault: <p>Returned when the resource type has not been deprecated.</p>
        capo_swf.errors.unknown_resource_fault.UnknownResourceFault: <p>Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.</p>
        capo_swf.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_swf.types.delete_workflow_type_input.DeleteWorkflowTypeInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_swf._operations.simple_workflow_service.delete_workflow_type

        (
            output,
            http_response,
        ) = await capo_swf._operations.simple_workflow_service.delete_workflow_type.async_delete_workflow_type(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteWorkflowType")
    )
    input_: capo_swf.types.delete_workflow_type_input.DeleteWorkflowTypeInput = {
        "domain": domain,
        "workflow_type": workflow_type,
    }

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