FileLink.fromJson constructor

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

Implementation

factory FileLink.fromJson(Map<String, Object?> json) => FileLink(
      id: json["id"] as String,
      kind: Kind.fromJson(json["kind"]),
      fileId: json["file_id"] as String,
      purpose: json["purpose"] as String,
      status: Status.fromJson(json["status"]),
      active: json["active"] as bool,
      delivery: Delivery.fromJson(
        (json["delivery"] as Map).cast<String, Object?>(),
      ),
      access: Access.fromJson(
        (json["access"] as Map).cast<String, Object?>(),
      ),
      createdBy: Actor.fromJson(
        (json["created_by"] as Map).cast<String, Object?>(),
      ),
      revokedBy: json["revoked_by"] == null
          ? null
          : Actor.fromJson(
              (json["revoked_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"]),
      revokedAt: json["revoked_at"] == null
          ? null
          : decodeDateTime(json["revoked_at"]),
    );