// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'user_profile_model.dart';

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

_UserProfileModel _$UserProfileModelFromJson(Map<String, dynamic> json) =>
    _UserProfileModel(
      user: User.fromJson(json['user'] as Map<String, dynamic>),
      role: Role.fromJson(json['role'] as Map<String, dynamic>),
      permissions: (json['permissions'] as List<dynamic>)
          .map((e) => Permission.fromJson(e as Map<String, dynamic>))
          .toList(),
    );

Map<String, dynamic> _$UserProfileModelToJson(_UserProfileModel instance) =>
    <String, dynamic>{
      'user': instance.user,
      'role': instance.role,
      'permissions': instance.permissions,
    };

_User _$UserFromJson(Map<String, dynamic> json) => _User(
  id: (json['id'] as num).toInt(),
  username: json['username'] as String,
  password: json['password'] as String,
  firstName: json['first_name'] as String,
  lastName: json['last_name'] as String,
  isActive: json['is_active'] as bool,
  mobile: json['mobile'] as String,
  phone: json['phone'] as String,
  nationalCode: json['national_code'] as String,
  birthdate: DateTime.parse(json['birthdate'] as String),
  nationality: json['nationality'] as String,
  ownership: json['ownership'] as String,
  address: json['address'] as String,
  photo: json['photo'] as String,
  province: (json['province'] as num).toInt(),
  city: (json['city'] as num).toInt(),
  otpStatus: json['otp_status'] as bool,
  cityName: json['city_name'] as String,
  provinceName: json['province_name'] as String,
);

Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
  'id': instance.id,
  'username': instance.username,
  'password': instance.password,
  'first_name': instance.firstName,
  'last_name': instance.lastName,
  'is_active': instance.isActive,
  'mobile': instance.mobile,
  'phone': instance.phone,
  'national_code': instance.nationalCode,
  'birthdate': instance.birthdate.toIso8601String(),
  'nationality': instance.nationality,
  'ownership': instance.ownership,
  'address': instance.address,
  'photo': instance.photo,
  'province': instance.province,
  'city': instance.city,
  'otp_status': instance.otpStatus,
  'city_name': instance.cityName,
  'province_name': instance.provinceName,
};

_Role _$RoleFromJson(Map<String, dynamic> json) => _Role(
  id: (json['id'] as num).toInt(),
  roleName: json['role_name'] as String,
  description: json['description'] as String,
  type: RoleType.fromJson(json['type'] as Map<String, dynamic>),
  permissions: json['permissions'] as List<dynamic>,
);

Map<String, dynamic> _$RoleToJson(_Role instance) => <String, dynamic>{
  'id': instance.id,
  'role_name': instance.roleName,
  'description': instance.description,
  'type': instance.type,
  'permissions': instance.permissions,
};

_RoleType _$RoleTypeFromJson(Map<String, dynamic> json) =>
    _RoleType(key: json['key'] as String?, name: json['name'] as String);

Map<String, dynamic> _$RoleTypeToJson(_RoleType instance) => <String, dynamic>{
  'key': instance.key,
  'name': instance.name,
};

_Permission _$PermissionFromJson(Map<String, dynamic> json) => _Permission(
  pageName: json['page_name'] as String,
  pageAccess: (json['page_access'] as List<dynamic>)
      .map((e) => e as String)
      .toList(),
);

Map<String, dynamic> _$PermissionToJson(_Permission instance) =>
    <String, dynamic>{
      'page_name': instance.pageName,
      'page_access': instance.pageAccess,
    };
