authsomeListUserRoles method
List user roles GET /v1/users/{userId}/roles
Implementation
Future<UserRoleListResponse> authsomeListUserRoles({required String userId, required String token, String? appId}) async {
final path = '/v1/users/$userId/roles';
final queryParams = <String, String>{};
if (appId != null) queryParams['app_id'] = appId.toString();
final queryString = queryParams.isNotEmpty
? '?${queryParams.entries.map((e) => '${e.key}=${Uri.encodeComponent(e.value)}').join('&')}'
: '';
final res = await _request(
'GET',
'$path$queryString',
token: token,
);
return UserRoleListResponse.fromJson(Map<String, dynamic>.from(res as Map));
}