Skip to content

create_push_notification_registration async

create_push_notification_registration(
    instance_id: InstanceId,
    pinpoint_app_arn: ARN,
    device_token: DeviceToken,
    device_type: DeviceType,
    contact_configuration: ContactConfiguration,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> CreatePushNotificationRegistrationResponse

Creates registration for a device token and a chat contact to receive real-time push notifications. For more information about push notifications, see Set up push notifications in Connect Customer for mobile chat in the Connect Customer Administrator Guide.

Parameters:

  • instance_id (InstanceId) –

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

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

  • pinpoint_app_arn (ARN) –

    The Amazon Resource Name (ARN) of the Pinpoint application.

  • device_token (DeviceToken) –

    The push notification token issued by the Apple or Google gateways.

  • device_type (DeviceType) –

    The device type to use when sending the message.

  • contact_configuration (ContactConfiguration) –

    The contact configuration for push notification registration.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def create_push_notification_registration(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    pinpoint_app_arn: "capo_connect.types.arn.ARN",
    device_token: "capo_connect.types.device_token.DeviceToken",
    device_type: "capo_connect.types.device_type.DeviceType",
    contact_configuration: "capo_connect.types.contact_configuration.ContactConfiguration",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
) -> "capo_connect.types.create_push_notification_registration_response.CreatePushNotificationRegistrationResponse":
    """<p>Creates registration for a device token and a chat contact to receive real-time push notifications. For more information about push notifications, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-push-notifications-for-mobile-chat.html">Set up push notifications in Connect Customer for mobile chat</a> in the <i>Connect Customer Administrator Guide</i>.</p>

    Args:
        instance_id: <p>The identifier of the Amazon Connect 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>
        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>
        pinpoint_app_arn: <p>The Amazon Resource Name (ARN) of the Pinpoint application.</p>
        device_token: <p>The push notification token issued by the Apple or Google gateways.</p>
        device_type: <p>The device type to use when sending the message.</p>
        contact_configuration: <p>The contact configuration for push notification registration.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</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.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_push_notification_registration_request.CreatePushNotificationRegistrationRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.create_push_notification_registration_response.CreatePushNotificationRegistrationResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_push_notification_registration

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePushNotificationRegistration")
    )
    input_: capo_connect.types.create_push_notification_registration_request.CreatePushNotificationRegistrationRequest = {
        "instance_id": instance_id,
        "pinpoint_app_arn": pinpoint_app_arn,
        "device_token": device_token,
        "device_type": device_type,
        "contact_configuration": contact_configuration,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    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