Skip to content

register_app_instance_user_endpoint

register_app_instance_user_endpoint(
    app_instance_user_arn: SensitiveChimeArn,
    type: AppInstanceUserEndpointType,
    resource_arn: ChimeArn,
    endpoint_attributes: EndpointAttributes,
    client_request_token: ClientRequestToken,
    *,
    config_overrides: Optional[ChimeSDKIdentityClientConfig] = None,
    name: Optional[SensitiveString1600] = None,
    allow_messages: Optional[AllowMessages] = None,
) -> RegisterAppInstanceUserEndpointResponse

Registers an endpoint under an Amazon Chime AppInstanceUser. The endpoint receives messages for a user. For push notifications, the endpoint is a mobile device used to receive mobile push notifications for a user.

Parameters:

  • app_instance_user_arn (SensitiveChimeArn) –

    The ARN of the AppInstanceUser.

  • name (Optional[SensitiveString1600], default: None ) –

    The name of the AppInstanceUserEndpoint.

  • type (AppInstanceUserEndpointType) –

    The type of the AppInstanceUserEndpoint. Supported types:

    • APNS: The mobile notification service for an Apple device.

    • APNS_SANDBOX: The sandbox environment of the mobile notification service for an Apple device.

    • GCM: The mobile notification service for an Android device.

    Populate the ResourceArn value of each type as PinpointAppArn.

  • resource_arn (ChimeArn) –

    The ARN of the resource to which the endpoint belongs.

  • endpoint_attributes (EndpointAttributes) –

    The attributes of an Endpoint.

  • client_request_token (ClientRequestToken) –

    The unique ID assigned to the request. Use different tokens to register other endpoints.

  • allow_messages (Optional[AllowMessages], default: None ) –

    Boolean that controls whether the AppInstanceUserEndpoint is opted in to receive messages. ALL indicates the endpoint receives all messages. NONE indicates the endpoint receives no messages.

Raises:

Source code in docs_src/capo_chime_sdk_identity/_services/chime_sdk_identity.py
def register_app_instance_user_endpoint(
    self,
    app_instance_user_arn: "capo_chime_sdk_identity.types.sensitive_chime_arn.SensitiveChimeArn",
    type: "capo_chime_sdk_identity.types.app_instance_user_endpoint_type.AppInstanceUserEndpointType",
    resource_arn: "capo_chime_sdk_identity.types.chime_arn.ChimeArn",
    endpoint_attributes: "capo_chime_sdk_identity.types.endpoint_attributes.EndpointAttributes",
    client_request_token: "capo_chime_sdk_identity.types.client_request_token.ClientRequestToken",
    *,
    config_overrides: Optional[ChimeSDKIdentityClientConfig] = None,
    name: Optional[
        "capo_chime_sdk_identity.types.sensitive_string1600.SensitiveString1600"
    ] = None,
    allow_messages: Optional[
        "capo_chime_sdk_identity.types.allow_messages.AllowMessages"
    ] = None,
) -> "capo_chime_sdk_identity.types.register_app_instance_user_endpoint_response.RegisterAppInstanceUserEndpointResponse":
    """<p>Registers an endpoint under an Amazon Chime <code>AppInstanceUser</code>. The endpoint receives messages for a user. For push notifications, the endpoint is a mobile device used to receive mobile push notifications for a user.</p>

    Args:
        app_instance_user_arn: <p>The ARN of the <code>AppInstanceUser</code>.</p>
        name: <p>The name of the <code>AppInstanceUserEndpoint</code>.</p>
        type: <p>The type of the <code>AppInstanceUserEndpoint</code>. Supported types:</p> <ul> <li> <p> <code>APNS</code>: The mobile notification service for an Apple device.</p> </li> <li> <p> <code>APNS_SANDBOX</code>: The sandbox environment of the mobile notification service for an Apple device.</p> </li> <li> <p> <code>GCM</code>: The mobile notification service for an Android device.</p> </li> </ul> <p>Populate the <code>ResourceArn</code> value of each type as <code>PinpointAppArn</code>.</p>
        resource_arn: <p>The ARN of the resource to which the endpoint belongs.</p>
        endpoint_attributes: <p>The attributes of an <code>Endpoint</code>.</p>
        client_request_token: <p>The unique ID assigned to the request. Use different tokens to register other endpoints.</p>
        allow_messages: <p>Boolean that controls whether the AppInstanceUserEndpoint is opted in to receive messages. <code>ALL</code> indicates the endpoint receives all messages. <code>NONE</code> indicates the endpoint receives no messages.</p>

    Raises:
        capo_chime_sdk_identity.errors.bad_request_exception.BadRequestException: <p>The input parameters don't match the service's restrictions.</p>
        capo_chime_sdk_identity.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource.</p>
        capo_chime_sdk_identity.errors.forbidden_exception.ForbiddenException: <p>The client is permanently forbidden from making the request.</p>
        capo_chime_sdk_identity.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>The request exceeds the resource limit.</p>
        capo_chime_sdk_identity.errors.service_failure_exception.ServiceFailureException: <p>The service encountered an unexpected error.</p>
        capo_chime_sdk_identity.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_chime_sdk_identity.errors.throttled_client_exception.ThrottledClientException: <p>The client exceeded its request rate limit.</p>
        capo_chime_sdk_identity.errors.unauthorized_client_exception.UnauthorizedClientException: <p>The client is not currently authorized to make the request.</p>
        capo_chime_sdk_identity.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_chime_sdk_identity.types.register_app_instance_user_endpoint_request.RegisterAppInstanceUserEndpointRequest]",
    ) -> OperationResponse[
        "capo_chime_sdk_identity.types.register_app_instance_user_endpoint_response.RegisterAppInstanceUserEndpointResponse"
    ]:
        import capo_chime_sdk_identity._operations.chime_identity_service.register_app_instance_user_endpoint

        output, http_response = (
            capo_chime_sdk_identity._operations.chime_identity_service.register_app_instance_user_endpoint.register_app_instance_user_endpoint(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_chime_sdk_identity.types.register_app_instance_user_endpoint_request.RegisterAppInstanceUserEndpointRequest",
    ) -> dict[str, Any]:
        import capo_chime_sdk_identity.types.register_app_instance_user_endpoint_request

        return capo_chime_sdk_identity.types.register_app_instance_user_endpoint_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "RegisterAppInstanceUserEndpoint", redact_input=_redact_input
        ),
    )
    input_: capo_chime_sdk_identity.types.register_app_instance_user_endpoint_request.RegisterAppInstanceUserEndpointRequest = {
        "app_instance_user_arn": app_instance_user_arn,
        "type": type,
        "resource_arn": resource_arn,
        "endpoint_attributes": endpoint_attributes,
        "client_request_token": client_request_token,
    }
    if name is not None:
        input_["name"] = name
    if allow_messages is not None:
        input_["allow_messages"] = allow_messages

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output