// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'in_app_receipt_ios.dart';

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

ReceiptData _$ReceiptDataFromJson(Map<String, dynamic> json) => ReceiptData(
      environment: json['environment'] as String?,
      receipt: json['receipt'] == null
          ? null
          : Receipt.fromJson(json['receipt'] as Map<String, dynamic>),
      latestReceiptItems: (json['latest_receipt_info'] as List<dynamic>?)
              ?.map((e) => ReceiptItem.fromJson(e as Map<String, dynamic>))
              .toList() ??
          [],
      pendingRenewalInfoItems: (json['pending_renewal_info'] as List<dynamic>?)
              ?.map(
                  (e) => PendingRenewalInfo.fromJson(e as Map<String, dynamic>))
              .toList() ??
          [],
      latestReceipt: json['latest_receipt'] as String? ?? '',
      status: json['status'] as int,
    );

Map<String, dynamic> _$ReceiptDataToJson(ReceiptData instance) =>
    <String, dynamic>{
      'environment': instance.environment,
      'receipt': instance.receipt,
      'latest_receipt_info': instance.latestReceiptItems,
      'pending_renewal_info': instance.pendingRenewalInfoItems,
      'latest_receipt': instance.latestReceipt,
      'status': instance.status,
    };

Receipt _$ReceiptFromJson(Map<String, dynamic> json) => Receipt(
      receiptType: json['receipt_type'] as String,
      adamId: json['adam_id'] as int,
      appItemId: json['app_item_id'] as int,
      bundleId: json['bundle_id'] as String,
      applicationVersion: json['application_version'] as String,
      downloadId: json['download_id'] as int,
      versionExternalIdentifier: json['version_external_identifier'] as int,
      receiptCreationDateInMillis:
          intStringConvert.fromJson(json['receipt_creation_date_ms'] as String),
      requestDateInMillis:
          intStringConvert.fromJson(json['request_date_ms'] as String),
      originalPurchaseDateInMillis: intStringConvert
          .fromJson(json['original_purchase_date_ms'] as String),
      originalApplicationVersion:
          json['original_application_version'] as String,
      inAppReceiptItems: (json['in_app'] as List<dynamic>?)
              ?.map((e) => ReceiptItem.fromJson(e as Map<String, dynamic>))
              .toList() ??
          [],
    );

Map<String, dynamic> _$ReceiptToJson(Receipt instance) => <String, dynamic>{
      'receipt_type': instance.receiptType,
      'adam_id': instance.adamId,
      'app_item_id': instance.appItemId,
      'bundle_id': instance.bundleId,
      'application_version': instance.applicationVersion,
      'download_id': instance.downloadId,
      'version_external_identifier': instance.versionExternalIdentifier,
      'receipt_creation_date_ms':
          intStringConvert.toJson(instance.receiptCreationDateInMillis),
      'request_date_ms': intStringConvert.toJson(instance.requestDateInMillis),
      'original_purchase_date_ms':
          intStringConvert.toJson(instance.originalPurchaseDateInMillis),
      'original_application_version': instance.originalApplicationVersion,
      'in_app': instance.inAppReceiptItems,
    };

ReceiptItem _$ReceiptItemFromJson(Map<String, dynamic> json) => ReceiptItem(
      productId: json['product_id'] as String,
      quantity: intStringConvert.fromJson(json['quantity'] as String),
      transactionId: json['transaction_id'] as String,
      originalTransactionId: json['original_transaction_id'] as String,
      purchaseDateInMillis:
          intStringConvert.fromJson(json['purchase_date_ms'] as String),
      expiresDateInMillis: _$JsonConverterFromJson<String, int>(
          json['expires_date_ms'], intStringConvert.fromJson),
      originalPurchaseDateInMillis: intStringConvert
          .fromJson(json['original_purchase_date_ms'] as String),
      webOrderLineItemId: json['web_order_line_item_id'] as String?,
      isTrialPeriod:
          boolStringConvert.fromJson(json['is_trial_period'] as String),
      isInIntroOfferPeriod: _$JsonConverterFromJson<String, bool>(
          json['is_in_intro_offer_period'], boolStringConvert.fromJson),
      subscriptionGroupIdentifier:
          json['subscription_group_identifier'] as String?,
      cancellationDate: json['cancellation_date'] as String?,
      expiresDateInString: json['expires_date'] as String?,
    );

Map<String, dynamic> _$ReceiptItemToJson(ReceiptItem instance) =>
    <String, dynamic>{
      'product_id': instance.productId,
      'quantity': intStringConvert.toJson(instance.quantity),
      'transaction_id': instance.transactionId,
      'original_transaction_id': instance.originalTransactionId,
      'purchase_date_ms':
          intStringConvert.toJson(instance.purchaseDateInMillis),
      'expires_date_ms': _$JsonConverterToJson<String, int>(
          instance.expiresDateInMillis, intStringConvert.toJson),
      'expires_date': instance.expiresDateInString,
      'original_purchase_date_ms':
          intStringConvert.toJson(instance.originalPurchaseDateInMillis),
      'web_order_line_item_id': instance.webOrderLineItemId,
      'is_trial_period': boolStringConvert.toJson(instance.isTrialPeriod),
      'is_in_intro_offer_period': _$JsonConverterToJson<String, bool>(
          instance.isInIntroOfferPeriod, boolStringConvert.toJson),
      'subscription_group_identifier': instance.subscriptionGroupIdentifier,
      'cancellation_date': instance.cancellationDate,
    };

Value? _$JsonConverterFromJson<Json, Value>(
  Object? json,
  Value? Function(Json json) fromJson,
) =>
    json == null ? null : fromJson(json as Json);

Json? _$JsonConverterToJson<Json, Value>(
  Value? value,
  Json? Function(Value value) toJson,
) =>
    value == null ? null : toJson(value);

PendingRenewalInfo _$PendingRenewalInfoFromJson(Map<String, dynamic> json) =>
    PendingRenewalInfo(
      autoRenewProductId: json['auto_renew_product_id'] as String,
      originalTransactionId: json['original_transaction_id'] as String,
      productId: json['product_id'] as String,
      autoRenewStatus:
          intStringConvert.fromJson(json['auto_renew_status'] as String),
    );

Map<String, dynamic> _$PendingRenewalInfoToJson(PendingRenewalInfo instance) =>
    <String, dynamic>{
      'auto_renew_product_id': instance.autoRenewProductId,
      'original_transaction_id': instance.originalTransactionId,
      'product_id': instance.productId,
      'auto_renew_status': intStringConvert.toJson(instance.autoRenewStatus),
    };
