toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['id'] = this.id;
  data['date_created'] = this.dateCreated;
  data['date_created_gmt'] = this.dateCreatedGmt;
  data['date_modified'] = this.dateModified;
  data['date_modified_gmt'] = this.dateModifiedGmt;
  data['email'] = this.email;
  if (this.firstName != null) {
    data['first_name'] = this.firstName;
  }
  if (this.lastName != null) {
    data['last_name'] = this.lastName;
  }
  data['role'] = this.role;
  data['username'] = this.username;
  data['password'] = this.password;
  if (this.billing != null) {
    data['billing'] = this.billing!.toJson();
  }
  if (this.shipping != null) {
    data['shipping'] = this.shipping!.toJson();
  }
  data['is_paying_customer'] = this.isPayingCustomer;
  data['avatar_url'] = this.avatarUrl;
  if (this.metaData != null) {
    data['meta_data'] = this.metaData!.map((v) => v.toJson()).toList();
  }
  if (this.links != null) {
    data['_links'] = this.links!.toJson();
  }
  return data;
}