yubioath-flutter/lib/oath/models.g.dart

124 lines
4.1 KiB
Dart
Raw Normal View History

2021-11-19 17:05:57 +03:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'models.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
2023-11-15 10:56:52 +03:00
_$OathCredentialImpl _$$OathCredentialImplFromJson(Map<String, dynamic> json) =>
_$OathCredentialImpl(
2021-11-19 17:05:57 +03:00
json['device_id'] as String,
json['id'] as String,
2024-01-24 11:36:33 +03:00
const _IssuerConverter().fromJson(json['issuer'] as String?),
2021-11-19 17:05:57 +03:00
json['name'] as String,
$enumDecode(_$OathTypeEnumMap, json['oath_type']),
(json['period'] as num).toInt(),
2021-11-19 17:05:57 +03:00
json['touch_required'] as bool,
);
2023-11-15 10:56:52 +03:00
Map<String, dynamic> _$$OathCredentialImplToJson(
_$OathCredentialImpl instance) =>
2021-11-19 17:05:57 +03:00
<String, dynamic>{
'device_id': instance.deviceId,
'id': instance.id,
2024-01-24 11:36:33 +03:00
'issuer': const _IssuerConverter().toJson(instance.issuer),
2021-11-19 17:05:57 +03:00
'name': instance.name,
2022-07-21 17:38:45 +03:00
'oath_type': _$OathTypeEnumMap[instance.oathType]!,
2021-11-19 17:05:57 +03:00
'period': instance.period,
'touch_required': instance.touchRequired,
};
const _$OathTypeEnumMap = {
OathType.hotp: 16,
OathType.totp: 32,
};
2023-11-15 10:56:52 +03:00
_$OathCodeImpl _$$OathCodeImplFromJson(Map<String, dynamic> json) =>
_$OathCodeImpl(
2021-11-19 17:05:57 +03:00
json['value'] as String,
(json['valid_from'] as num).toInt(),
(json['valid_to'] as num).toInt(),
2021-11-19 17:05:57 +03:00
);
2023-11-15 10:56:52 +03:00
Map<String, dynamic> _$$OathCodeImplToJson(_$OathCodeImpl instance) =>
2021-11-19 17:05:57 +03:00
<String, dynamic>{
'value': instance.value,
'valid_from': instance.validFrom,
'valid_to': instance.validTo,
};
2023-11-15 10:56:52 +03:00
_$OathPairImpl _$$OathPairImplFromJson(Map<String, dynamic> json) =>
_$OathPairImpl(
2022-05-06 15:27:33 +03:00
OathCredential.fromJson(json['credential'] as Map<String, dynamic>),
json['code'] == null
? null
: OathCode.fromJson(json['code'] as Map<String, dynamic>),
);
2023-11-15 10:56:52 +03:00
Map<String, dynamic> _$$OathPairImplToJson(_$OathPairImpl instance) =>
2022-05-06 15:27:33 +03:00
<String, dynamic>{
'credential': instance.credential,
'code': instance.code,
};
2023-11-15 10:56:52 +03:00
_$OathStateImpl _$$OathStateImplFromJson(Map<String, dynamic> json) =>
_$OathStateImpl(
2021-11-19 17:05:57 +03:00
json['device_id'] as String,
Version.fromJson(json['version'] as List<dynamic>),
2022-02-08 14:25:36 +03:00
hasKey: json['has_key'] as bool,
remembered: json['remembered'] as bool,
locked: json['locked'] as bool,
keystore: $enumDecode(_$KeystoreStateEnumMap, json['keystore']),
2021-11-19 17:05:57 +03:00
);
2023-11-15 10:56:52 +03:00
Map<String, dynamic> _$$OathStateImplToJson(_$OathStateImpl instance) =>
2021-11-19 17:05:57 +03:00
<String, dynamic>{
'device_id': instance.deviceId,
'version': instance.version,
2021-11-19 17:05:57 +03:00
'has_key': instance.hasKey,
2022-02-08 14:25:36 +03:00
'remembered': instance.remembered,
2021-11-19 17:05:57 +03:00
'locked': instance.locked,
2022-07-21 17:38:45 +03:00
'keystore': _$KeystoreStateEnumMap[instance.keystore]!,
2021-11-19 17:05:57 +03:00
};
const _$KeystoreStateEnumMap = {
KeystoreState.unknown: 'unknown',
KeystoreState.allowed: 'allowed',
KeystoreState.failed: 'failed',
};
2023-11-15 10:56:52 +03:00
_$CredentialDataImpl _$$CredentialDataImplFromJson(Map<String, dynamic> json) =>
_$CredentialDataImpl(
2021-11-19 17:05:57 +03:00
issuer: json['issuer'] as String?,
name: json['name'] as String,
secret: json['secret'] as String,
oathType: $enumDecodeNullable(_$OathTypeEnumMap, json['oath_type']) ??
defaultOathType,
2021-11-19 17:05:57 +03:00
hashAlgorithm:
$enumDecodeNullable(_$HashAlgorithmEnumMap, json['hash_algorithm']) ??
defaultHashAlgorithm,
digits: (json['digits'] as num?)?.toInt() ?? defaultDigits,
period: (json['period'] as num?)?.toInt() ?? defaultPeriod,
counter: (json['counter'] as num?)?.toInt() ?? defaultCounter,
2021-11-19 17:05:57 +03:00
);
2023-11-15 10:56:52 +03:00
Map<String, dynamic> _$$CredentialDataImplToJson(
_$CredentialDataImpl instance) =>
2021-11-19 17:05:57 +03:00
<String, dynamic>{
'issuer': instance.issuer,
'name': instance.name,
'secret': instance.secret,
2022-07-21 17:38:45 +03:00
'oath_type': _$OathTypeEnumMap[instance.oathType]!,
'hash_algorithm': _$HashAlgorithmEnumMap[instance.hashAlgorithm]!,
2021-11-19 17:05:57 +03:00
'digits': instance.digits,
'period': instance.period,
'counter': instance.counter,
};
const _$HashAlgorithmEnumMap = {
HashAlgorithm.sha1: 1,
HashAlgorithm.sha256: 2,
HashAlgorithm.sha512: 3,
};