listDirectConversationsEnriched method

Future<Map<String, Object>?> listDirectConversationsEnriched({
  1. String? accountId,
  2. String? xWorkspaceID,
})

Enriched DM conversation list with unread + pin + draft state.

Native fast-path. Returns conversations augmented with the DM-feature state (unread counts, pinned/muted flags, saved drafts) the renderer's DM UI consumes. The shape is provider-specific and treated as opaque.

Parameters:

  • String accountId:

  • String xWorkspaceID: Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Implementation

Future<Map<String, Object>?> listDirectConversationsEnriched({ String? accountId, String? xWorkspaceID, }) async {
  final response = await listDirectConversationsEnrichedWithHttpInfo( accountId: accountId, xWorkspaceID: xWorkspaceID, );
  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 Map<String, Object>.from(await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, Object>'),);

  }
  return null;
}