// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'inventory_database.dart';

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

LimitedBalance _$LimitedBalanceFromJson(Map<String, dynamic> json) =>
    LimitedBalance(
      json['a'] as int? ?? 0,
      json['e'] as int? ?? -1,
      recycle: json['r'] as bool? ?? false,
    );

Map<String, dynamic> _$LimitedBalanceToJson(LimitedBalance instance) =>
    <String, dynamic>{
      'a': instance.amount,
      'e': instance.expireAt,
      'r': instance.recycle,
    };

TimeSensitiveData _$TimeSensitiveDataFromJson(Map<String, dynamic> json) =>
    TimeSensitiveData(
      valid: (json['v'] as List<dynamic>?)
              ?.map((e) => LimitedBalance.fromJson(e as Map<String, dynamic>))
              .toList() ??
          [],
      expired: (json['e'] as List<dynamic>?)
              ?.map((e) => LimitedBalance.fromJson(e as Map<String, dynamic>))
              .toList() ??
          [],
    );

Map<String, dynamic> _$TimeSensitiveDataToJson(TimeSensitiveData instance) =>
    <String, dynamic>{
      'v': instance.valid,
      'e': instance.expired,
    };

InventoryDetails _$InventoryDetailsFromJson(Map<String, dynamic> json) =>
    InventoryDetails._(
      (json['a'] as Map<String, dynamic>?)?.map(
            (k, e) =>
                MapEntry($enumDecode(_$TransactionMethodEnumMap, k), e as int),
          ) ??
          {},
      (json['c'] as Map<String, dynamic>?)?.map(
            (k, e) => MapEntry(k, e as int),
          ) ??
          {},
      json['d'] as Map<String, dynamic>,
    );

Map<String, dynamic> _$InventoryDetailsToJson(InventoryDetails instance) =>
    <String, dynamic>{
      'a': instance.acquired
          .map((k, e) => MapEntry(_$TransactionMethodEnumMap[k]!, e)),
      'c': instance.consumed,
      'd': instance.data,
    };

const _$TransactionMethodEnumMap = {
  TransactionMethod.iap: 'iap',
  TransactionMethod.igc: 'igc',
  TransactionMethod.reward: 'reward',
  TransactionMethod.bonus: 'bonus',
  TransactionMethod.igb: 'igb',
  TransactionMethod.free: 'free',
  TransactionMethod.migrate: 'migrate',
  TransactionMethod.unknown: 'unknown',
};

InventoryItem _$InventoryItemFromJson(Map<String, dynamic> json) =>
    InventoryItem._(
      json['sku'] as String,
      json['balance'] as int,
      json['cat'] as String,
      json['attr'] as int,
      inventoryDetailsStringConvert.fromJson(json['details'] as String),
      timeSensitiveDataStringConvert.fromJson(json['tsv'] as String),
      json['create_at'] as int,
      json['update_at'] as int,
    );

Map<String, dynamic> _$InventoryItemToJson(InventoryItem instance) =>
    <String, dynamic>{
      'sku': instance.sku,
      'balance': instance.balance,
      'cat': instance.category,
      'attr': instance.attr,
      'tsv': timeSensitiveDataStringConvert.toJson(instance.timeSensitive),
      'update_at': instance.updateAt,
      'create_at': instance.createAt,
      'details': inventoryDetailsStringConvert.toJson(instance.details),
    };
