Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Source/SwiftyDropbox/Shared/Generated/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ public class Auth {

/// Errors occurred during authentication.
public enum AuthError: CustomStringConvertible, JSONRepresentable {
/// The access token is invalid.
/// The access token is invalid. This can happen if the access token has been revoked by Dropbox or the user. To
/// fix this, you should re-authenticate the user. Note: Access tokens that are not returned exactly as
/// provisioned will return this error. Be sure not to truncate or otherwise malform access tokens
/// provided by Dropbox.
case invalidAccessToken
/// The user specified in 'Dropbox-API-Select-User' is no longer on the team.
case invalidSelectUser
Expand Down Expand Up @@ -192,7 +195,7 @@ public class Auth {

/// The InvalidAccountTypeError union
public enum InvalidAccountTypeError: CustomStringConvertible, JSONRepresentable {
/// Current account type doesn't have permission to access this route endpoint.
/// Current account type doesn't have permission to access this endpoint.
case endpoint
/// Current account type doesn't have permission to access this feature.
case feature
Expand Down
95 changes: 85 additions & 10 deletions Source/SwiftyDropbox/Shared/Generated/Files.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6969,6 +6969,10 @@ public class Files {
case cantMoveIntoVault(Files.MoveIntoVaultError)
/// Some content cannot be moved into the Family Room folder under certain circumstances, see detailed error.
case cantMoveIntoFamily(Files.MoveIntoFamilyError)
/// The destination team folder has reached its storage limit.
case teamFolderInsufficientQuota
/// The user's member folder has reached its storage limit.
case memberFolderInsufficientQuota
/// An unspecified error.
case other

Expand Down Expand Up @@ -7045,6 +7049,14 @@ public class Files {
var d = try ["cant_move_into_family": Files.MoveIntoFamilyErrorSerializer().serialize(arg)]
d[".tag"] = .str("cant_move_into_family")
return .dictionary(d)
case .teamFolderInsufficientQuota:
var d = [String: JSON]()
d[".tag"] = .str("team_folder_insufficient_quota")
return .dictionary(d)
case .memberFolderInsufficientQuota:
var d = [String: JSON]()
d[".tag"] = .str("member_folder_insufficient_quota")
return .dictionary(d)
case .other:
var d = [String: JSON]()
d[".tag"] = .str("other")
Expand Down Expand Up @@ -7090,6 +7102,10 @@ public class Files {
case "cant_move_into_family":
let v = try Files.MoveIntoFamilyErrorSerializer().deserialize(d["cant_move_into_family"] ?? .null)
return RelocationError.cantMoveIntoFamily(v)
case "team_folder_insufficient_quota":
return RelocationError.teamFolderInsufficientQuota
case "member_folder_insufficient_quota":
return RelocationError.memberFolderInsufficientQuota
case "other":
return RelocationError.other
default:
Expand Down Expand Up @@ -7133,6 +7149,10 @@ public class Files {
case cantMoveIntoVault(Files.MoveIntoVaultError)
/// Some content cannot be moved into the Family Room folder under certain circumstances, see detailed error.
case cantMoveIntoFamily(Files.MoveIntoFamilyError)
/// The destination team folder has reached its storage limit.
case teamFolderInsufficientQuota
/// The user's member folder has reached its storage limit.
case memberFolderInsufficientQuota
/// An unspecified error.
case other
/// There are too many write operations in user's Dropbox. Please retry this request.
Expand Down Expand Up @@ -7211,6 +7231,14 @@ public class Files {
var d = try ["cant_move_into_family": Files.MoveIntoFamilyErrorSerializer().serialize(arg)]
d[".tag"] = .str("cant_move_into_family")
return .dictionary(d)
case .teamFolderInsufficientQuota:
var d = [String: JSON]()
d[".tag"] = .str("team_folder_insufficient_quota")
return .dictionary(d)
case .memberFolderInsufficientQuota:
var d = [String: JSON]()
d[".tag"] = .str("member_folder_insufficient_quota")
return .dictionary(d)
case .other:
var d = [String: JSON]()
d[".tag"] = .str("other")
Expand Down Expand Up @@ -7260,6 +7288,10 @@ public class Files {
case "cant_move_into_family":
let v = try Files.MoveIntoFamilyErrorSerializer().deserialize(d["cant_move_into_family"] ?? .null)
return RelocationBatchError.cantMoveIntoFamily(v)
case "team_folder_insufficient_quota":
return RelocationBatchError.teamFolderInsufficientQuota
case "member_folder_insufficient_quota":
return RelocationBatchError.memberFolderInsufficientQuota
case "other":
return RelocationBatchError.other
case "too_many_write_operations":
Expand Down Expand Up @@ -10236,20 +10268,25 @@ public class Files {
/// Normally, mediaInfo in FileMetadata is set for photo and video. When this flag is true, mediaInfo in
/// FileMetadata is not populated. This improves latency for use cases where `media_info` is not needed.
public let excludeMediaInfo: Bool?
/// Whether to preserve the original image's transparency in the thumbnail. This is supported only when the
/// output format is PNG or WebP. Requests that set this flag with JPEG output return an error.
public let preserveTransparency: Bool
public init(
resource: Files.PathOrLink,
format: Files.ThumbnailFormat = .jpeg,
size: Files.ThumbnailSize = .w64h64,
mode: Files.ThumbnailMode = .strict,
quality: Files.ThumbnailQuality = .quality80,
excludeMediaInfo: Bool? = nil
excludeMediaInfo: Bool? = nil,
preserveTransparency: Bool = false
) {
self.resource = resource
self.format = format
self.size = size
self.mode = mode
self.quality = quality
self.excludeMediaInfo = excludeMediaInfo
self.preserveTransparency = preserveTransparency
}

func json() throws -> JSON {
Expand All @@ -10275,6 +10312,7 @@ public class Files {
"mode": try Files.ThumbnailModeSerializer().serialize(value.mode),
"quality": try Files.ThumbnailQualitySerializer().serialize(value.quality),
"exclude_media_info": try NullableSerializer(Serialization._BoolSerializer).serialize(value.excludeMediaInfo),
"preserve_transparency": try Serialization._BoolSerializer.serialize(value.preserveTransparency),
]
return .dictionary(output)
}
Expand All @@ -10288,7 +10326,16 @@ public class Files {
let mode = try Files.ThumbnailModeSerializer().deserialize(dict["mode"] ?? Files.ThumbnailModeSerializer().serialize(.strict))
let quality = try Files.ThumbnailQualitySerializer().deserialize(dict["quality"] ?? Files.ThumbnailQualitySerializer().serialize(.quality80))
let excludeMediaInfo = try NullableSerializer(Serialization._BoolSerializer).deserialize(dict["exclude_media_info"] ?? .null)
return ThumbnailV2Arg(resource: resource, format: format, size: size, mode: mode, quality: quality, excludeMediaInfo: excludeMediaInfo)
let preserveTransparency = try Serialization._BoolSerializer.deserialize(dict["preserve_transparency"] ?? .number(0))
return ThumbnailV2Arg(
resource: resource,
format: format,
size: size,
mode: mode,
quality: quality,
excludeMediaInfo: excludeMediaInfo,
preserveTransparency: preserveTransparency
)
default:
throw JSONSerializerError.deserializeError(type: ThumbnailV2Arg.self, json: json)
}
Expand All @@ -10311,6 +10358,8 @@ public class Files {
case accessDenied
/// The shared link does not exist.
case notFound
/// Transparency preservation is supported only for PNG and WebP output.
case unsupportedOutputFormat
/// An unspecified error.
case other

Expand Down Expand Up @@ -10359,6 +10408,10 @@ public class Files {
var d = [String: JSON]()
d[".tag"] = .str("not_found")
return .dictionary(d)
case .unsupportedOutputFormat:
var d = [String: JSON]()
d[".tag"] = .str("unsupported_output_format")
return .dictionary(d)
case .other:
var d = [String: JSON]()
d[".tag"] = .str("other")
Expand Down Expand Up @@ -10386,6 +10439,8 @@ public class Files {
return ThumbnailV2Error.accessDenied
case "not_found":
return ThumbnailV2Error.notFound
case "unsupported_output_format":
return ThumbnailV2Error.unsupportedOutputFormat
case "other":
return ThumbnailV2Error.other
default:
Expand Down Expand Up @@ -10484,7 +10539,8 @@ public class Files {
/// The UploadArg struct
public class UploadArg: Files.CommitInfo {
/// A hash of the file content uploaded in this call. If provided and the uploaded content does not match this
/// hash, an error will be returned. For more information see our Content hash
/// hash, an error will be returned. Optional, but recommended to avoid committing data corrupted in
/// transit. For more information see our Content hash
/// https://www.dropbox.com/developers/reference/content-hash page.
public let contentHash: String?
public init(
Expand Down Expand Up @@ -10659,7 +10715,8 @@ public class Files {
/// anymore with the current session.
public let close: Bool
/// A hash of the file content uploaded in this call. If provided and the uploaded content does not match this
/// hash, an error will be returned. For more information see our Content hash
/// hash, an error will be returned. Optional, but recommended to avoid committing data corrupted in
/// transit. For more information see our Content hash
/// https://www.dropbox.com/developers/reference/content-hash page.
public let contentHash: String?
public init(cursor: Files.UploadSessionCursor, close: Bool = false, contentHash: String? = nil) {
Expand Down Expand Up @@ -10710,10 +10767,10 @@ public class Files {
public class UploadSessionAppendBatchArg: CustomStringConvertible, JSONRepresentable {
/// Append information for each file in the batch.
public let entries: [Files.UploadSessionAppendBatchArgEntry]
/// A hash of the entire request body which is all the concatenated pieces of file content that were uploaded in
/// this call. If provided and the uploaded content does not match this hash, an error will be returned.
/// For more information see our Content hash https://www.dropbox.com/developers/reference/content-hash
/// page.
/// A single hash of all the concatenated file contents uploaded in this call. If provided and the uploaded
/// content does not match this hash, an error will be returned. Optional, but recommended to avoid
/// committing data corrupted in transit. For more information see our Content hash
/// https://www.dropbox.com/developers/reference/content-hash page.
public let contentHash: String?
public init(entries: [Files.UploadSessionAppendBatchArgEntry], contentHash: String? = nil) {
self.entries = entries
Expand Down Expand Up @@ -11242,7 +11299,8 @@ public class Files {
/// Contains the path and other optional modifiers for the commit.
public let commit: Files.CommitInfo
/// A hash of the file content uploaded in this call. If provided and the uploaded content does not match this
/// hash, an error will be returned. For more information see our Content hash
/// hash, an error will be returned. Optional, but recommended to avoid committing data corrupted in
/// transit. For more information see our Content hash
/// https://www.dropbox.com/developers/reference/content-hash page.
public let contentHash: String?
public init(cursor: Files.UploadSessionCursor, commit: Files.CommitInfo, contentHash: String? = nil) {
Expand Down Expand Up @@ -11847,7 +11905,8 @@ public class Files {
/// Type of upload session you want to start. If not specified, default is sequential in UploadSessionType.
public let sessionType: Files.UploadSessionType?
/// A hash of the file content uploaded in this call. If provided and the uploaded content does not match this
/// hash, an error will be returned. For more information see our Content hash
/// hash, an error will be returned. Optional, but recommended to avoid committing data corrupted in
/// transit. For more information see our Content hash
/// https://www.dropbox.com/developers/reference/content-hash page.
public let contentHash: String?
public init(close: Bool = false, sessionType: Files.UploadSessionType? = nil, contentHash: String? = nil) {
Expand Down Expand Up @@ -12390,6 +12449,10 @@ public class Files {
case tooManyWriteOperations
/// The user doesn't have permission to perform the action due to restrictions set by a team administrator
case accessRestricted
/// The destination team folder has reached its storage limit.
case teamFolderInsufficientSpace
/// The user's member folder has reached its storage limit.
case memberFolderInsufficientSpace
/// An unspecified error.
case other

Expand Down Expand Up @@ -12446,6 +12509,14 @@ public class Files {
var d = [String: JSON]()
d[".tag"] = .str("access_restricted")
return .dictionary(d)
case .teamFolderInsufficientSpace:
var d = [String: JSON]()
d[".tag"] = .str("team_folder_insufficient_space")
return .dictionary(d)
case .memberFolderInsufficientSpace:
var d = [String: JSON]()
d[".tag"] = .str("member_folder_insufficient_space")
return .dictionary(d)
case .other:
var d = [String: JSON]()
d[".tag"] = .str("other")
Expand Down Expand Up @@ -12478,6 +12549,10 @@ public class Files {
return WriteError.tooManyWriteOperations
case "access_restricted":
return WriteError.accessRestricted
case "team_folder_insufficient_space":
return WriteError.teamFolderInsufficientSpace
case "member_folder_insufficient_space":
return WriteError.memberFolderInsufficientSpace
case "other":
return WriteError.other
default:
Expand Down
30 changes: 27 additions & 3 deletions Source/SwiftyDropbox/Shared/Generated/FilesAppAuthRoutes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class FilesAppAuthRoutes: DropboxTransportClientOwning {
/// - parameter excludeMediaInfo: Normally, mediaInfo in FileMetadata is set for photo and video. When this flag is
/// true, mediaInfo in FileMetadata is not populated. This improves latency for use cases where `media_info` is
/// not needed.
/// - parameter preserveTransparency: Whether to preserve the original image's transparency in the thumbnail. This
/// is supported only when the output format is PNG or WebP. Requests that set this flag with JPEG output return
/// an error.
/// - parameter overwrite: A boolean to set behavior in the event of a naming conflict. `True` will overwrite
/// conflicting file at destination. `False` will take no action (but if left unhandled in destination closure,
/// an NSError will be thrown).
Expand All @@ -45,11 +48,20 @@ public class FilesAppAuthRoutes: DropboxTransportClientOwning {
mode: Files.ThumbnailMode = .strict,
quality: Files.ThumbnailQuality = .quality80,
excludeMediaInfo: Bool? = nil,
preserveTransparency: Bool = false,
overwrite: Bool = false,
destination: URL
) -> DownloadRequestFile<Files.PreviewResultSerializer, Files.ThumbnailV2ErrorSerializer> {
let route = Files.getThumbnailV2
let serverArgs = Files.ThumbnailV2Arg(resource: resource, format: format, size: size, mode: mode, quality: quality, excludeMediaInfo: excludeMediaInfo)
let serverArgs = Files.ThumbnailV2Arg(
resource: resource,
format: format,
size: size,
mode: mode,
quality: quality,
excludeMediaInfo: excludeMediaInfo,
preserveTransparency: preserveTransparency
)
return client.request(route, serverArgs: serverArgs, overwrite: overwrite, destination: destination)
}

Expand All @@ -70,6 +82,9 @@ public class FilesAppAuthRoutes: DropboxTransportClientOwning {
/// - parameter excludeMediaInfo: Normally, mediaInfo in FileMetadata is set for photo and video. When this flag is
/// true, mediaInfo in FileMetadata is not populated. This improves latency for use cases where `media_info` is
/// not needed.
/// - parameter preserveTransparency: Whether to preserve the original image's transparency in the thumbnail. This
/// is supported only when the output format is PNG or WebP. Requests that set this flag with JPEG output return
/// an error.
///
/// - returns: Through the response callback, the caller will receive a `Files.PreviewResult` object on success or a
/// `Files.ThumbnailV2Error` object on failure.
Expand All @@ -79,10 +94,19 @@ public class FilesAppAuthRoutes: DropboxTransportClientOwning {
size: Files.ThumbnailSize = .w64h64,
mode: Files.ThumbnailMode = .strict,
quality: Files.ThumbnailQuality = .quality80,
excludeMediaInfo: Bool? = nil
excludeMediaInfo: Bool? = nil,
preserveTransparency: Bool = false
) -> DownloadRequestMemory<Files.PreviewResultSerializer, Files.ThumbnailV2ErrorSerializer> {
let route = Files.getThumbnailV2
let serverArgs = Files.ThumbnailV2Arg(resource: resource, format: format, size: size, mode: mode, quality: quality, excludeMediaInfo: excludeMediaInfo)
let serverArgs = Files.ThumbnailV2Arg(
resource: resource,
format: format,
size: size,
mode: mode,
quality: quality,
excludeMediaInfo: excludeMediaInfo,
preserveTransparency: preserveTransparency
)
return client.request(route, serverArgs: serverArgs)
}

Expand Down
Loading
Loading