EmailCreateRequest.fromJson constructor

EmailCreateRequest.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory EmailCreateRequest.fromJson(
  Map<String, Object?> json,
) =>
    EmailCreateRequest(
      about: json["about"] == null ? null : json["about"] as String,
      attachments: json["attachments"] == null
          ? null
          : (json["attachments"] as List)
              .map((item) => item as String)
              .toList(),
      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(),
      channel: Channel.fromJson(json["channel"]),
      email: EmailContentInput.fromJson(
        (json["email"] as Map).cast<String, Object?>(),
      ),
      name: json["name"] as String,
      purpose: json["purpose"] as String,
    );