@@ -185,6 +185,39 @@ open class FilesRoutes {
185185 return client. request ( route, serverArgs: serverArgs)
186186 }
187187
188+ /// Create multiple folders at once. This route is asynchronous for large batches, which returns a job ID
189+ /// immediately and runs the create folder batch asynchronously. Otherwise, creates the folders and returns the
190+ /// result synchronously for smaller inputs. You can force asynchronous behaviour by using the forceAsync in
191+ /// CreateFolderBatchArg flag. Use createFolderBatchCheck to check the job status.
192+ ///
193+ /// - parameter paths: List of paths to be created in the user's Dropbox. Duplicate path arguments in the batch are
194+ /// considered only once.
195+ /// - parameter autorename: If there's a conflict, have the Dropbox server try to autorename the folder to avoid the
196+ /// conflict.
197+ /// - parameter forceAsync: Whether to force the create to happen asynchronously.
198+ ///
199+ /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderBatchLaunch` object on
200+ /// success or a `Void` object on failure.
201+ @discardableResult open func createFolderBatch( paths: Array < String > , autorename: Bool = false , forceAsync: Bool = false ) -> RpcRequest < Files . CreateFolderBatchLaunchSerializer , VoidSerializer > {
202+ let route = Files . createFolderBatch
203+ let serverArgs = Files . CreateFolderBatchArg ( paths: paths, autorename: autorename, forceAsync: forceAsync)
204+ return client. request ( route, serverArgs: serverArgs)
205+ }
206+
207+ /// Returns the status of an asynchronous job for createFolderBatch. If success, it returns list of result for each
208+ /// entry.
209+ ///
210+ /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method
211+ /// that launched the job.
212+ ///
213+ /// - returns: Through the response callback, the caller will receive a `Files.CreateFolderBatchJobStatus` object
214+ /// on success or a `Async.PollError` object on failure.
215+ @discardableResult open func createFolderBatchCheck( asyncJobId: String ) -> RpcRequest < Files . CreateFolderBatchJobStatusSerializer , Async . PollErrorSerializer > {
216+ let route = Files . createFolderBatchCheck
217+ let serverArgs = Async . PollArg ( asyncJobId: asyncJobId)
218+ return client. request ( route, serverArgs: serverArgs)
219+ }
220+
188221 /// Create a folder at a given path.
189222 ///
190223 /// - parameter path: Path in the user's Dropbox to create.
@@ -204,13 +237,15 @@ open class FilesRoutes {
204237 /// corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata object.
205238 ///
206239 /// - parameter path: Path in the user's Dropbox to delete.
240+ /// - parameter parentRev: Perform delete if given "rev" matches the existing file's latest "rev". This field does
241+ /// not support deleting a folder.
207242 ///
208243 /// - returns: Through the response callback, the caller will receive a `Files.Metadata` object on success or a
209244 /// `Files.DeleteError` object on failure.
210245 @available ( * , unavailable, message: " delete is deprecated. Use delete_v2. " )
211- @discardableResult open func delete( path: String ) -> RpcRequest < Files . MetadataSerializer , Files . DeleteErrorSerializer > {
246+ @discardableResult open func delete( path: String , parentRev : String ? = nil ) -> RpcRequest < Files . MetadataSerializer , Files . DeleteErrorSerializer > {
212247 let route = Files . delete
213- let serverArgs = Files . DeleteArg ( path: path)
248+ let serverArgs = Files . DeleteArg ( path: path, parentRev : parentRev )
214249 return client. request ( route, serverArgs: serverArgs)
215250 }
216251
@@ -244,12 +279,14 @@ open class FilesRoutes {
244279 /// corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata object.
245280 ///
246281 /// - parameter path: Path in the user's Dropbox to delete.
282+ /// - parameter parentRev: Perform delete if given "rev" matches the existing file's latest "rev". This field does
283+ /// not support deleting a folder.
247284 ///
248285 /// - returns: Through the response callback, the caller will receive a `Files.DeleteResult` object on success or a
249286 /// `Files.DeleteError` object on failure.
250- @discardableResult open func deleteV2( path: String ) -> RpcRequest < Files . DeleteResultSerializer , Files . DeleteErrorSerializer > {
287+ @discardableResult open func deleteV2( path: String , parentRev : String ? = nil ) -> RpcRequest < Files . DeleteResultSerializer , Files . DeleteErrorSerializer > {
251288 let route = Files . deleteV2
252- let serverArgs = Files . DeleteArg ( path: path)
289+ let serverArgs = Files . DeleteArg ( path: path, parentRev : parentRev )
253290 return client. request ( route, serverArgs: serverArgs)
254291 }
255292
@@ -391,6 +428,7 @@ open class FilesRoutes {
391428 /// - parameter format: The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg
392429 /// should be preferred, while png is better for screenshots and digital arts.
393430 /// - parameter size: The size for the thumbnail image.
431+ /// - parameter mode: How to resize and crop the image to achieve the desired size.
394432 /// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite
395433 /// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure, an
396434 /// NSError will be thrown).
@@ -399,9 +437,9 @@ open class FilesRoutes {
399437 ///
400438 /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a
401439 /// `Files.ThumbnailError` object on failure.
402- @discardableResult open func getThumbnail( path: String , format: Files . ThumbnailFormat = . jpeg, size: Files . ThumbnailSize = . w64h64, overwrite: Bool = false , destination: @escaping ( URL , HTTPURLResponse ) -> URL ) -> DownloadRequestFile < Files . FileMetadataSerializer , Files . ThumbnailErrorSerializer > {
440+ @discardableResult open func getThumbnail( path: String , format: Files . ThumbnailFormat = . jpeg, size: Files . ThumbnailSize = . w64h64, mode : Files . ThumbnailMode = . strict , overwrite: Bool = false , destination: @escaping ( URL , HTTPURLResponse ) -> URL ) -> DownloadRequestFile < Files . FileMetadataSerializer , Files . ThumbnailErrorSerializer > {
403441 let route = Files . getThumbnail
404- let serverArgs = Files . ThumbnailArg ( path: path, format: format, size: size)
442+ let serverArgs = Files . ThumbnailArg ( path: path, format: format, size: size, mode : mode )
405443 return client. request ( route, serverArgs: serverArgs, overwrite: overwrite, destination: destination)
406444 }
407445
@@ -412,12 +450,13 @@ open class FilesRoutes {
412450 /// - parameter format: The format for the thumbnail image, jpeg (default) or png. For images that are photos, jpeg
413451 /// should be preferred, while png is better for screenshots and digital arts.
414452 /// - parameter size: The size for the thumbnail image.
453+ /// - parameter mode: How to resize and crop the image to achieve the desired size.
415454 ///
416455 /// - returns: Through the response callback, the caller will receive a `Files.FileMetadata` object on success or a
417456 /// `Files.ThumbnailError` object on failure.
418- @discardableResult open func getThumbnail( path: String , format: Files . ThumbnailFormat = . jpeg, size: Files . ThumbnailSize = . w64h64) -> DownloadRequestMemory < Files . FileMetadataSerializer , Files . ThumbnailErrorSerializer > {
457+ @discardableResult open func getThumbnail( path: String , format: Files . ThumbnailFormat = . jpeg, size: Files . ThumbnailSize = . w64h64, mode : Files . ThumbnailMode = . strict ) -> DownloadRequestMemory < Files . FileMetadataSerializer , Files . ThumbnailErrorSerializer > {
419458 let route = Files . getThumbnail
420- let serverArgs = Files . ThumbnailArg ( path: path, format: format, size: size)
459+ let serverArgs = Files . ThumbnailArg ( path: path, format: format, size: size, mode : mode )
421460 return client. request ( route, serverArgs: serverArgs)
422461 }
423462
@@ -633,12 +672,14 @@ open class FilesRoutes {
633672 /// endpoint is only available for Dropbox Business apps.
634673 ///
635674 /// - parameter path: Path in the user's Dropbox to delete.
675+ /// - parameter parentRev: Perform delete if given "rev" matches the existing file's latest "rev". This field does
676+ /// not support deleting a folder.
636677 ///
637678 /// - returns: Through the response callback, the caller will receive a `Void` object on success or a
638679 /// `Files.DeleteError` object on failure.
639- @discardableResult open func permanentlyDelete( path: String ) -> RpcRequest < VoidSerializer , Files . DeleteErrorSerializer > {
680+ @discardableResult open func permanentlyDelete( path: String , parentRev : String ? = nil ) -> RpcRequest < VoidSerializer , Files . DeleteErrorSerializer > {
640681 let route = Files . permanentlyDelete
641- let serverArgs = Files . DeleteArg ( path: path)
682+ let serverArgs = Files . DeleteArg ( path: path, parentRev : parentRev )
642683 return client. request ( route, serverArgs: serverArgs)
643684 }
644685
0 commit comments