import 'enums.dart';

part 'myid_config.g.dart';

class MyIdConfig {
  final String clientId;
  final String? passportData;
  final String? dateOfBirth;
  final String? sdkHash;
  final String? externalId;
  final double? threshold;
  final MyIdBuildMode? buildMode;
  final MyIdEntryType? entryType;
  final MyIdResidentType? residency;
  final MyIdLocale? locale;
  final MyIdCameraShape? cameraShape;
  final MyIdResolution? resolution;
  final MyIdImageFormat? imageFormat;
  final MyIdOrganizationDetails? organizationDetails;
  final bool? withPhoto;

  MyIdConfig({
    required this.clientId,
    this.passportData,
    this.dateOfBirth,
    this.sdkHash,
    this.externalId,
    this.threshold,
    this.buildMode,
    this.entryType,
    this.residency,
    this.locale,
    this.cameraShape,
    this.resolution,
    this.imageFormat,
    this.organizationDetails,
    this.withPhoto,
  });

  factory MyIdConfig.fromJson(Map<String, dynamic> json) =>
      _$MyIdConfigFromJson(json);

  Map<String, dynamic> toJson() => _$MyIdConfigToJson(this);
}

class MyIdResult {
  final String? code;
  final double? comparison;
  final String? base64;

  MyIdResult({
    this.code,
    this.comparison,
    this.base64
  });

  factory MyIdResult.fromJson(Map<String, dynamic> json) =>
      _$MyIdResultFromJson(json);
}

class MyIdOrganizationDetails {
  final String? phone;

  const MyIdOrganizationDetails({
    required this.phone
  });

  factory MyIdOrganizationDetails.fromJson(Map<String, dynamic> json) =>
      _$MyIdOrganizationDetailsFromJson(json);

  Map<String, dynamic> toJson() => _$MyIdOrganizationDetailsToJson(this);
}

class MyIdIOSAppearance {
  final String? primaryColor;
  final String? secondaryColor;
  final String? errorColor;
  final String? primaryButtonColor;
  final String? primaryButtonColorDisabled;
  final String? primaryButtonTextColor;
  final String? primaryButtonTextColorDisabled;
  final int? buttonCornerRadius;

  const MyIdIOSAppearance({
    this.primaryColor,
    this.secondaryColor,
    this.errorColor,
    this.primaryButtonColor,
    this.primaryButtonColorDisabled,
    this.primaryButtonTextColor,
    this.primaryButtonTextColorDisabled,
    this.buttonCornerRadius,
  });

  factory MyIdIOSAppearance.fromJson(Map<String, dynamic> json) =>
      _$MyIdIOSAppearanceFromJson(json);

  Map<String, dynamic> toJson() => _$MyIdIOSAppearanceToJson(this);
}
