updateThreadReadForUser method
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 updatetimestamp
- The timestamp to which the thread's "last read" state will be reset.cancelToken
- ACancelToken
that can be used to cancel the operationheaders
- Can be used to add additional headers to the requestextras
- Can be used to add flags to the requestvalidateStatus
- AValidateStatus
callback that can be used to determine request success based on the HTTP status of the responseonSendProgress
- AProgressCallback
that can be used to get the send progressonReceiveProgress
- AProgressCallback
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;
}