updateThreadReadForUser method

Future<Response<void>> updateThreadReadForUser({
  1. required String userId,
  2. required String teamId,
  3. required String threadId,
  4. required String timestamp,
  5. CancelToken? cancelToken,
  6. Map<String, dynamic>? headers,
  7. Map<String, dynamic>? extra,
  8. ValidateStatus? validateStatus,
  9. ProgressCallback? onSendProgress,
  10. ProgressCallback? onReceiveProgress,
})

Mark a thread that user is following read state to the timestamp Mark a thread that user is following as read Minimum server version: 5.29 ##### Permissions Must be logged in as the user or have `edit_other_users` permission.

Parameters:

  • userId - The ID of the user. This can also be "me" which will point to the current user.
  • teamId - The ID of the team in which the thread is.
  • threadId - The ID of the thread to update
  • timestamp - The timestamp to which the thread's "last read" state will be reset.
  • cancelToken - A CancelToken that can be used to cancel the operation
  • headers - Can be used to add additional headers to the request
  • extras - Can be used to add flags to the request
  • validateStatus - A ValidateStatus callback that can be used to determine request success based on the HTTP status of the response
  • onSendProgress - A ProgressCallback that can be used to get the send progress
  • onReceiveProgress - A ProgressCallback that can be used to get the receive progress

Returns a Future Throws DioError if API call or serialization fails

Implementation

Future<Response<void>> updateThreadReadForUser({
  required String userId,
  required String teamId,
  required String threadId,
  required String timestamp,
  CancelToken? cancelToken,
  Map<String, dynamic>? headers,
  Map<String, dynamic>? extra,
  ValidateStatus? validateStatus,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) async {
  final _path = r'/users/{user_id}/teams/{team_id}/threads/{thread_id}/read/{timestamp}'.replaceAll('{' r'user_id' '}', userId.toString()).replaceAll('{' r'team_id' '}', teamId.toString()).replaceAll('{' r'thread_id' '}', threadId.toString()).replaceAll('{' r'timestamp' '}', timestamp.toString());
  final _options = Options(
    method: r'PUT',
    headers: <String, dynamic>{
      ...?headers,
    },
    extra: <String, dynamic>{
      'secure': <Map<String, String>>[
        {
          'type': 'http',
          'scheme': 'bearer',
          'name': 'bearerAuth',
        },
      ],
      ...?extra,
    },
    validateStatus: validateStatus,
  );

  final _response = await _dio.request<Object>(
    _path,
    options: _options,
    cancelToken: cancelToken,
    onSendProgress: onSendProgress,
    onReceiveProgress: onReceiveProgress,
  );

  return _response;
}