Address Added Successfully
parent
ed56476d81
commit
68e4b92717
@ -0,0 +1,136 @@
|
||||
class AddNewAddressRequestModel {
|
||||
Customer customer;
|
||||
|
||||
AddNewAddressRequestModel({this.customer});
|
||||
|
||||
AddNewAddressRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
customer = json['customer'] != null
|
||||
? new Customer.fromJson(json['customer'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.customer != null) {
|
||||
data['customer'] = this.customer.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Customer {
|
||||
List<Addresses> addresses;
|
||||
int id;
|
||||
String email;
|
||||
List<int> roleIds;
|
||||
|
||||
Customer({this.addresses, this.id, this.email, this.roleIds});
|
||||
|
||||
Customer.fromJson(Map<String, dynamic> json) {
|
||||
if (json['addresses'] != null) {
|
||||
addresses = new List<Addresses>();
|
||||
json['addresses'].forEach((v) {
|
||||
addresses.add(new Addresses.fromJson(v));
|
||||
});
|
||||
}
|
||||
id = json['id'];
|
||||
email = json['email'];
|
||||
roleIds = json['role_ids'].cast<int>();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.addresses != null) {
|
||||
data['addresses'] = this.addresses.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['id'] = this.id;
|
||||
data['email'] = this.email;
|
||||
data['role_ids'] = this.roleIds;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Addresses {
|
||||
int id;
|
||||
String firstName;
|
||||
String lastName;
|
||||
String email;
|
||||
Null company;
|
||||
int countryId;
|
||||
String country;
|
||||
Null stateProvinceId;
|
||||
String city;
|
||||
String address1;
|
||||
String address2;
|
||||
String zipPostalCode;
|
||||
String phoneNumber;
|
||||
Null faxNumber;
|
||||
String customerAttributes;
|
||||
String createdOnUtc;
|
||||
Null province;
|
||||
String latLong;
|
||||
|
||||
Addresses(
|
||||
{this.id,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.email,
|
||||
this.company,
|
||||
this.countryId,
|
||||
this.country,
|
||||
this.stateProvinceId,
|
||||
this.city,
|
||||
this.address1,
|
||||
this.address2,
|
||||
this.zipPostalCode,
|
||||
this.phoneNumber,
|
||||
this.faxNumber,
|
||||
this.customerAttributes,
|
||||
this.createdOnUtc,
|
||||
this.province,
|
||||
this.latLong});
|
||||
|
||||
Addresses.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
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'];
|
||||
latLong = json['lat_long'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['first_name'] = this.firstName;
|
||||
data['last_name'] = this.lastName;
|
||||
data['email'] = this.email;
|
||||
data['company'] = this.company;
|
||||
data['country_id'] = this.countryId;
|
||||
data['country'] = this.country;
|
||||
data['state_province_id'] = this.stateProvinceId;
|
||||
data['city'] = this.city;
|
||||
data['address1'] = this.address1;
|
||||
data['address2'] = this.address2;
|
||||
data['zip_postal_code'] = this.zipPostalCode;
|
||||
data['phone_number'] = this.phoneNumber;
|
||||
data['fax_number'] = this.faxNumber;
|
||||
data['customer_attributes'] = this.customerAttributes;
|
||||
data['created_on_utc'] = this.createdOnUtc;
|
||||
data['province'] = this.province;
|
||||
data['lat_long'] = this.latLong;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue