class EControlModel { int? id; String? name; Location? location; Contact? contact; List? openingHours; OfferInformation? offerInformation; PaymentMethods? paymentMethods; PaymentArrangements? paymentArrangements; int? position; bool? open; double? distance; List? prices; EControlModel( {this.id, this.name, this.location, this.contact, this.openingHours, this.offerInformation, this.paymentMethods, this.paymentArrangements, this.position, this.open, this.distance, this.prices}); EControlModel.fromJson(Map json) { id = json['id']; name = json['name']; location = json['location'] != null ? Location.fromJson(json['location']) : null; contact = json['contact'] != null ? Contact.fromJson(json['contact']) : null; if (json['openingHours'] != null) { openingHours = []; json['openingHours'].forEach((v) { openingHours!.add(OpeningHours.fromJson(v)); }); } offerInformation = json['offerInformation'] != null ? OfferInformation.fromJson(json['offerInformation']) : null; paymentMethods = json['paymentMethods'] != null ? PaymentMethods.fromJson(json['paymentMethods']) : null; paymentArrangements = json['paymentArrangements'] != null ? PaymentArrangements.fromJson(json['paymentArrangements']) : null; position = json['position']; open = json['open']; distance = json['distance']; if (json['prices'] != null) { prices = []; json['prices'].forEach((v) { prices!.add(Prices.fromJson(v)); }); } } Map toJson() { final Map data = {}; data['id'] = id; data['name'] = name; if (location != null) { data['location'] = location!.toJson(); } if (contact != null) { data['contact'] = contact!.toJson(); } if (openingHours != null) { data['openingHours'] = openingHours!.map((v) => v.toJson()).toList(); } if (offerInformation != null) { data['offerInformation'] = offerInformation!.toJson(); } if (paymentMethods != null) { data['paymentMethods'] = paymentMethods!.toJson(); } if (paymentArrangements != null) { data['paymentArrangements'] = paymentArrangements!.toJson(); } data['position'] = position; data['open'] = open; data['distance'] = distance; if (prices != null) { data['prices'] = prices!.map((v) => v.toJson()).toList(); } return data; } } class Location { String? address; String? postalCode; String? city; double? latitude; double? longitude; Location( {this.address, this.postalCode, this.city, this.latitude, this.longitude}); Location.fromJson(Map json) { address = json['address']; postalCode = json['postalCode']; city = json['city']; latitude = json['latitude']; longitude = json['longitude']; } Map toJson() { final Map data = {}; data['address'] = address; data['postalCode'] = postalCode; data['city'] = city; data['latitude'] = latitude; data['longitude'] = longitude; return data; } } class Contact { String? telephone; String? fax; String? mail; String? website; Contact({this.telephone, this.fax, this.mail, this.website}); Contact.fromJson(Map json) { telephone = json['telephone']; fax = json['fax']; mail = json['mail']; website = json['website']; } Map toJson() { final Map data = {}; data['telephone'] = telephone; data['fax'] = fax; data['mail'] = mail; data['website'] = website; return data; } } class OpeningHours { String? day; String? label; int? order; String? from; String? to; OpeningHours({this.day, this.label, this.order, this.from, this.to}); OpeningHours.fromJson(Map json) { day = json['day']; label = json['label']; order = json['order']; from = json['from']; to = json['to']; } Map toJson() { final Map data = {}; data['day'] = day; data['label'] = label; data['order'] = order; data['from'] = from; data['to'] = to; return data; } } class OfferInformation { bool? service; bool? selfService; bool? unattended; OfferInformation({this.service, this.selfService, this.unattended}); OfferInformation.fromJson(Map json) { service = json['service']; selfService = json['selfService']; unattended = json['unattended']; } Map toJson() { final Map data = {}; data['service'] = service; data['selfService'] = selfService; data['unattended'] = unattended; return data; } } class PaymentMethods { bool? cash; bool? debitCard; bool? creditCard; String? others; PaymentMethods({this.cash, this.debitCard, this.creditCard, this.others}); PaymentMethods.fromJson(Map json) { cash = json['cash']; debitCard = json['debitCard']; creditCard = json['creditCard']; others = json['others']; } Map toJson() { final Map data = {}; data['cash'] = cash; data['debitCard'] = debitCard; data['creditCard'] = creditCard; data['others'] = others; return data; } } class PaymentArrangements { bool? cooperative; bool? clubCard; PaymentArrangements({this.cooperative, this.clubCard}); PaymentArrangements.fromJson(Map json) { cooperative = json['cooperative']; clubCard = json['clubCard']; } Map toJson() { final Map data = {}; data['cooperative'] = cooperative; data['clubCard'] = clubCard; return data; } } class Prices { String? fuelType; double? amount; String? label; Prices({this.fuelType, this.amount, this.label}); Prices.fromJson(Map json) { fuelType = json['fuelType']; amount = json['amount']; label = json['label']; } Map toJson() { final Map data = {}; data['fuelType'] = fuelType; data['amount'] = amount; data['label'] = label; return data; } }