UpdateRequest.fromJson constructor
Implementation
factory UpdateRequest.fromJson(Map<String, Object?> json) => UpdateRequest(
type: json["type"] == null ? null : Type.fromJson(json["type"]),
name: json["name"] == null ? null : json["name"] as String,
description:
json["description"] == null ? null : json["description"] as String,
about: json["about"] == null ? null : json["about"] as String,
taxCode: json["tax_code"] == null ? null : json["tax_code"] as String,
category: json["category"] == null ? null : json["category"] as String,
shipment: json["shipment"] == null
? null
: ShipmentInput.fromJson(
(json["shipment"] as Map).cast<String, Object?>(),
),
dimensions: json["dimensions"] == null
? null
: DimensionsInput.fromJson(
(json["dimensions"] as Map).cast<String, Object?>(),
),
unitDimension: json["unit_dimension"] == null
? null
: json["unit_dimension"] as String,
media: json["media"] == null
? null
: MediaInput.fromJson(
(json["media"] as Map).cast<String, Object?>(),
),
images: json["images"] == null
? null
: (json["images"] as List).map((item) => item as String).toList(),
attributes: json["attributes"] == null
? null
: (json["attributes"] as List)
.map(
(item) => AttributeInput.fromJson(
(item as Map).cast<String, Object?>(),
),
)
.toList(),
customData: json["custom_data"] == null
? null
: core.CustomData.fromJson(json["custom_data"]),
productId: json["product_id"] as String,
);