import 'PackagesCartItemsResponseModel.dart';

/// shopping_cart_items : []
/// billing_address : null
/// shipping_address : null
/// addresses : [{"first_name":null,"last_name":null,"email":"a2zzuhaib@gmil.com","company":null,"country_id":null,"country":null,"state_province_id":null,"city":null,"address1":null,"address2":null,"zip_postal_code":null,"phone_number":"0500409598","fax_number":null,"customer_attributes":null,"created_on_utc":"2021-03-11T09:40:23.8091261Z","province":null,"id":0}]
/// customer_guid : "1367e5c7-be3b-43cc-ad81-ff1fc8d3b130"
/// username : null
/// email : "a2zzuhaib@gmil.com"
/// first_name : null
/// last_name : null
/// language_id : null
/// date_of_birth : null
/// gender : null
/// admin_comment : null
/// is_tax_exempt : false
/// has_shopping_cart_items : false
/// active : true
/// deleted : false
/// is_system_account : false
/// system_name : null
/// last_ip_address : null
/// created_on_utc : "2021-03-11T09:40:23.7535859Z"
/// last_login_date_utc : null
/// last_activity_date_utc : "2021-03-11T09:40:23.7535892Z"
/// registered_in_store_id : 0
/// subscribed_to_newsletter : false
/// role_ids : []
/// id : 76823

class PackagesCustomerResponseModel {
  List<PackagesCartItemsResponseModel>? _shoppingCartItems;
  dynamic _billingAddress;
  dynamic _shippingAddress;
  List<Addresses>? _addresses;
  String? _customerGuid;
  dynamic _username;
  String? _email;
  dynamic _firstName;
  dynamic _lastName;
  dynamic _languageId;
  dynamic _dateOfBirth;
  dynamic _gender;
  dynamic _adminComment;
  bool? _isTaxExempt;
  bool? _hasShoppingCartItems;
  bool? _active;
  bool? _deleted;
  bool? _isSystemAccount;
  dynamic _systemName;
  dynamic _lastIpAddress;
  String? _createdOnUtc;
  dynamic _lastLoginDateUtc;
  String? _lastActivityDateUtc;
  int? _registeredInStoreId;
  bool? _subscribedToNewsletter;
  List<int>? _roleIds;
  int? _id;

  List<dynamic> get shoppingCartItems => _shoppingCartItems!;
  dynamic get billingAddress => _billingAddress;
  dynamic get shippingAddress => _shippingAddress;
  List<Addresses> get addresses => _addresses!;
  String get customerGuid => _customerGuid!;
  dynamic get username => _username;
  String get email => _email!;
  dynamic get firstName => _firstName;
  dynamic get lastName => _lastName;
  dynamic get languageId => _languageId;
  dynamic get dateOfBirth => _dateOfBirth;
  dynamic get gender => _gender;
  dynamic get adminComment => _adminComment;
  bool get isTaxExempt => _isTaxExempt!;
  bool get hasShoppingCartItems => _hasShoppingCartItems!;
  bool get active => _active!;
  bool get deleted => _deleted!;
  bool get isSystemAccount => _isSystemAccount!;
  dynamic get systemName => _systemName;
  dynamic get lastIpAddress => _lastIpAddress;
  String get createdOnUtc => _createdOnUtc!;
  dynamic get lastLoginDateUtc => _lastLoginDateUtc;
  String get lastActivityDateUtc => _lastActivityDateUtc!;
  int get registeredInStoreId => _registeredInStoreId!;
  bool get subscribedToNewsletter => _subscribedToNewsletter!;
  List<dynamic> get roleIds => _roleIds!;
  int get id => _id!;

  PackagesCustomerResponseModel({
      List<PackagesCartItemsResponseModel>? shoppingCartItems, 
      dynamic billingAddress, 
      dynamic shippingAddress, 
      List<Addresses>? addresses, 
      String? customerGuid, 
      dynamic username, 
      String? email, 
      dynamic firstName, 
      dynamic lastName, 
      dynamic languageId, 
      dynamic dateOfBirth, 
      dynamic gender, 
      dynamic adminComment, 
      bool? isTaxExempt, 
      bool? hasShoppingCartItems, 
      bool? active, 
      bool? deleted, 
      bool? isSystemAccount, 
      dynamic systemName, 
      dynamic lastIpAddress, 
      String? createdOnUtc, 
      dynamic lastLoginDateUtc, 
      String? lastActivityDateUtc, 
      int? registeredInStoreId, 
      bool? subscribedToNewsletter, 
      List<int>? roleIds, 
      int? id}){
    _shoppingCartItems = shoppingCartItems;
    _billingAddress = billingAddress;
    _shippingAddress = shippingAddress;
    _addresses = addresses;
    _customerGuid = customerGuid;
    _username = username;
    _email = email;
    _firstName = firstName;
    _lastName = lastName;
    _languageId = languageId;
    _dateOfBirth = dateOfBirth;
    _gender = gender;
    _adminComment = adminComment;
    _isTaxExempt = isTaxExempt;
    _hasShoppingCartItems = hasShoppingCartItems;
    _active = active;
    _deleted = deleted;
    _isSystemAccount = isSystemAccount;
    _systemName = systemName;
    _lastIpAddress = lastIpAddress;
    _createdOnUtc = createdOnUtc;
    _lastLoginDateUtc = lastLoginDateUtc;
    _lastActivityDateUtc = lastActivityDateUtc;
    _registeredInStoreId = registeredInStoreId;
    _subscribedToNewsletter = subscribedToNewsletter;
    _roleIds = roleIds;
    _id = id;
}

  PackagesCustomerResponseModel.fromJson(dynamic json) {
    _billingAddress = json["billing_address"];
    _shippingAddress = json["shipping_address"];
    if (json["addresses"] != null) {
      _addresses = [];
      json["addresses"].forEach((v) {
        _addresses!.add(Addresses.fromJson(v));
      });
    }
    _customerGuid = json["customer_guid"];
    _username = json["username"];
    _email = json["email"];
    _firstName = json["first_name"];
    _lastName = json["last_name"];
    _languageId = json["language_id"];
    _dateOfBirth = json["date_of_birth"];
    _gender = json["gender"];
    _adminComment = json["admin_comment"];
    _isTaxExempt = json["is_tax_exempt"];
    _hasShoppingCartItems = json["has_shopping_cart_items"];
    _active = json["active"];
    _deleted = json["deleted"];
    _isSystemAccount = json["is_system_account"];
    _systemName = json["system_name"];
    _lastIpAddress = json["last_ip_address"];
    _createdOnUtc = json["created_on_utc"];
    _lastLoginDateUtc = json["last_login_date_utc"];
    _lastActivityDateUtc = json["last_activity_date_utc"];
    _registeredInStoreId = json["registered_in_store_id"];
    _subscribedToNewsletter = json["subscribed_to_newsletter"];

    if (json["role_ids"] != null) {
      _roleIds = [];
      json["role_ids"].forEach((v) {
        _roleIds!.add(v);
      });
    }

    if (json["shopping_cart_items"] != null) {
      _shoppingCartItems = [];
      json["shopping_cart_items"].forEach((v) {
        _shoppingCartItems!.add(PackagesCartItemsResponseModel.fromJson(v));
      });
    }

    _id = json["id"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    if (_shoppingCartItems != null) {
      map["shopping_cart_items"] = _shoppingCartItems!.map((v) => v.toJson()).toList();
    }
    map["billing_address"] = _billingAddress;
    map["shipping_address"] = _shippingAddress;
    if (_addresses != null) {
      map["addresses"] = _addresses!.map((v) => v.toJson()).toList();
    }
    map["customer_guid"] = _customerGuid;
    map["username"] = _username;
    map["email"] = _email;
    map["first_name"] = _firstName;
    map["last_name"] = _lastName;
    map["language_id"] = _languageId;
    map["date_of_birth"] = _dateOfBirth;
    map["gender"] = _gender;
    map["admin_comment"] = _adminComment;
    map["is_tax_exempt"] = _isTaxExempt;
    map["has_shopping_cart_items"] = _hasShoppingCartItems;
    map["active"] = _active;
    map["deleted"] = _deleted;
    map["is_system_account"] = _isSystemAccount;
    map["system_name"] = _systemName;
    map["last_ip_address"] = _lastIpAddress;
    map["created_on_utc"] = _createdOnUtc;
    map["last_login_date_utc"] = _lastLoginDateUtc;
    map["last_activity_date_utc"] = _lastActivityDateUtc;
    map["registered_in_store_id"] = _registeredInStoreId;
    map["subscribed_to_newsletter"] = _subscribedToNewsletter;
    if (_roleIds != null) {
      map["role_ids"] = _roleIds!.map((v) => v).toList();
    }
    map["id"] = _id;
    return map;
  }

}

/// first_name : null
/// last_name : null
/// email : "a2zzuhaib@gmil.com"
/// company : null
/// country_id : null
/// country : null
/// state_province_id : null
/// city : null
/// address1 : null
/// address2 : null
/// zip_postal_code : null
/// phone_number : "0500409598"
/// fax_number : null
/// customer_attributes : null
/// created_on_utc : "2021-03-11T09:40:23.8091261Z"
/// province : null
/// id : 0

class Addresses {
  dynamic _firstName;
  dynamic _lastName;
  String? _email;
  dynamic _company;
  dynamic _countryId;
  dynamic _country;
  dynamic _stateProvinceId;
  dynamic _city;
  dynamic _address1;
  dynamic _address2;
  dynamic _zipPostalCode;
  String? _phoneNumber;
  dynamic _faxNumber;
  dynamic _customerAttributes;
  String? _createdOnUtc;
  dynamic _province;
  int? _id;

  dynamic get firstName => _firstName;
  dynamic get lastName => _lastName;
  String get email => _email!;
  dynamic get company => _company;
  dynamic get countryId => _countryId;
  dynamic get country => _country;
  dynamic get stateProvinceId => _stateProvinceId;
  dynamic get city => _city;
  dynamic get address1 => _address1;
  dynamic get address2 => _address2;
  dynamic get zipPostalCode => _zipPostalCode;
  String get phoneNumber => _phoneNumber!;
  dynamic get faxNumber => _faxNumber;
  dynamic get customerAttributes => _customerAttributes;
  String get createdOnUtc => _createdOnUtc!;
  dynamic get province => _province;
  int get id => _id!;

  Addresses({
      dynamic firstName, 
      dynamic lastName, 
      String? email, 
      dynamic company, 
      dynamic countryId, 
      dynamic country, 
      dynamic stateProvinceId, 
      dynamic city, 
      dynamic address1, 
      dynamic address2, 
      dynamic zipPostalCode, 
      String? phoneNumber, 
      dynamic faxNumber, 
      dynamic customerAttributes, 
      String? createdOnUtc, 
      dynamic province, 
      int? id}){
    _firstName = firstName;
    _lastName = lastName;
    _email = email;
    _company = company;
    _countryId = countryId;
    _country = country;
    _stateProvinceId = stateProvinceId;
    _city = city;
    _address1 = address1;
    _address2 = address2;
    _zipPostalCode = zipPostalCode;
    _phoneNumber = phoneNumber;
    _faxNumber = faxNumber;
    _customerAttributes = customerAttributes;
    _createdOnUtc = createdOnUtc;
    _province = province;
    _id = id;
}

  Addresses.fromJson(dynamic json) {
    _firstName = json["first_name"];
    _lastName = json["last_name"];
    _email = json["email"];
    _company = json["company"];
    _countryId = json["country_id"];
    _country = json["country"];
    _stateProvinceId = json["state_province_id"];
    _city = json["city"];
    _address1 = json["address1"];
    _address2 = json["address2"];
    _zipPostalCode = json["zip_postal_code"];
    _phoneNumber = json["phone_number"];
    _faxNumber = json["fax_number"];
    _customerAttributes = json["customer_attributes"];
    _createdOnUtc = json["created_on_utc"];
    _province = json["province"];
    _id = json["id"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["first_name"] = _firstName;
    map["last_name"] = _lastName;
    map["email"] = _email;
    map["company"] = _company;
    map["country_id"] = _countryId;
    map["country"] = _country;
    map["state_province_id"] = _stateProvinceId;
    map["city"] = _city;
    map["address1"] = _address1;
    map["address2"] = _address2;
    map["zip_postal_code"] = _zipPostalCode;
    map["phone_number"] = _phoneNumber;
    map["fax_number"] = _faxNumber;
    map["customer_attributes"] = _customerAttributes;
    map["created_on_utc"] = _createdOnUtc;
    map["province"] = _province;
    map["id"] = _id;
    return map;
  }

}