Skip to content

create_queue async

create_queue(
    instance_id: InstanceId,
    name: CommonNameLength127,
    hours_of_operation_id: HoursOfOperationId,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional[QueueDescription] = None,
    outbound_caller_config: Optional[OutboundCallerConfig] = None,
    outbound_email_config: Optional[OutboundEmailConfig] = None,
    max_contacts: Optional[QueueMaxContacts] = None,
    quick_connect_ids: Optional[QuickConnectsList] = None,
    email_addresses_config: Optional[EmailAddressConfigList] = None,
    tags: Optional[TagMap] = None,
) -> CreateQueueResponse

Creates a new queue for the specified Connect Customer instance.

  • If the phone number is claimed to a traffic distribution group that was created in the same Region as the Connect Customer instance where you are calling this API, then you can use a full phone number ARN or a UUID for OutboundCallerIdNumberId. However, if the phone number is claimed to a traffic distribution group that is in one Region, and you are calling this API from an instance in another Amazon Web Services Region that is associated with the traffic distribution group, you must provide a full phone number ARN. If a UUID is provided in this scenario, you will receive a ResourceNotFoundException.

  • Only use the phone number ARN format that doesn't contain instance in the path, for example, arn:aws:connect:us-east-1:1234567890:phone-number/uuid. This is the same ARN format that is returned when you call the ListPhoneNumbersV2 API.

  • If you plan to use IAM policies to allow/deny access to this API for phone number resources claimed to a traffic distribution group, see Allow or Deny queue API actions for phone numbers in a replica Region.

Parameters:

  • instance_id (InstanceId) –

    The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • name (CommonNameLength127) –

    The name of the queue.

  • description (Optional[QueueDescription], default: None ) –

    The description of the queue.

  • outbound_caller_config (Optional[OutboundCallerConfig], default: None ) –

    The outbound caller ID name, number, and outbound whisper flow.

  • outbound_email_config (Optional[OutboundEmailConfig], default: None ) –

    The outbound email address ID for a specified queue.

  • hours_of_operation_id (HoursOfOperationId) –

    The identifier for the hours of operation.

  • max_contacts (Optional[QueueMaxContacts], default: None ) –

    The maximum number of contacts that can be in the queue before it is considered full.

  • quick_connect_ids (Optional[QuickConnectsList], default: None ) –

    The quick connects available to agents who are working the queue.

  • email_addresses_config (Optional[EmailAddressConfigList], default: None ) –

    Configuration list containing the email addresses to associate with the queue during creation. Each configuration specifies an email address ID that agents can select when handling email contacts in this queue.

  • tags (Optional[TagMap], default: None ) –

    The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def create_queue(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    name: "capo_connect.types.common_name_length127.CommonNameLength127",
    hours_of_operation_id: "capo_connect.types.hours_of_operation_id.HoursOfOperationId",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional[
        "capo_connect.types.queue_description.QueueDescription"
    ] = None,
    outbound_caller_config: Optional[
        "capo_connect.types.outbound_caller_config.OutboundCallerConfig"
    ] = None,
    outbound_email_config: Optional[
        "capo_connect.types.outbound_email_config.OutboundEmailConfig"
    ] = None,
    max_contacts: Optional[
        "capo_connect.types.queue_max_contacts.QueueMaxContacts"
    ] = None,
    quick_connect_ids: Optional[
        "capo_connect.types.quick_connects_list.QuickConnectsList"
    ] = None,
    email_addresses_config: Optional[
        "capo_connect.types.email_address_config_list.EmailAddressConfigList"
    ] = None,
    tags: Optional["capo_connect.types.tag_map.TagMap"] = None,
) -> "capo_connect.types.create_queue_response.CreateQueueResponse":
    """<p>Creates a new queue for the specified Connect Customer instance.</p> <important> <ul> <li> <p>If the phone number is claimed to a traffic distribution group that was created in the same Region as the Connect Customer instance where you are calling this API, then you can use a full phone number ARN or a UUID for <code>OutboundCallerIdNumberId</code>. However, if the phone number is claimed to a traffic distribution group that is in one Region, and you are calling this API from an instance in another Amazon Web Services Region that is associated with the traffic distribution group, you must provide a full phone number ARN. If a UUID is provided in this scenario, you will receive a <code>ResourceNotFoundException</code>.</p> </li> <li> <p>Only use the phone number ARN format that doesn't contain <code>instance</code> in the path, for example, <code>arn:aws:connect:us-east-1:1234567890:phone-number/uuid</code>. This is the same ARN format that is returned when you call the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_ListPhoneNumbersV2.html">ListPhoneNumbersV2</a> API.</p> </li> <li> <p>If you plan to use IAM policies to allow/deny access to this API for phone number resources claimed to a traffic distribution group, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/security_iam_resource-level-policy-examples.html#allow-deny-queue-actions-replica-region">Allow or Deny queue API actions for phone numbers in a replica Region</a>.</p> </li> </ul> </important>

    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 queue.</p>
        description: <p>The description of the queue.</p>
        outbound_caller_config: <p>The outbound caller ID name, number, and outbound whisper flow.</p>
        outbound_email_config: <p>The outbound email address ID for a specified queue.</p>
        hours_of_operation_id: <p>The identifier for the hours of operation.</p>
        max_contacts: <p>The maximum number of contacts that can be in the queue before it is considered full.</p>
        quick_connect_ids: <p>The quick connects available to agents who are working the queue.</p>
        email_addresses_config: <p>Configuration list containing the email addresses to associate with the queue during creation. Each configuration specifies an email address ID that agents can select when handling email contacts in this queue.</p>
        tags: <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>

    Raises:
        capo_connect.errors.duplicate_resource_exception.DuplicateResourceException: <p>A resource with the specified 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_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_queue_request.CreateQueueRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.create_queue_response.CreateQueueResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_queue

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateQueue")
    )
    input_: capo_connect.types.create_queue_request.CreateQueueRequest = {
        "instance_id": instance_id,
        "name": name,
        "hours_of_operation_id": hours_of_operation_id,
    }
    if description is not None:
        input_["description"] = description
    if outbound_caller_config is not None:
        input_["outbound_caller_config"] = outbound_caller_config
    if outbound_email_config is not None:
        input_["outbound_email_config"] = outbound_email_config
    if max_contacts is not None:
        input_["max_contacts"] = max_contacts
    if quick_connect_ids is not None:
        input_["quick_connect_ids"] = quick_connect_ids
    if email_addresses_config is not None:
        input_["email_addresses_config"] = email_addresses_config
    if tags is not None:
        input_["tags"] = tags

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