searchDirectMessages method

Future<DMSearchResults?> searchDirectMessages(
  1. String q, {
  2. int? limit,
  3. String? dmId,
  4. String? user,
  5. String? accountId,
})

Search across DM messages.

Parameters:

  • String q (required): Free-form query string.

  • int limit:

  • String dmId: Restrict to one conversation.

  • String user: Restrict to messages from this user id.

  • String accountId:

Implementation

Future<DMSearchResults?> searchDirectMessages(String q, { int? limit, String? dmId, String? user, String? accountId, }) async {
  final response = await searchDirectMessagesWithHttpInfo(q,  limit: limit, dmId: dmId, user: user, accountId: accountId, );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(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), 'DMSearchResults',) as DMSearchResults;

  }
  return null;
}