You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/models/customer.dart

150 lines
3.6 KiB
Dart

class Customer {
List<Data> data;
String message;
String innerMessage;
int responseCode;
bool isSuccess;
Customer({this.data, this.message, this.innerMessage, this.responseCode, this.isSuccess});
Customer.fromJson(Map<String, dynamic> json) {
if (json['data'] != null) {
data = [];
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
message = json['message'];
innerMessage = json['innerMessage'];
responseCode = json['responseCode'];
isSuccess = json['isSuccess'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['message'] = this.message;
data['innerMessage'] = this.innerMessage;
data['responseCode'] = this.responseCode;
data['isSuccess'] = this.isSuccess;
return data;
}
}
class Data {
int id;
int customerCode;
String custName;
List<Buildings> buildings;
Data({this.id, this.customerCode, this.custName, this.buildings});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
customerCode = json['customerCode'];
custName = json['custName'];
if (json['buildings'] != null) {
buildings = new List<Buildings>();
json['buildings'].forEach((v) {
buildings.add(new Buildings.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['customerCode'] = this.customerCode;
data['custName'] = this.custName;
if (this.buildings != null) {
data['buildings'] = this.buildings.map((v) => v.toJson()).toList();
}
return data;
}
}
class Buildings {
int id;
String name;
int value;
List<Floors> floors;
Buildings({this.id, this.name, this.value, this.floors});
Buildings.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
value = json['value'];
if (json['floors'] != null) {
floors = new List<Floors>();
json['floors'].forEach((v) {
floors.add(new Floors.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['value'] = this.value;
if (this.floors != null) {
data['floors'] = this.floors.map((v) => v.toJson()).toList();
}
return data;
}
}
class Floors {
int id;
String name;
int value;
List<Departments> departments;
Floors({this.id, this.name, this.value, this.departments});
Floors.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
value = json['value'];
if (json['departments'] != null) {
departments = new List<Departments>();
json['departments'].forEach((v) {
departments.add(new Departments.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['value'] = this.value;
if (this.departments != null) {
data['departments'] = this.departments.map((v) => v.toJson()).toList();
}
return data;
}
}
class Departments {
int id;
String name;
Departments({this.id, this.name});
Departments.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
}