|
1 | 1 | class CountriesResponse { |
2 | | - List<Countries>? countries; |
| 2 | + Shop? shop; |
3 | 3 |
|
4 | | - CountriesResponse({this.countries}); |
| 4 | + CountriesResponse({ |
| 5 | + this.shop, |
| 6 | + }); |
5 | 7 |
|
6 | | - CountriesResponse.fromJson(Map<String, dynamic> json) { |
7 | | - if (json['countries'] != null) { |
8 | | - countries = <Countries>[]; |
9 | | - json['countries'].forEach((v) { |
10 | | - countries!.add(new Countries.fromJson(v)); |
11 | | - }); |
12 | | - } |
13 | | - } |
| 8 | + factory CountriesResponse.fromJson(Map<String, dynamic> json) => CountriesResponse( |
| 9 | + shop: json["shop"] == null ? null : Shop.fromJson(json["shop"]), |
| 10 | + ); |
14 | 11 |
|
15 | | - Map<String, dynamic> toJson() { |
16 | | - final Map<String, dynamic> data = new Map<String, dynamic>(); |
17 | | - if (this.countries != null) { |
18 | | - data['countries'] = this.countries!.map((v) => v.toJson()).toList(); |
19 | | - } |
20 | | - return data; |
21 | | - } |
| 12 | + Map<String, dynamic> toJson() => { |
| 13 | + "shop": shop?.toJson(), |
| 14 | + }; |
22 | 15 | } |
23 | 16 |
|
24 | | -class Countries { |
| 17 | +class Shop { |
25 | 18 | int? id; |
26 | 19 | String? name; |
27 | | - String? code; |
28 | | - String? taxName; |
29 | | - int? tax; |
30 | | - List<Provinces>? provinces; |
| 20 | + String? email; |
| 21 | + String? domain; |
| 22 | + String? province; |
| 23 | + String? country; |
| 24 | + String? address1; |
| 25 | + String? zip; |
| 26 | + String? city; |
| 27 | + dynamic source; |
| 28 | + String? phone; |
| 29 | + double? latitude; |
| 30 | + double? longitude; |
| 31 | + String? primaryLocale; |
| 32 | + String? address2; |
| 33 | + DateTime? createdAt; |
| 34 | + DateTime? updatedAt; |
| 35 | + String? countryCode; |
| 36 | + String? countryName; |
| 37 | + String? currency; |
| 38 | + String? customerEmail; |
| 39 | + String? timezone; |
| 40 | + String? ianaTimezone; |
| 41 | + String? shopOwner; |
| 42 | + String? moneyFormat; |
| 43 | + String? moneyWithCurrencyFormat; |
| 44 | + String? weightUnit; |
| 45 | + String? provinceCode; |
| 46 | + bool? taxesIncluded; |
| 47 | + dynamic autoConfigureTaxInclusivity; |
| 48 | + dynamic taxShipping; |
| 49 | + bool? countyTaxes; |
| 50 | + String? planDisplayName; |
| 51 | + String? planName; |
| 52 | + bool? hasDiscounts; |
| 53 | + bool? hasGiftCards; |
| 54 | + String? myshopifyDomain; |
| 55 | + dynamic googleAppsDomain; |
| 56 | + dynamic googleAppsLoginEnabled; |
| 57 | + String? moneyInEmailsFormat; |
| 58 | + String? moneyWithCurrencyInEmailsFormat; |
| 59 | + bool? eligibleForPayments; |
| 60 | + bool? requiresExtraPaymentsAgreement; |
| 61 | + bool? passwordEnabled; |
| 62 | + bool? hasStorefront; |
| 63 | + bool? finances; |
| 64 | + int? primaryLocationId; |
| 65 | + String? cookieConsentLevel; |
| 66 | + bool? checkoutApiSupported; |
| 67 | + bool? multiLocationEnabled; |
| 68 | + bool? setupRequired; |
| 69 | + bool? preLaunchEnabled; |
| 70 | + List<String>? enabledPresentmentCurrencies; |
| 71 | + bool? transactionalSmsDisabled; |
| 72 | + bool? marketingSmsConsentEnabledAtCheckout; |
31 | 73 |
|
32 | | - Countries( |
33 | | - {this.id, this.name, this.code, this.taxName, this.tax, this.provinces}); |
| 74 | + Shop({ |
| 75 | + this.id, |
| 76 | + this.name, |
| 77 | + this.email, |
| 78 | + this.domain, |
| 79 | + this.province, |
| 80 | + this.country, |
| 81 | + this.address1, |
| 82 | + this.zip, |
| 83 | + this.city, |
| 84 | + this.source, |
| 85 | + this.phone, |
| 86 | + this.latitude, |
| 87 | + this.longitude, |
| 88 | + this.primaryLocale, |
| 89 | + this.address2, |
| 90 | + this.createdAt, |
| 91 | + this.updatedAt, |
| 92 | + this.countryCode, |
| 93 | + this.countryName, |
| 94 | + this.currency, |
| 95 | + this.customerEmail, |
| 96 | + this.timezone, |
| 97 | + this.ianaTimezone, |
| 98 | + this.shopOwner, |
| 99 | + this.moneyFormat, |
| 100 | + this.moneyWithCurrencyFormat, |
| 101 | + this.weightUnit, |
| 102 | + this.provinceCode, |
| 103 | + this.taxesIncluded, |
| 104 | + this.autoConfigureTaxInclusivity, |
| 105 | + this.taxShipping, |
| 106 | + this.countyTaxes, |
| 107 | + this.planDisplayName, |
| 108 | + this.planName, |
| 109 | + this.hasDiscounts, |
| 110 | + this.hasGiftCards, |
| 111 | + this.myshopifyDomain, |
| 112 | + this.googleAppsDomain, |
| 113 | + this.googleAppsLoginEnabled, |
| 114 | + this.moneyInEmailsFormat, |
| 115 | + this.moneyWithCurrencyInEmailsFormat, |
| 116 | + this.eligibleForPayments, |
| 117 | + this.requiresExtraPaymentsAgreement, |
| 118 | + this.passwordEnabled, |
| 119 | + this.hasStorefront, |
| 120 | + this.finances, |
| 121 | + this.primaryLocationId, |
| 122 | + this.cookieConsentLevel, |
| 123 | + this.checkoutApiSupported, |
| 124 | + this.multiLocationEnabled, |
| 125 | + this.setupRequired, |
| 126 | + this.preLaunchEnabled, |
| 127 | + this.enabledPresentmentCurrencies, |
| 128 | + this.transactionalSmsDisabled, |
| 129 | + this.marketingSmsConsentEnabledAtCheckout, |
| 130 | + }); |
34 | 131 |
|
35 | | - Countries.fromJson(Map<String, dynamic> json) { |
36 | | - id = json['id']; |
37 | | - name = json['name']; |
38 | | - code = json['code']; |
39 | | - taxName = json['tax_name']; |
40 | | - tax = json['tax']; |
41 | | - if (json['provinces'] != null) { |
42 | | - provinces = <Provinces>[]; |
43 | | - json['provinces'].forEach((v) { |
44 | | - provinces!.add(new Provinces.fromJson(v)); |
45 | | - }); |
46 | | - } |
47 | | - } |
| 132 | + factory Shop.fromJson(Map<String, dynamic> json) => Shop( |
| 133 | + id: json["id"], |
| 134 | + name: json["name"], |
| 135 | + email: json["email"], |
| 136 | + domain: json["domain"], |
| 137 | + province: json["province"], |
| 138 | + country: json["country"], |
| 139 | + address1: json["address1"], |
| 140 | + zip: json["zip"], |
| 141 | + city: json["city"], |
| 142 | + source: json["source"], |
| 143 | + phone: json["phone"], |
| 144 | + latitude: json["latitude"]?.toDouble(), |
| 145 | + longitude: json["longitude"]?.toDouble(), |
| 146 | + primaryLocale: json["primary_locale"], |
| 147 | + address2: json["address2"], |
| 148 | + createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]), |
| 149 | + updatedAt: json["updated_at"] == null ? null : DateTime.parse(json["updated_at"]), |
| 150 | + countryCode: json["country_code"], |
| 151 | + countryName: json["country_name"], |
| 152 | + currency: json["currency"], |
| 153 | + customerEmail: json["customer_email"], |
| 154 | + timezone: json["timezone"], |
| 155 | + ianaTimezone: json["iana_timezone"], |
| 156 | + shopOwner: json["shop_owner"], |
| 157 | + moneyFormat: json["money_format"], |
| 158 | + moneyWithCurrencyFormat: json["money_with_currency_format"], |
| 159 | + weightUnit: json["weight_unit"], |
| 160 | + provinceCode: json["province_code"], |
| 161 | + taxesIncluded: json["taxes_included"], |
| 162 | + autoConfigureTaxInclusivity: json["auto_configure_tax_inclusivity"], |
| 163 | + taxShipping: json["tax_shipping"], |
| 164 | + countyTaxes: json["county_taxes"], |
| 165 | + planDisplayName: json["plan_display_name"], |
| 166 | + planName: json["plan_name"], |
| 167 | + hasDiscounts: json["has_discounts"], |
| 168 | + hasGiftCards: json["has_gift_cards"], |
| 169 | + myshopifyDomain: json["myshopify_domain"], |
| 170 | + googleAppsDomain: json["google_apps_domain"], |
| 171 | + googleAppsLoginEnabled: json["google_apps_login_enabled"], |
| 172 | + moneyInEmailsFormat: json["money_in_emails_format"], |
| 173 | + moneyWithCurrencyInEmailsFormat: json["money_with_currency_in_emails_format"], |
| 174 | + eligibleForPayments: json["eligible_for_payments"], |
| 175 | + requiresExtraPaymentsAgreement: json["requires_extra_payments_agreement"], |
| 176 | + passwordEnabled: json["password_enabled"], |
| 177 | + hasStorefront: json["has_storefront"], |
| 178 | + finances: json["finances"], |
| 179 | + primaryLocationId: json["primary_location_id"], |
| 180 | + cookieConsentLevel: json["cookie_consent_level"], |
| 181 | + checkoutApiSupported: json["checkout_api_supported"], |
| 182 | + multiLocationEnabled: json["multi_location_enabled"], |
| 183 | + setupRequired: json["setup_required"], |
| 184 | + preLaunchEnabled: json["pre_launch_enabled"], |
| 185 | + enabledPresentmentCurrencies: json["enabled_presentment_currencies"] == null ? [] : List<String>.from(json["enabled_presentment_currencies"]!.map((x) => x)), |
| 186 | + transactionalSmsDisabled: json["transactional_sms_disabled"], |
| 187 | + marketingSmsConsentEnabledAtCheckout: json["marketing_sms_consent_enabled_at_checkout"], |
| 188 | + ); |
48 | 189 |
|
49 | | - Map<String, dynamic> toJson() { |
50 | | - final Map<String, dynamic> data = new Map<String, dynamic>(); |
51 | | - data['id'] = this.id; |
52 | | - data['name'] = this.name; |
53 | | - data['code'] = this.code; |
54 | | - data['tax_name'] = this.taxName; |
55 | | - data['tax'] = this.tax; |
56 | | - if (this.provinces != null) { |
57 | | - data['provinces'] = this.provinces!.map((v) => v.toJson()).toList(); |
58 | | - } |
59 | | - return data; |
60 | | - } |
61 | | -} |
62 | | - |
63 | | -class Provinces { |
64 | | - int? id; |
65 | | - int? countryId; |
66 | | - String? name; |
67 | | - String? code; |
68 | | - String? taxName; |
69 | | - String? taxType; |
70 | | - Null? shippingZoneId; |
71 | | - int? tax; |
72 | | - int? taxPercentage; |
73 | | - |
74 | | - Provinces( |
75 | | - {this.id, |
76 | | - this.countryId, |
77 | | - this.name, |
78 | | - this.code, |
79 | | - this.taxName, |
80 | | - this.taxType, |
81 | | - this.shippingZoneId, |
82 | | - this.tax, |
83 | | - this.taxPercentage}); |
84 | | - |
85 | | - Provinces.fromJson(Map<String, dynamic> json) { |
86 | | - id = json['id']; |
87 | | - countryId = json['country_id']; |
88 | | - name = json['name']; |
89 | | - code = json['code']; |
90 | | - taxName = json['tax_name']; |
91 | | - taxType = json['tax_type']; |
92 | | - shippingZoneId = json['shipping_zone_id']; |
93 | | - tax = json['tax']; |
94 | | - taxPercentage = json['tax_percentage']; |
95 | | - } |
96 | | - |
97 | | - Map<String, dynamic> toJson() { |
98 | | - final Map<String, dynamic> data = new Map<String, dynamic>(); |
99 | | - data['id'] = this.id; |
100 | | - data['country_id'] = this.countryId; |
101 | | - data['name'] = this.name; |
102 | | - data['code'] = this.code; |
103 | | - data['tax_name'] = this.taxName; |
104 | | - data['tax_type'] = this.taxType; |
105 | | - data['shipping_zone_id'] = this.shippingZoneId; |
106 | | - data['tax'] = this.tax; |
107 | | - data['tax_percentage'] = this.taxPercentage; |
108 | | - return data; |
109 | | - } |
| 190 | + Map<String, dynamic> toJson() => { |
| 191 | + "id": id, |
| 192 | + "name": name, |
| 193 | + "email": email, |
| 194 | + "domain": domain, |
| 195 | + "province": province, |
| 196 | + "country": country, |
| 197 | + "address1": address1, |
| 198 | + "zip": zip, |
| 199 | + "city": city, |
| 200 | + "source": source, |
| 201 | + "phone": phone, |
| 202 | + "latitude": latitude, |
| 203 | + "longitude": longitude, |
| 204 | + "primary_locale": primaryLocale, |
| 205 | + "address2": address2, |
| 206 | + "created_at": createdAt?.toIso8601String(), |
| 207 | + "updated_at": updatedAt?.toIso8601String(), |
| 208 | + "country_code": countryCode, |
| 209 | + "country_name": countryName, |
| 210 | + "currency": currency, |
| 211 | + "customer_email": customerEmail, |
| 212 | + "timezone": timezone, |
| 213 | + "iana_timezone": ianaTimezone, |
| 214 | + "shop_owner": shopOwner, |
| 215 | + "money_format": moneyFormat, |
| 216 | + "money_with_currency_format": moneyWithCurrencyFormat, |
| 217 | + "weight_unit": weightUnit, |
| 218 | + "province_code": provinceCode, |
| 219 | + "taxes_included": taxesIncluded, |
| 220 | + "auto_configure_tax_inclusivity": autoConfigureTaxInclusivity, |
| 221 | + "tax_shipping": taxShipping, |
| 222 | + "county_taxes": countyTaxes, |
| 223 | + "plan_display_name": planDisplayName, |
| 224 | + "plan_name": planName, |
| 225 | + "has_discounts": hasDiscounts, |
| 226 | + "has_gift_cards": hasGiftCards, |
| 227 | + "myshopify_domain": myshopifyDomain, |
| 228 | + "google_apps_domain": googleAppsDomain, |
| 229 | + "google_apps_login_enabled": googleAppsLoginEnabled, |
| 230 | + "money_in_emails_format": moneyInEmailsFormat, |
| 231 | + "money_with_currency_in_emails_format": moneyWithCurrencyInEmailsFormat, |
| 232 | + "eligible_for_payments": eligibleForPayments, |
| 233 | + "requires_extra_payments_agreement": requiresExtraPaymentsAgreement, |
| 234 | + "password_enabled": passwordEnabled, |
| 235 | + "has_storefront": hasStorefront, |
| 236 | + "finances": finances, |
| 237 | + "primary_location_id": primaryLocationId, |
| 238 | + "cookie_consent_level": cookieConsentLevel, |
| 239 | + "checkout_api_supported": checkoutApiSupported, |
| 240 | + "multi_location_enabled": multiLocationEnabled, |
| 241 | + "setup_required": setupRequired, |
| 242 | + "pre_launch_enabled": preLaunchEnabled, |
| 243 | + "enabled_presentment_currencies": enabledPresentmentCurrencies == null ? [] : List<dynamic>.from(enabledPresentmentCurrencies!.map((x) => x)), |
| 244 | + "transactional_sms_disabled": transactionalSmsDisabled, |
| 245 | + "marketing_sms_consent_enabled_at_checkout": marketingSmsConsentEnabledAtCheckout, |
| 246 | + }; |
110 | 247 | } |
0 commit comments