Skip to content

create_email_address async

create_email_address(
    instance_id: InstanceId,
    email_address: EmailAddress,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional[Description] = None,
    display_name: Optional[EmailAddressDisplayName] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateEmailAddressResponse

Create new email address in the specified Connect Customer instance. For more information about email addresses, see Create email addresses in the Connect Customer Administrator Guide.

Parameters:

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

    The description of the email address.

  • 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.

  • email_address (EmailAddress) –

    The email address, including the domain.

  • display_name (Optional[EmailAddressDisplayName], default: None ) –

    The display name of email address

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

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

  • client_token (Optional[ClientToken], default: None ) –

    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 Making retries safe with idempotent APIs.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def create_email_address(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    email_address: "capo_connect.types.email_address.EmailAddress",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    description: Optional["capo_connect.types.description.Description"] = None,
    display_name: Optional[
        "capo_connect.types.email_address_display_name.EmailAddressDisplayName"
    ] = None,
    tags: Optional["capo_connect.types.tag_map.TagMap"] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
) -> "capo_connect.types.create_email_address_response.CreateEmailAddressResponse":
    """<p>Create new email address in the specified Connect Customer instance. For more information about email addresses, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/create-email-address1.html">Create email addresses</a> in the Connect Customer Administrator Guide.</p>

    Args:
        description: <p>The description of the email address.</p>
        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>
        email_address: <p>The email address, including the domain.</p>
        display_name: <p>The display name of email address</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>

    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_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.resource_conflict_exception.ResourceConflictException: <p>A resource already has that name.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</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_email_address_request.CreateEmailAddressRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.create_email_address_response.CreateEmailAddressResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_email_address

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

    def _redact_input(
        input_: "capo_connect.types.create_email_address_request.CreateEmailAddressRequest",
    ) -> dict[str, Any]:
        import capo_connect.types.create_email_address_request

        return capo_connect.types.create_email_address_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateEmailAddress", redact_input=_redact_input),
    )
    input_: capo_connect.types.create_email_address_request.CreateEmailAddressRequest = {
        "instance_id": instance_id,
        "email_address": email_address,
    }
    if description is not None:
        input_["description"] = description
    if display_name is not None:
        input_["display_name"] = display_name
    if tags is not None:
        input_["tags"] = tags
    if client_token is not None:
        input_["client_token"] = client_token

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