Setting up basic API Structure
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/// Mirror of the backend `EAgentStatus` enum.
|
||||
///
|
||||
/// See the note in `EAgentType.dart` about ordering and [unknown].
|
||||
enum EAgentStatus {
|
||||
offline,
|
||||
idle,
|
||||
working,
|
||||
error,
|
||||
unknown;
|
||||
|
||||
bool get isOnline => this == EAgentStatus.idle || this == EAgentStatus.working;
|
||||
|
||||
String get displayName {
|
||||
switch (this) {
|
||||
case EAgentStatus.offline:
|
||||
return 'Offline';
|
||||
case EAgentStatus.idle:
|
||||
return 'Idle';
|
||||
case EAgentStatus.working:
|
||||
return 'Working';
|
||||
case EAgentStatus.error:
|
||||
return 'Error';
|
||||
case EAgentStatus.unknown:
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user