Skip to content

Commit

Permalink
feat: add new method fetchEnrollmentRequests() to AtClientImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
srieteja committed Jan 10, 2024
1 parent 8d02f04 commit 233c040
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/at_client/lib/src/client/at_client_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,20 @@ class AtClientImpl implements AtClient, AtSignChangeListener {
return AtChopsImpl(atChopsKeys);
}

@override
Future<Map<String, dynamic>> fetchEnrollmentRequests(
{String? appName, String? deviceName}) async {
EnrollVerbBuilder enrollBuilder = EnrollVerbBuilder()
..operation = EnrollOperationEnum.list
..appName = appName
..deviceName = deviceName;

var response = await getRemoteSecondary()?.executeCommand(enrollBuilder.buildCommand(), auth: true);
response = response?.replaceFirst('data:', '');
Map<String, dynamic> enrollRequests = jsonDecode(response!);
return enrollRequests;
}

@override
Future<AtStreamResponse> stream(String sharedWith, String filePath,
{String? namespace}) async {
Expand Down
3 changes: 3 additions & 0 deletions packages/at_client/lib/src/client/at_client_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -572,4 +572,7 @@ abstract class AtClient {
String? getCurrentAtSign();

EncryptionService? get encryptionService;

/// Fetches all enrollment requests from the corresponding atServer
Future<Map<String, dynamic>> fetchEnrollmentRequests({String? appName, String? deviceName});
}

0 comments on commit 233c040

Please sign in to comment.