listOAuthClients method
GET /accounts/projects/{project_id}/oauth/clients Returns a list of OAuthClient (no secrets).
Implementation
Future<List<OAuthClient>> listOAuthClients(String projectId) async {
final uri = Uri.parse('$baseUrl/accounts/projects/$projectId/oauth/clients');
final response = await http.get(uri, headers: _getHeaders());
if (response.statusCode >= 400) {
throw MeshagentException(
'Failed to list OAuth clients. '
'Status code: ${response.statusCode}, body: ${response.body}',
);
}
final decoded = jsonDecode(response.body) as Map<String, dynamic>;
final list = decoded['clients'] as List<dynamic>? ?? const [];
return list.whereType<Map<String, dynamic>>().map(OAuthClient.fromJson).toList();
}