UploadRequest.fromJson constructor

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

Implementation

factory UploadRequest.fromJson(Map<String, Object?> json) => UploadRequest(
      id: json["id"] as String,
      purpose: json["purpose"] as String,
      status: Status.fromJson(json["status"]),
      active: json["active"] as bool,
      fileId: json["file_id"] == null ? null : json["file_id"] as String,
      uploadUrl:
          json["upload_url"] == null ? null : json["upload_url"] as String,
      constraints: Constraints.fromJson(
        (json["constraints"] as Map).cast<String, Object?>(),
      ),
      display: Display.fromJson(
        (json["display"] as Map).cast<String, Object?>(),
      ),
      subject: inttegro_file.Party.fromJson(
        (json["subject"] as Map).cast<String, Object?>(),
      ),
      recipient: inttegro_file.Party.fromJson(
        (json["recipient"] as Map).cast<String, Object?>(),
      ),
      resource: inttegro_file.Resource.fromJson(
        (json["resource"] as Map).cast<String, Object?>(),
      ),
      requester: Actor.fromJson(
        (json["requester"] as Map).cast<String, Object?>(),
      ),
      attempts: Attempts.fromJson(
        (json["attempts"] as Map).cast<String, Object?>(),
      ),
      latestError: json["latest_error"] == null
          ? null
          : LatestError.fromJson(
              (json["latest_error"] as Map).cast<String, Object?>(),
            ),
      canceledBy: json["canceled_by"] == null
          ? null
          : Actor.fromJson(
              (json["canceled_by"] as Map).cast<String, Object?>(),
            ),
      customData: json["custom_data"] == null
          ? null
          : core.CustomData.fromJson(json["custom_data"]),
      metadata: json["metadata"] == null
          ? null
          : core.FileMetadata.fromJson(json["metadata"]),
      createdAt: decodeDateTime(json["created_at"]),
      updatedAt: decodeDateTime(json["updated_at"]),
      expiresAt: decodeDateTime(json["expires_at"]),
      uploadingAt: json["uploading_at"] == null
          ? null
          : decodeDateTime(json["uploading_at"]),
      fulfilledAt: json["fulfilled_at"] == null
          ? null
          : decodeDateTime(json["fulfilled_at"]),
      expiredAt: json["expired_at"] == null
          ? null
          : decodeDateTime(json["expired_at"]),
      canceledAt: json["canceled_at"] == null
          ? null
          : decodeDateTime(json["canceled_at"]),
      attempt: json["attempt"] == null
          ? null
          : Attempt.fromJson(
              (json["attempt"] as Map).cast<String, Object?>(),
            ),
    );