// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'product_model.dart';

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

ProductModel _$ProductModelFromJson(Map<String, dynamic> json) => ProductModel(
  id: (json['id'] as num?)?.toInt(),
  likeId: (json['like_id'] as num?)?.toInt(),
  quantityAvailable: (json['quantity_available'] as num?)?.toInt(),
  content:
      json['content'] == null
          ? null
          : ProductContentModel.fromJson(
            json['content'] as Map<String, dynamic>,
          ),
  price:
      json['price'] == null
          ? null
          : ProductPriceModel.fromJson(json['price'] as Map<String, dynamic>),
  brand:
      json['brand'] == null
          ? null
          : ProductBrandModel.fromJson(json['brand'] as Map<String, dynamic>),
  properties:
      json['voucher_properties'] == null
          ? null
          : ProductPropertiesModel.fromJson(
            json['voucher_properties'] as Map<String, dynamic>,
          ),
  media:
      (json['media'] as List<dynamic>?)
          ?.map((e) => ProductMediaItem.fromJson(e as Map<String, dynamic>))
          .toList(),
  previewCampaign:
      json['preview_campaign'] == null
          ? null
          : ProductPreviewCampaignModel.fromJson(
            json['preview_campaign'] as Map<String, dynamic>,
          ),
  previewFlashSale:
      json['preview_campaign_flash_sale'] == null
          ? null
          : PreviewFlashSale.fromJson(
            json['preview_campaign_flash_sale'] as Map<String, dynamic>,
          ),
  customerInfoModel:
      json['customer_product_info'] == null
          ? null
          : ProductCustomerInfoModel.fromJson(
            json['customer_product_info'] as Map<String, dynamic>,
          ),
  item:
      json['product_item'] == null
          ? null
          : ProductItemModel.fromJson(
            json['product_item'] as Map<String, dynamic>,
          ),
  expireTime: json['expire_time'] as String?,
  requireFormRegis: json['require_form_regis'] as bool?,
  type: json['type'] as String?,
);

Map<String, dynamic> _$ProductModelToJson(ProductModel instance) =>
    <String, dynamic>{
      'id': instance.id,
      'like_id': instance.likeId,
      'quantity_available': instance.quantityAvailable,
      'content': instance.content,
      'price': instance.price,
      'brand': instance.brand,
      'voucher_properties': instance.properties,
      'media': instance.media,
      'preview_campaign': instance.previewCampaign,
      'preview_campaign_flash_sale': instance.previewFlashSale,
      'customer_product_info': instance.customerInfoModel,
      'product_item': instance.item,
      'expire_time': instance.expireTime,
      'require_form_regis': instance.requireFormRegis,
      'type': instance.type,
    };

ProductPreviewCampaignModel _$ProductPreviewCampaignModelFromJson(
  Map<String, dynamic> json,
) => ProductPreviewCampaignModel(
  rewardPoint: (json['reward_point'] as num?)?.toInt(),
  hasGift: json['has_gift'] as bool?,
);

Map<String, dynamic> _$ProductPreviewCampaignModelToJson(
  ProductPreviewCampaignModel instance,
) => <String, dynamic>{
  'reward_point': instance.rewardPoint,
  'has_gift': instance.hasGift,
};
