UpdateRequest.fromJson constructor
Implementation
factory UpdateRequest.fromJson(Map<String, Object?> json) => UpdateRequest(
name: json["name"] == null ? null : json["name"] as String,
about: json["about"] == null ? null : json["about"] as String,
channel:
json["channel"] == null ? null : Channel.fromJson(json["channel"]),
purpose: json["purpose"] == null ? null : json["purpose"] as String,
locale: json["locale"] == null ? null : json["locale"] as String,
variables: json["variables"] == null
? null
: (json["variables"] as List)
.map(
(item) => VariableInput.fromJson(
(item as Map).cast<String, Object?>(),
),
)
.toList(),
sms: json["sms"] == null
? null
: SMSContentInput.fromJson(
(json["sms"] as Map).cast<String, Object?>(),
),
email: json["email"] == null
? null
: EmailContentInput.fromJson(
(json["email"] as Map).cast<String, Object?>(),
),
attachments: json["attachments"] == null
? null
: (json["attachments"] as List)
.map((item) => item as String)
.toList(),
id: json["id"] as String,
);