Skip to content

create_contact_flow_module async

create_contact_flow_module(
    instance_id: InstanceId,
    name: ContactFlowModuleName,
    content: ContactFlowModuleContent,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional[ContactFlowModuleDescription] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
    settings: Optional[FlowModuleSettings] = None,
    external_invocation_configuration: Optional[ExternalInvocationConfiguration] = None,
) -> CreateContactFlowModuleResponse

Creates a flow module for the specified Connect Customer instance.

Parameters:

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def create_contact_flow_module(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    name: "capo_connect.types.contact_flow_module_name.ContactFlowModuleName",
    content: "capo_connect.types.contact_flow_module_content.ContactFlowModuleContent",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional[
        "capo_connect.types.contact_flow_module_description.ContactFlowModuleDescription"
    ] = None,
    tags: Optional["capo_connect.types.tag_map.TagMap"] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
    settings: Optional[
        "capo_connect.types.flow_module_settings.FlowModuleSettings"
    ] = None,
    external_invocation_configuration: Optional[
        "capo_connect.types.external_invocation_configuration.ExternalInvocationConfiguration"
    ] = None,
) -> "capo_connect.types.create_contact_flow_module_response.CreateContactFlowModuleResponse":
    """<p>Creates a flow module for the specified Connect Customer instance. </p>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
        name: <p>The name of the flow module.</p>
        description: <p>The description of the flow module. </p>
        content: <p>The JSON string that represents the content of the flow. For an example, see <a href="https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html">Example flow in Connect Customer Flow language</a>. </p>
        tags: <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
        settings: <p>The configuration settings for the flow module.</p>
        external_invocation_configuration: <p>The external invocation configuration for the flow module.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.duplicate_resource_exception.DuplicateResourceException: <p>A resource with the specified name already exists.</p>
        capo_connect.errors.idempotency_exception.IdempotencyException: <p>An entity with the same name already exists.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_contact_flow_module_exception.InvalidContactFlowModuleException: <p>The problems with the module. Please fix before trying again.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.limit_exceeded_exception.LimitExceededException: <p>The allowed limit for the resource has been exceeded.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connect.types.create_contact_flow_module_request.CreateContactFlowModuleRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.create_contact_flow_module_response.CreateContactFlowModuleResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_contact_flow_module

        (
            output,
            http_response,
        ) = await capo_connect._operations.amazon_connect_service.create_contact_flow_module.async_create_contact_flow_module(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateContactFlowModule")
    )
    input_: capo_connect.types.create_contact_flow_module_request.CreateContactFlowModuleRequest = {
        "instance_id": instance_id,
        "name": name,
        "content": content,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if settings is not None:
        input_["settings"] = settings
    if external_invocation_configuration is not None:
        input_["external_invocation_configuration"] = (
            external_invocation_configuration
        )

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