@@ -1061,6 +1061,127 @@ open class Files {
10611061 }
10621062 }
10631063
1064+ /// The DownloadZipArg struct
1065+ open class DownloadZipArg : CustomStringConvertible {
1066+ /// The path of the folder to download.
1067+ open let path : String
1068+ public init ( path: String ) {
1069+ stringValidator ( pattern: " (/(.|[ \\ r \\ n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?) " ) ( path)
1070+ self . path = path
1071+ }
1072+ open var description : String {
1073+ return " \( SerializeUtil . prepareJSONForSerialization ( DownloadZipArgSerializer ( ) . serialize ( self ) ) ) "
1074+ }
1075+ }
1076+ open class DownloadZipArgSerializer : JSONSerializer {
1077+ public init ( ) { }
1078+ open func serialize( _ value: DownloadZipArg ) -> JSON {
1079+ let output = [
1080+ " path " : Serialization . _StringSerializer. serialize ( value. path) ,
1081+ ]
1082+ return . dictionary( output)
1083+ }
1084+ open func deserialize( _ json: JSON ) -> DownloadZipArg {
1085+ switch json {
1086+ case . dictionary( let dict) :
1087+ let path = Serialization . _StringSerializer. deserialize ( dict [ " path " ] ?? . null)
1088+ return DownloadZipArg ( path: path)
1089+ default :
1090+ fatalError ( " Type error deserializing " )
1091+ }
1092+ }
1093+ }
1094+
1095+ /// The DownloadZipError union
1096+ public enum DownloadZipError : CustomStringConvertible {
1097+ /// An unspecified error.
1098+ case path( Files . LookupError )
1099+ /// The folder is too large to download.
1100+ case tooLarge
1101+ /// The folder has too many files to download.
1102+ case tooManyFiles
1103+ /// An unspecified error.
1104+ case other
1105+
1106+ public var description : String {
1107+ return " \( SerializeUtil . prepareJSONForSerialization ( DownloadZipErrorSerializer ( ) . serialize ( self ) ) ) "
1108+ }
1109+ }
1110+ open class DownloadZipErrorSerializer : JSONSerializer {
1111+ public init ( ) { }
1112+ open func serialize( _ value: DownloadZipError ) -> JSON {
1113+ switch value {
1114+ case . path( let arg) :
1115+ var d = [ " path " : Files . LookupErrorSerializer ( ) . serialize ( arg) ]
1116+ d [ " .tag " ] = . str( " path " )
1117+ return . dictionary( d)
1118+ case . tooLarge:
1119+ var d = [ String: JSON] ( )
1120+ d [ " .tag " ] = . str( " too_large " )
1121+ return . dictionary( d)
1122+ case . tooManyFiles:
1123+ var d = [ String: JSON] ( )
1124+ d [ " .tag " ] = . str( " too_many_files " )
1125+ return . dictionary( d)
1126+ case . other:
1127+ var d = [ String: JSON] ( )
1128+ d [ " .tag " ] = . str( " other " )
1129+ return . dictionary( d)
1130+ }
1131+ }
1132+ open func deserialize( _ json: JSON ) -> DownloadZipError {
1133+ switch json {
1134+ case . dictionary( let d) :
1135+ let tag = Serialization . getTag ( d)
1136+ switch tag {
1137+ case " path " :
1138+ let v = Files . LookupErrorSerializer ( ) . deserialize ( d [ " path " ] ?? . null)
1139+ return DownloadZipError . path ( v)
1140+ case " too_large " :
1141+ return DownloadZipError . tooLarge
1142+ case " too_many_files " :
1143+ return DownloadZipError . tooManyFiles
1144+ case " other " :
1145+ return DownloadZipError . other
1146+ default :
1147+ return DownloadZipError . other
1148+ }
1149+ default :
1150+ fatalError ( " Failed to deserialize " )
1151+ }
1152+ }
1153+ }
1154+
1155+ /// The DownloadZipResult struct
1156+ open class DownloadZipResult : CustomStringConvertible {
1157+ /// (no description)
1158+ open let metadata : Files . FolderMetadata
1159+ public init ( metadata: Files . FolderMetadata ) {
1160+ self . metadata = metadata
1161+ }
1162+ open var description : String {
1163+ return " \( SerializeUtil . prepareJSONForSerialization ( DownloadZipResultSerializer ( ) . serialize ( self ) ) ) "
1164+ }
1165+ }
1166+ open class DownloadZipResultSerializer : JSONSerializer {
1167+ public init ( ) { }
1168+ open func serialize( _ value: DownloadZipResult ) -> JSON {
1169+ let output = [
1170+ " metadata " : Files . FolderMetadataSerializer ( ) . serialize ( value. metadata) ,
1171+ ]
1172+ return . dictionary( output)
1173+ }
1174+ open func deserialize( _ json: JSON ) -> DownloadZipResult {
1175+ switch json {
1176+ case . dictionary( let dict) :
1177+ let metadata = Files . FolderMetadataSerializer ( ) . deserialize ( dict [ " metadata " ] ?? . null)
1178+ return DownloadZipResult ( metadata: metadata)
1179+ default :
1180+ fatalError ( " Type error deserializing " )
1181+ }
1182+ }
1183+ }
1184+
10641185 /// The FileMetadata struct
10651186 open class FileMetadata : Files . Metadata {
10661187 /// A unique identifier for the file.
@@ -4230,6 +4351,8 @@ open class Files {
42304351 public enum UploadError : CustomStringConvertible {
42314352 /// Unable to save the uploaded contents to a file.
42324353 case path( Files . UploadWriteFailed )
4354+ /// The supplied property group is invalid.
4355+ case propertiesError( FileProperties . InvalidPropertyGroupError )
42334356 /// An unspecified error.
42344357 case other
42354358
@@ -4245,6 +4368,10 @@ open class Files {
42454368 var d = Serialization . getFields ( Files . UploadWriteFailedSerializer ( ) . serialize ( arg) )
42464369 d [ " .tag " ] = . str( " path " )
42474370 return . dictionary( d)
4371+ case . propertiesError( let arg) :
4372+ var d = [ " properties_error " : FileProperties . InvalidPropertyGroupErrorSerializer ( ) . serialize ( arg) ]
4373+ d [ " .tag " ] = . str( " properties_error " )
4374+ return . dictionary( d)
42484375 case . other:
42494376 var d = [ String: JSON] ( )
42504377 d [ " .tag " ] = . str( " other " )
@@ -4259,6 +4386,9 @@ open class Files {
42594386 case " path " :
42604387 let v = Files . UploadWriteFailedSerializer ( ) . deserialize ( json)
42614388 return UploadError . path ( v)
4389+ case " properties_error " :
4390+ let v = FileProperties . InvalidPropertyGroupErrorSerializer ( ) . deserialize ( d [ " properties_error " ] ?? . null)
4391+ return UploadError . propertiesError ( v)
42624392 case " other " :
42634393 return UploadError . other
42644394 default :
@@ -4274,10 +4404,10 @@ open class Files {
42744404 public enum UploadErrorWithProperties : CustomStringConvertible {
42754405 /// Unable to save the uploaded contents to a file.
42764406 case path( Files . UploadWriteFailed )
4407+ /// The supplied property group is invalid.
4408+ case propertiesError( FileProperties . InvalidPropertyGroupError )
42774409 /// An unspecified error.
42784410 case other
4279- /// An unspecified error.
4280- case propertiesError( FileProperties . InvalidPropertyGroupError )
42814411
42824412 public var description : String {
42834413 return " \( SerializeUtil . prepareJSONForSerialization ( UploadErrorWithPropertiesSerializer ( ) . serialize ( self ) ) ) "
@@ -4291,14 +4421,14 @@ open class Files {
42914421 var d = Serialization . getFields ( Files . UploadWriteFailedSerializer ( ) . serialize ( arg) )
42924422 d [ " .tag " ] = . str( " path " )
42934423 return . dictionary( d)
4294- case . other:
4295- var d = [ String: JSON] ( )
4296- d [ " .tag " ] = . str( " other " )
4297- return . dictionary( d)
42984424 case . propertiesError( let arg) :
42994425 var d = [ " properties_error " : FileProperties . InvalidPropertyGroupErrorSerializer ( ) . serialize ( arg) ]
43004426 d [ " .tag " ] = . str( " properties_error " )
43014427 return . dictionary( d)
4428+ case . other:
4429+ var d = [ String: JSON] ( )
4430+ d [ " .tag " ] = . str( " other " )
4431+ return . dictionary( d)
43024432 }
43034433 }
43044434 open func deserialize( _ json: JSON ) -> UploadErrorWithProperties {
@@ -4309,11 +4439,11 @@ open class Files {
43094439 case " path " :
43104440 let v = Files . UploadWriteFailedSerializer ( ) . deserialize ( json)
43114441 return UploadErrorWithProperties . path ( v)
4312- case " other " :
4313- return UploadErrorWithProperties . other
43144442 case " properties_error " :
43154443 let v = FileProperties . InvalidPropertyGroupErrorSerializer ( ) . deserialize ( d [ " properties_error " ] ?? . null)
43164444 return UploadErrorWithProperties . propertiesError ( v)
4445+ case " other " :
4446+ return UploadErrorWithProperties . other
43174447 default :
43184448 fatalError ( " Unknown tag \( tag) " )
43194449 }
@@ -5300,6 +5430,16 @@ open class Files {
53005430 attrs: [ " host " : " content " ,
53015431 " style " : " download " ]
53025432 )
5433+ static let downloadZip = Route (
5434+ name: " download_zip " ,
5435+ namespace: " files " ,
5436+ deprecated: false ,
5437+ argSerializer: Files . DownloadZipArgSerializer ( ) ,
5438+ responseSerializer: Files . DownloadZipResultSerializer ( ) ,
5439+ errorSerializer: Files . DownloadZipErrorSerializer ( ) ,
5440+ attrs: [ " host " : " content " ,
5441+ " style " : " download " ]
5442+ )
53035443 static let getMetadata = Route (
53045444 name: " get_metadata " ,
53055445 namespace: " files " ,
0 commit comments