// GENERATED CODE - DO NOT MODIFY BY HAND part of 'models.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** _$OathCredentialImpl _$$OathCredentialImplFromJson(Map json) => _$OathCredentialImpl( json['device_id'] as String, json['id'] as String, const _IssuerConverter().fromJson(json['issuer'] as String?), json['name'] as String, $enumDecode(_$OathTypeEnumMap, json['oath_type']), (json['period'] as num).toInt(), json['touch_required'] as bool, ); Map _$$OathCredentialImplToJson( _$OathCredentialImpl instance) => { 'device_id': instance.deviceId, 'id': instance.id, 'issuer': const _IssuerConverter().toJson(instance.issuer), 'name': instance.name, 'oath_type': _$OathTypeEnumMap[instance.oathType]!, 'period': instance.period, 'touch_required': instance.touchRequired, }; const _$OathTypeEnumMap = { OathType.hotp: 16, OathType.totp: 32, }; _$OathCodeImpl _$$OathCodeImplFromJson(Map json) => _$OathCodeImpl( json['value'] as String, (json['valid_from'] as num).toInt(), (json['valid_to'] as num).toInt(), ); Map _$$OathCodeImplToJson(_$OathCodeImpl instance) => { 'value': instance.value, 'valid_from': instance.validFrom, 'valid_to': instance.validTo, }; _$OathPairImpl _$$OathPairImplFromJson(Map json) => _$OathPairImpl( OathCredential.fromJson(json['credential'] as Map), json['code'] == null ? null : OathCode.fromJson(json['code'] as Map), ); Map _$$OathPairImplToJson(_$OathPairImpl instance) => { 'credential': instance.credential, 'code': instance.code, }; _$OathStateImpl _$$OathStateImplFromJson(Map json) => _$OathStateImpl( json['device_id'] as String, Version.fromJson(json['version'] as List), hasKey: json['has_key'] as bool, remembered: json['remembered'] as bool, locked: json['locked'] as bool, keystore: $enumDecode(_$KeystoreStateEnumMap, json['keystore']), ); Map _$$OathStateImplToJson(_$OathStateImpl instance) => { 'device_id': instance.deviceId, 'version': instance.version, 'has_key': instance.hasKey, 'remembered': instance.remembered, 'locked': instance.locked, 'keystore': _$KeystoreStateEnumMap[instance.keystore]!, }; const _$KeystoreStateEnumMap = { KeystoreState.unknown: 'unknown', KeystoreState.allowed: 'allowed', KeystoreState.failed: 'failed', }; _$CredentialDataImpl _$$CredentialDataImplFromJson(Map json) => _$CredentialDataImpl( issuer: json['issuer'] as String?, name: json['name'] as String, secret: json['secret'] as String, oathType: $enumDecodeNullable(_$OathTypeEnumMap, json['oath_type']) ?? defaultOathType, 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, ); Map _$$CredentialDataImplToJson( _$CredentialDataImpl instance) => { 'issuer': instance.issuer, 'name': instance.name, 'secret': instance.secret, 'oath_type': _$OathTypeEnumMap[instance.oathType]!, 'hash_algorithm': _$HashAlgorithmEnumMap[instance.hashAlgorithm]!, 'digits': instance.digits, 'period': instance.period, 'counter': instance.counter, }; const _$HashAlgorithmEnumMap = { HashAlgorithm.sha1: 1, HashAlgorithm.sha256: 2, HashAlgorithm.sha512: 3, };