Customer.fromJson constructor
Implementation
factory Customer.fromJson(Map<String, Object?> json) => Customer(
balance: core.CustomerBalance.fromJson(json["balance"]),
billingAddress: json["billing_address"] == null
? null
: Address.fromJson(
(json["billing_address"] as Map).cast<String, Object?>(),
),
createdAt: decodeDateTime(json["created_at"]),
customData: json["custom_data"] == null
? null
: core.CustomData.fromJson(json["custom_data"]),
emailAddress: json["email_address"] == null
? null
: json["email_address"] as String,
fingerprint: json["fingerprint"] as String,
guest: json["guest"] as bool,
id: json["id"] as String,
name: json["name"] as String,
phoneNumber: json["phone_number"] == null
? null
: json["phone_number"] as String,
reference:
json["reference"] == null ? null : json["reference"] as String,
shippingAddress: json["shipping_address"] == null
? null
: Address.fromJson(
(json["shipping_address"] as Map).cast<String, Object?>(),
),
suffix: json["suffix"] == null ? null : json["suffix"] as String,
title: json["title"] == null ? null : json["title"] as String,
updatedAt: json["updated_at"] == null
? null
: decodeDateTime(json["updated_at"]),
);