// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'user.model.dart';

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

User _$UserFromJson(Map<String, dynamic> json) {
  return User()
    ..id = json['id'] as int
    ..name = json['name'] as String
    ..surnames = json['surnames'] as String
    ..phone = json['phone'] as String
    ..email = json['email'] as String
    ..nif = json['nif'] as String
    ..date_of_birth = json['date_of_birth'] == null
        ? null
        : DateTime.parse(json['date_of_birth'] as String)
    ..address = json['address'] as String
    ..zipcode = json['zipcode'] as String
    ..poblacio = json['poblacio'] as String
    ..country = json['country'] as String
    ..url_profile_photo = json['url_profile_photo'] as String
    ..weight = (json['weight'] as num)?.toDouble()
    ..height = (json['height'] as num)?.toDouble()
    ..gender = json['gender'] as String
    ..created_at = json['created_at'] == null
        ? null
        : DateTime.parse(json['created_at'] as String)
    ..updated_at = json['updated_at'] == null
        ? null
        : DateTime.parse(json['updated_at'] as String)
    ..stripe_id = json['stripe_id'] as String
    ..card_brand = json['card_brand'] as String
    ..card_last_four = json['card_last_four'] as String
    ..trial_ends_at = json['trial_ends_at'] == null
        ? null
        : DateTime.parse(json['trial_ends_at'] as String)
    ..fiscal_address = json['fiscal_address'] as String
    ..user_subscriptions = (json['user_subscriptions'] as List)
        ?.map((e) => e == null
            ? null
            : UserSubscription.fromJson(e as Map<String, dynamic>))
        ?.toList()
    ..favorite_workouts_ids = (json['favorite_workouts_ids'] as List)
        ?.map((e) => e == null
            ? null
            : e as int)
        ?.toList();
}

Map<String, dynamic> _$UserToJson(User instance) => <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
      'surnames': instance.surnames,
      'phone': instance.phone,
      'email': instance.email,
      'nif': instance.nif,
      'date_of_birth': instance.date_of_birth?.toIso8601String(),
      'address': instance.address,
      'zipcode': instance.zipcode,
      'poblacio': instance.poblacio,
      'country': instance.country,
      'url_profile_photo': instance.url_profile_photo,
      'weight': instance.weight,
      'height': instance.height,
      'gender': instance.gender,
      'created_at': instance.created_at?.toIso8601String(),
      'updated_at': instance.updated_at?.toIso8601String(),
      'stripe_id': instance.stripe_id,
      'card_brand': instance.card_brand,
      'card_last_four': instance.card_last_four,
      'trial_ends_at': instance.trial_ends_at?.toIso8601String(),
      'fiscal_address': instance.fiscal_address,
      'user_subscriptions': instance.user_subscriptions,
      'favorite_workouts_ids': instance.favorite_workouts_ids
    };
