@@ -37,28 +37,28 @@ class ClientFile(BaseModel):
3737 filename : FileName = Field (..., description = "File name" )
3838 filesize : NonNegativeInt = Field (..., description = "File size in bytes" )
3939 sha256_checksum : SHA256Str = Field (..., description = "SHA256 checksum" )
40- destination : Annotated [
41- ProgramJobFilePath | None ,
42- Field (..., description = "Destination within a program job" ),
43- ]
4440
4541
4642class File (BaseModel ):
4743 """Represents a file stored on the server side i.e. a unique reference to a file in the cloud."""
4844
49- id : Annotated [UUID , Field (description = "Resource identifier" )]
50- filename : Annotated [str , Field (description = "Name of the file with extension" )]
51- content_type : Annotated [
52- str | None ,
53- Field (
54- description = "Guess of type content [EXPERIMENTAL]" , validate_default = True
55- ),
56- ] = None
57- sha256_checksum : Annotated [
58- SHA256Str | None ,
59- Field (description = "SHA256 hash of the file's content" , alias = "checksum" ),
60- ] = None
61- e_tag : Annotated [ETag | None , Field (description = "S3 entity tag" )] = None
45+ # WARNING: from pydantic import File as FileParam
46+ # NOTE: see https://ant.apache.org/manual/Tasks/checksum.html
47+
48+ id : UUID = Field (..., description = "Resource identifier" )
49+
50+ filename : str = Field (..., description = "Name of the file with extension" )
51+ content_type : str | None = Field (
52+ default = None ,
53+ description = "Guess of type content [EXPERIMENTAL]" ,
54+ validate_default = True ,
55+ )
56+ sha256_checksum : SHA256Str | None = Field (
57+ default = None ,
58+ description = "SHA256 hash of the file's content" ,
59+ alias = "checksum" , # alias for backwards compatibility
60+ )
61+ e_tag : ETag | None = Field (default = None , description = "S3 entity tag" )
6262
6363 model_config = ConfigDict (
6464 populate_by_name = True ,
@@ -163,18 +163,16 @@ def quoted_storage_file_id(self) -> str:
163163
164164
165165class UploadLinks (BaseModel ):
166- abort_upload : Annotated [ str , Field ()]
167- complete_upload : Annotated [ str , Field ()]
166+ abort_upload : str
167+ complete_upload : str
168168
169169
170170class FileUploadData (BaseModel ):
171- chunk_size : Annotated [ int , Field ( description = "Chunk size in bytes" )]
172- urls : Annotated [ list [Annotated [AnyHttpUrl , UriSchema ()]], Field () ]
173- links : Annotated [ UploadLinks , Field ()]
171+ chunk_size : NonNegativeInt
172+ urls : list [Annotated [AnyHttpUrl , UriSchema ()]]
173+ links : UploadLinks
174174
175175
176176class ClientFileUploadData (BaseModel ):
177- file_id : Annotated [UUID , Field (description = "The file resource id" )]
178- upload_schema : Annotated [
179- FileUploadData , Field (description = "Schema for uploading file" )
180- ]
177+ file_id : UUID = Field (..., description = "The file resource id" )
178+ upload_schema : FileUploadData = Field (..., description = "Schema for uploading file" )
0 commit comments