Skip to content

update_user_notification_status

update_user_notification_status(
    instance_id: InstanceId,
    notification_id: NotificationId,
    user_id: UserId,
    status: NotificationStatus,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    last_modified_time: Optional[Timestamp] = None,
    last_modified_region: Optional[RegionName] = None,
) -> UpdateUserNotificationStatusResponse

Updates the status of a notification for a specific user, such as marking it as read or hidden. Users can only update notification status for notifications that have been sent to them. READ status deprioritizes the notification and greys it out, while HIDDEN status removes it from the notification widget.

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.

  • notification_id (NotificationId) –

    The unique identifier for the notification.

  • user_id (UserId) –

    The identifier of the user whose notification status is being updated.

  • status (NotificationStatus) –

    The new status for the notification. Valid values are READ, UNREAD, and HIDDEN.

  • last_modified_time (Optional[Timestamp], default: None ) –

    The timestamp when the notification status was last modified. Used for cross-region replication and optimistic locking.

  • last_modified_region (Optional[RegionName], default: None ) –

    The AWS Region where the notification status was last modified. Used for cross-region replication.

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def update_user_notification_status(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    notification_id: "capo_connect.types.notification_id.NotificationId",
    user_id: "capo_connect.types.user_id.UserId",
    status: "capo_connect.types.notification_status.NotificationStatus",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    last_modified_time: Optional["capo_connect.types.timestamp.Timestamp"] = None,
    last_modified_region: Optional[
        "capo_connect.types.region_name.RegionName"
    ] = None,
) -> "capo_connect.types.update_user_notification_status_response.UpdateUserNotificationStatusResponse":
    """<p>Updates the status of a notification for a specific user, such as marking it as read or hidden. Users can only update notification status for notifications that have been sent to them. READ status deprioritizes the notification and greys it out, while HIDDEN status removes it from the notification widget.</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>
        notification_id: <p>The unique identifier for the notification.</p>
        user_id: <p>The identifier of the user whose notification status is being updated.</p>
        status: <p>The new status for the notification. Valid values are READ, UNREAD, and HIDDEN.</p>
        last_modified_time: <p>The timestamp when the notification status was last modified. Used for cross-region replication and optimistic locking.</p>
        last_modified_region: <p>The AWS Region where the notification status was last modified. Used for cross-region replication.</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.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</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.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.update_user_notification_status_request.UpdateUserNotificationStatusRequest]",
    ) -> OperationResponse[
        "capo_connect.types.update_user_notification_status_response.UpdateUserNotificationStatusResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.update_user_notification_status

        output, http_response = (
            capo_connect._operations.amazon_connect_service.update_user_notification_status.update_user_notification_status(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateUserNotificationStatus")
    )
    input_: capo_connect.types.update_user_notification_status_request.UpdateUserNotificationStatusRequest = {
        "instance_id": instance_id,
        "notification_id": notification_id,
        "user_id": user_id,
        "status": status,
    }
    if last_modified_time is not None:
        input_["last_modified_time"] = last_modified_time
    if last_modified_region is not None:
        input_["last_modified_region"] = last_modified_region

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