CreateRequest.fromJson constructor
Implementation
factory CreateRequest.fromJson(
Map<String, Object?> json,
) =>
CreateRequest(
product: json["product"] == null
? null
: CreateRequestProduct.fromJson(
(json["product"] as Map).cast<String, Object?>(),
),
productId:
json["product_id"] == null ? null : json["product_id"] as String,
price: json["price"] == null
? null
: CreateRequestPrice.fromJson(
(json["price"] as Map).cast<String, Object?>(),
),
priceId: json["price_id"] == null ? null : json["price_id"] as String,
usage: json["usage"] == null
? null
: CreateRequestUsage.fromJson(
(json["usage"] as Map).cast<String, Object?>(),
),
expiresAt: json["expires_at"] == null
? null
: decodeDateTime(json["expires_at"]),
presentation: json["presentation"] == null
? null
: Presentation.fromJson(
(json["presentation"] as Map).cast<String, Object?>(),
),
quantity: CreateRequestQuantity.fromJson(
(json["quantity"] as Map).cast<String, Object?>(),
),
);