// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'abtest_model.dart';

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

AndroidCondition _$AndroidConditionFromJson(Map<String, dynamic> json) =>
    AndroidCondition(
      opt: json['opt'] as String?,
      sdkInt: json['sdk'] as int?,
    );

Map<String, dynamic> _$AndroidConditionToJson(AndroidCondition instance) =>
    <String, dynamic>{
      'opt': instance.opt,
      'sdk': instance.sdkInt,
    };

IosCondition _$IosConditionFromJson(Map<String, dynamic> json) => IosCondition(
      opt: json['opt'] as String?,
      version: json['ver'] as int?,
    );

Map<String, dynamic> _$IosConditionToJson(IosCondition instance) =>
    <String, dynamic>{
      'opt': instance.opt,
      'ver': instance.version,
    };

PlatformFilter _$PlatformFilterFromJson(Map<String, dynamic> json) =>
    PlatformFilter(
      androidCondition: json['ac'] == null
          ? null
          : AndroidCondition.fromJson(json['ac'] as Map<String, dynamic>),
      iosCondition: json['ic'] == null
          ? null
          : IosCondition.fromJson(json['ic'] as Map<String, dynamic>),
    );

Map<String, dynamic> _$PlatformFilterToJson(PlatformFilter instance) =>
    <String, dynamic>{
      'ac': instance.androidCondition,
      'ic': instance.iosCondition,
    };

VersionFilter _$VersionFilterFromJson(Map<String, dynamic> json) =>
    VersionFilter._(
      json['opt'] as String,
      json['mmp'] as String,
    );

Map<String, dynamic> _$VersionFilterToJson(VersionFilter instance) =>
    <String, dynamic>{
      'opt': instance.opt,
      'mmp': instance.mmp,
    };

CountryFilter _$CountryFilterFromJson(Map<String, dynamic> json) =>
    CountryFilter._(
      (json['included'] as List<dynamic>?)?.map((e) => e as String).toSet() ??
          {},
      (json['excluded'] as List<dynamic>?)?.map((e) => e as String).toSet() ??
          {},
    );

Map<String, dynamic> _$CountryFilterToJson(CountryFilter instance) =>
    <String, dynamic>{
      'included': instance.included.toList(),
      'excluded': instance.excluded.toList(),
    };

NewUserFilter _$NewUserFilterFromJson(Map<String, dynamic> json) =>
    NewUserFilter();

Map<String, dynamic> _$NewUserFilterToJson(NewUserFilter instance) =>
    <String, dynamic>{};

ABTestAudience _$ABTestAudienceFromJson(Map<String, dynamic> json) =>
    ABTestAudience(
      filters: (json['filters'] as List<dynamic>)
          .map((e) => ABTestFilter.fromJson(e as Map<String, dynamic>))
          .toList(),
      variant: json['variant'] as int? ?? 2,
    );

Map<String, dynamic> _$ABTestAudienceToJson(ABTestAudience instance) =>
    <String, dynamic>{
      'filters': instance.filters,
      'variant': instance.variant,
    };

ABTestExperiment _$ABTestExperimentFromJson(Map<String, dynamic> json) =>
    ABTestExperiment(
      name: json['name'] as String,
      startTs: json['start_ts'] as int? ?? 0,
      endTs: json['end_ts'] as int? ?? 0,
      audience:
          ABTestAudience.fromJson(json['audience'] as Map<String, dynamic>),
    );

Map<String, dynamic> _$ABTestExperimentToJson(ABTestExperiment instance) =>
    <String, dynamic>{
      'name': instance.name,
      'start_ts': instance.startTs,
      'end_ts': instance.endTs,
      'audience': instance.audience,
    };
