mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-30 17:57:46 +03:00
56 lines
1.1 KiB
Dart
Executable File
56 lines
1.1 KiB
Dart
Executable File
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
import '../core/models.dart';
|
|
|
|
part 'models.freezed.dart';
|
|
part 'models.g.dart';
|
|
|
|
enum Transport { usb, nfc }
|
|
|
|
enum FormFactor {
|
|
@JsonValue(0)
|
|
unknown,
|
|
@JsonValue(1)
|
|
usbAKeychain,
|
|
@JsonValue(2)
|
|
usbANano,
|
|
@JsonValue(3)
|
|
usbCKeychain,
|
|
@JsonValue(4)
|
|
usbCNano,
|
|
@JsonValue(5)
|
|
usbCLightning,
|
|
@JsonValue(6)
|
|
usbABio,
|
|
@JsonValue(7)
|
|
usbCBio,
|
|
}
|
|
|
|
@freezed
|
|
class DeviceConfig with _$DeviceConfig {
|
|
factory DeviceConfig(
|
|
Map<Transport, int> enabledCapabilities,
|
|
int? autoEjectTimeout,
|
|
int? challengeResponseTimeout,
|
|
int? deviceFlags) = _DeviceConfig;
|
|
|
|
factory DeviceConfig.fromJson(Map<String, dynamic> json) =>
|
|
_$DeviceConfigFromJson(json);
|
|
}
|
|
|
|
@freezed
|
|
class DeviceInfo with _$DeviceInfo {
|
|
factory DeviceInfo(
|
|
DeviceConfig config,
|
|
int? serial,
|
|
Version version,
|
|
FormFactor formFactor,
|
|
Map<Transport, int> supportedCapabilities,
|
|
bool isLocked,
|
|
bool isFips,
|
|
bool isSky) = _DeviceInfo;
|
|
|
|
factory DeviceInfo.fromJson(Map<String, dynamic> json) =>
|
|
_$DeviceInfoFromJson(json);
|
|
}
|