toJson method
Implementation
Map<String, dynamic> toJson() {
final result$data = <String, dynamic>{};
if (_$data.containsKey('product')) {
final l$product = product;
result$data['product'] = l$product;
}
if (_$data.containsKey('internalProduct')) {
final l$internalProduct = internalProduct;
result$data['internalProduct'] = l$internalProduct;
}
if (_$data.containsKey('productAttributesValues')) {
final l$productAttributesValues = productAttributesValues;
result$data['productAttributesValues'] =
l$productAttributesValues?.map((e) => e).toList();
}
final l$barcode = barcode;
result$data['barcode'] = l$barcode;
if (_$data.containsKey('name')) {
final l$name = name;
result$data['name'] = l$name;
}
if (_$data.containsKey('price')) {
final l$price = price;
result$data['price'] = l$price;
}
if (_$data.containsKey('prices')) {
final l$prices = prices;
result$data['prices'] = l$prices?.map((e) => e.toJson()).toList();
}
if (_$data.containsKey('priceCredit')) {
final l$priceCredit = priceCredit;
result$data['priceCredit'] =
l$priceCredit?.map((e) => e.toJson()).toList();
}
if (_$data.containsKey('discount')) {
final l$discount = discount;
result$data['discount'] = l$discount?.toJson();
}
if (_$data.containsKey('condition')) {
final l$condition = condition;
result$data['condition'] = l$condition == null
? null
: toJson$Enum$ProductConditionEnum(l$condition);
}
if (_$data.containsKey('status')) {
final l$status = status;
result$data['status'] =
l$status == null ? null : toJson$Enum$ProductStatusEnum(l$status);
}
if (_$data.containsKey('media')) {
final l$media = media;
result$data['media'] = l$media?.toJson();
}
if (_$data.containsKey('catalogueCategory')) {
final l$catalogueCategory = catalogueCategory;
result$data['catalogueCategory'] =
l$catalogueCategory?.map((e) => e).toList();
}
if (_$data.containsKey('maintenance')) {
final l$maintenance = maintenance;
result$data['maintenance'] = l$maintenance?.toJson();
}
if (_$data.containsKey('pixel')) {
final l$pixel = pixel;
result$data['pixel'] = l$pixel?.toJson();
}
if (_$data.containsKey('priceList')) {
final l$priceList = priceList;
result$data['priceList'] = l$priceList?.map((e) => e.toJson()).toList();
}
if (_$data.containsKey('taxes')) {
final l$taxes = taxes;
result$data['taxes'] = l$taxes?.map((e) => e.toJson()).toList();
}
if (_$data.containsKey('translation')) {
final l$translation = translation;
result$data['translation'] =
l$translation?.map((e) => e.toJson()).toList();
}
if (_$data.containsKey('supplier')) {
final l$supplier = supplier;
result$data['supplier'] = l$supplier;
}
return result$data;
}