getUserThreads method
Get all threads that user is following
Get all threads that user is following Minimum server version: 5.29 ##### Permissions Must be logged in as the user or have edit_other_users
permission.
Parameters:
-
String userId (required): The ID of the user. This can also be "me" which will point to the current user.
-
String teamId (required): The ID of the team in which the thread is.
-
int since: Since filters the threads based on their LastUpdateAt timestamp.
-
bool deleted: Deleted will specify that even deleted threads should be returned (For mobile sync).
-
bool extended: Extended will enrich the response with participant details.
-
int page: Page specifies which part of the results to return, by PageSize.
-
int pageSize: PageSize specifies the size of the returned chunk of results.
-
bool totalsOnly: Setting this to true will only return the total counts.
Implementation
Future<MmUserThreads?> getUserThreads(
String userId,
String teamId, {
int? since,
bool? deleted,
bool? extended,
int? page,
int? pageSize,
bool? totalsOnly,
}) async {
final response = await getUserThreadsWithHttpInfo(
userId,
teamId,
since: since,
deleted: deleted,
extended: extended,
page: page,
pageSize: pageSize,
totalsOnly: totalsOnly,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw MmApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(
await _decodeBodyBytes(response),
'MmUserThreads',
) as MmUserThreads;
}
return null;
}