DocumentDelivery.fromJson constructor

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

Implementation

factory DocumentDelivery.fromJson(Map<String, Object?> json) =>
    DocumentDelivery(
      deliveries: json["deliveries"] == null
          ? null
          : (json["deliveries"] as List)
              .map(
                (item) => DocumentDeliveryAttempt.fromJson(
                  (item as Map).cast<String, Object?>(),
                ),
              )
              .toList(),
      documentKind: json["document_kind"] == null
          ? null
          : DocumentKind.fromJson(json["document_kind"]),
      documentUrl: json["document_url"] == null
          ? null
          : json["document_url"] as String,
      failedChannels: json["failed_channels"] == null
          ? null
          : (json["failed_channels"] as List)
              .map((item) => item as String)
              .toList(),
      failures: json["failures"] == null
          ? null
          : (json["failures"] as List)
              .map(
                (item) => DocumentDeliveryFailure.fromJson(
                  (item as Map).cast<String, Object?>(),
                ),
              )
              .toList(),
      sentChannels: json["sent_channels"] == null
          ? null
          : (json["sent_channels"] as List)
              .map((item) => item as String)
              .toList(),
    );