77
88from pydantic import BaseModel , Field , field_validator
99
10- from syncmaster .schemas .v1 .transfers .file_format import CSV , JSON , Excel , JSONLine
10+ from syncmaster .schemas .v1 .transfers .file_format import CSV , JSON , XML , Excel , JSONLine
1111
1212
1313# At the moment the ReadTransferSourceParams and ReadTransferTargetParams
1414# classes are identical but may change in the future
1515class ReadFileTransferSource (BaseModel ):
1616 directory_path : str
17- file_format : CSV | JSONLine | JSON | Excel = Field (..., discriminator = "type" )
17+ file_format : CSV | JSONLine | JSON | Excel | XML = Field (..., discriminator = "type" )
1818 options : dict [str , Any ]
1919
2020
2121class ReadFileTransferTarget (BaseModel ):
2222 directory_path : str
23- file_format : CSV | JSONLine | Excel = Field (..., discriminator = "type" ) # JSON format is not supported for writing
23+ # JSON format is not supported for writing
24+ file_format : CSV | JSONLine | Excel | XML = Field (
25+ ...,
26+ discriminator = "type" ,
27+ )
2428 options : dict [str , Any ]
2529
2630
2731# At the moment the CreateTransferSourceParams and CreateTransferTargetParams
2832# classes are identical but may change in the future
2933class CreateFileTransferSource (BaseModel ):
3034 directory_path : str
31- file_format : CSV | JSONLine | JSON | Excel = Field (..., discriminator = "type" )
35+ file_format : CSV | JSONLine | JSON | Excel | XML = Field (..., discriminator = "type" )
3236 options : dict [str , Any ] = Field (default_factory = dict )
3337
3438 class Config :
@@ -44,7 +48,11 @@ def _directory_path_is_valid_path(cls, value):
4448
4549class CreateFileTransferTarget (BaseModel ):
4650 directory_path : str
47- file_format : CSV | JSONLine | Excel = Field (..., discriminator = "type" ) # JSON FORMAT IS NOT SUPPORTED AS A TARGET !
51+ # JSON format is not supported as a target
52+ file_format : CSV | JSONLine | Excel | XML = Field (
53+ ...,
54+ discriminator = "type" ,
55+ )
4856 options : dict [str , Any ] = Field (default_factory = dict )
4957
5058 class Config :
0 commit comments