// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'myid_config.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

MyIdConfig _$MyIdConfigFromJson(Map<String, dynamic> json) {
  return MyIdConfig(
    clientId: json['clientId'] as String,
    clientHash: json['clientHash'] as String,
    clientHashId: json['clientHashId'] as String,
    passportData: json['passportData'] as String,
    dateOfBirth: json['dateOfBirth'] as String,
    minAge: json['minAge'] as Int,
    sdkHash: json['sdkHash'] as String,
    externalId: json['externalId'] as String,
    threshold: json['threshold'] as double,
    buildMode: _$enumDecodeNullable(_$MyIdBuildModeEnumMap, json['buildMode']),
    entryType: _$enumDecodeNullable(_$MyIdEntryTypeEnumMap, json['entryType']),
    residency: _$enumDecodeNullable(_$MyIdResidentTypeEnumMap, json['residency']),
    locale: _$enumDecodeNullable(_$MyIdLocaleEnumMap, json['locale']),
    cameraShape: _$enumDecodeNullable(_$MyIdCameraShapeEnumMap, json['cameraShape']),
    resolution: _$enumDecodeNullable(_$MyIdResolutionEnumMap, json['resolution']),
    imageFormat: _$enumDecodeNullable(_$MyIdImageFormatEnumMap, json['imageFormat']),
    organizationDetails: MyIdOrganizationDetails.fromJson(json['organizationDetails'] as Map<String, dynamic>),
    withPhoto: json['withPhoto'] as bool,
  );
}

Map<String, dynamic> _$MyIdConfigToJson(MyIdConfig instance) {
  final val = <String, dynamic>{};

  void writeNotNull(String key, dynamic value) {
    if (value != null) {
      val[key] = value;
    }
  }

  writeNotNull('clientId', instance.clientId);
  writeNotNull('clientHash', instance.clientHash);
  writeNotNull('clientHashId', instance.clientHashId);
  writeNotNull('passportData', instance.passportData);
  writeNotNull('dateOfBirth', instance.dateOfBirth);
  writeNotNull('minAge', instance.minAge);
  writeNotNull('sdkHash', instance.sdkHash);
  writeNotNull('externalId', instance.externalId);
  writeNotNull('threshold', instance.threshold);
  writeNotNull('buildMode', _$MyIdBuildModeEnumMap[instance.buildMode]);
  writeNotNull('entryType', _$MyIdEntryTypeEnumMap[instance.entryType]);
  writeNotNull('residency', _$MyIdResidentTypeEnumMap[instance.residency]);
  writeNotNull('locale', _$MyIdLocaleEnumMap[instance.locale]);
  writeNotNull('cameraShape', _$MyIdCameraShapeEnumMap[instance.cameraShape]);
  writeNotNull('resolution', _$MyIdResolutionEnumMap[instance.resolution]);
  writeNotNull('imageFormat', _$MyIdImageFormatEnumMap[instance.imageFormat]);
  writeNotNull('organizationDetails', instance.organizationDetails?.toJson());
  writeNotNull('withPhoto', instance.withPhoto);
  return val;
}

MyIdResult _$MyIdResultFromJson(Map<String, dynamic> json) {
  return MyIdResult(
    code: json['code'] as String?,
    comparison: json['comparison'] as String?,
    base64: json['base64'] as String?
  );
}

Map<String, dynamic> _$MyIdOrganizationDetailsToJson(MyIdOrganizationDetails instance) {
  final val = <String, dynamic>{};

  void writeNotNull(String key, dynamic value) {
    if (value != null) {
      val[key] = value;
    }
  }

  writeNotNull('phone', instance.phone);
  return val;
}

MyIdOrganizationDetails _$MyIdOrganizationDetailsFromJson(Map<String, dynamic> json) {
  return MyIdOrganizationDetails(
    phone: json['phone'] as String?,
  );
}

Map<String, dynamic> _$MyIdIOSAppearanceToJson(MyIdIOSAppearance instance) {
  final val = <String, dynamic>{};

  void writeNotNull(String key, dynamic value) {
    if (value != null) {
      val[key] = value;
    }
  }

  writeNotNull('primaryColor', instance.primaryColor);
  writeNotNull('errorColor', instance.errorColor);
  writeNotNull('primaryButtonColor', instance.primaryButtonColor);
  writeNotNull('primaryButtonColorDisabled', instance.primaryButtonColorDisabled);
  writeNotNull('primaryButtonTextColorDisabled', instance.primaryButtonTextColorDisabled);
  writeNotNull('buttonCornerRadius', instance.buttonCornerRadius);
  return val;
}

MyIdIOSAppearance _$MyIdIOSAppearanceFromJson(Map<String, dynamic> json) {
  return MyIdIOSAppearance(
    primaryColor: json['primaryColor'] as String?,
    errorColor: json['errorColor'] as String?,
    primaryButtonColor: json['primaryButtonColor'] as String?,
    primaryButtonColorDisabled: json['primaryButtonColorDisabled'] as String?,
    primaryButtonTextColorDisabled: json['primaryButtonTextColorDisabled'] as String?,
    buttonCornerRadius: json['buttonCornerRadius'] as int?,
  );
}

const _$MyIdBuildModeEnumMap = {
  MyIdBuildMode.PRODUCTION: 'PRODUCTION',
  MyIdBuildMode.DEBUG: 'DEBUG',
};

const _$MyIdEntryTypeEnumMap = {
  MyIdEntryType.AUTH: 'AUTH',
  MyIdEntryType.FACE: 'FACE',
};

const _$MyIdResidentTypeEnumMap = {
  MyIdResidentType.USER_DEFINED: 'USER_DEFINED',
  MyIdResidentType.RESIDENT: 'RESIDENT',
  MyIdResidentType.NON_RESIDENT: 'NON_RESIDENT',
};

const _$MyIdLocaleEnumMap = {
  MyIdLocale.UZBEK: 'UZBEK',
  MyIdLocale.ENGLISH: 'ENGLISH',
  MyIdLocale.RUSSIAN: 'RUSSIAN',
};

const _$MyIdCameraShapeEnumMap = {
  MyIdCameraShape.CIRCLE: 'CIRCLE',
  MyIdCameraShape.ELLIPSE: 'ELLIPSE',
};

const _$MyIdResolutionEnumMap = {
  MyIdResolution.RESOLUTION_480: 'RESOLUTION_480',
  MyIdResolution.RESOLUTION_720: 'RESOLUTION_720',
};

const _$MyIdImageFormatEnumMap = {
  MyIdImageFormat.JPG: 'JPG',
  MyIdImageFormat.PNG: 'PNG',
};

T? _$enumDecodeNullable<T>(
    Map<T, dynamic> enumValues,
    dynamic source, {
      T? unknownValue,
    }) {
  if (source == null) {
    return null;
  }
  return _$enumDecode<T>(enumValues, source, unknownValue: unknownValue);
}

T? _$enumDecode<T>(
    Map<T, dynamic> enumValues,
    dynamic source, {
      T? unknownValue,
    }) {
  if (source == null) {
    throw ArgumentError('A value must be provided. Supported values: '
        '${enumValues.values.join(', ')}');
  }

  final value = enumValues.entries.singleWhere((e) => e.value == source).key;

  if (value == null && unknownValue == null) {
    throw ArgumentError('`$source` is not one of the supported values: '
        '${enumValues.values.join(', ')}');
  }
  return value ?? unknownValue;
}