listOAuthClientsPage method
GET /accounts/projects/{project_id}/oauth/clients Returns a list of OAuthClient (no secrets).
Implementation
Future<OAuthClientsPage> listOAuthClientsPage(String projectId, {int count = 100, int offset = 0, String? filter}) async {
final encodedProjectId = Uri.encodeComponent(projectId);
final query = <String, String>{'count': '$count', 'offset': '$offset'};
if (filter != null && filter.trim().isNotEmpty) query['filter'] = filter;
final uri = Uri.parse('$baseUrl/accounts/projects/$encodedProjectId/oauth/clients').replace(queryParameters: query);
final response = await httpClient.get(uri);
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>;
return OAuthClientsPage.fromJson(decoded);
}