diff --git a/Source/SwiftyDropbox/Shared/Generated/Auth.swift b/Source/SwiftyDropbox/Shared/Generated/Auth.swift index d9a48af8..2a1f1b60 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Auth.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Auth.swift @@ -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 @@ -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 diff --git a/Source/SwiftyDropbox/Shared/Generated/Files.swift b/Source/SwiftyDropbox/Shared/Generated/Files.swift index 4ef20dc5..01646315 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Files.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Files.swift @@ -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 @@ -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") @@ -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: @@ -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. @@ -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") @@ -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": @@ -10236,13 +10268,17 @@ 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 @@ -10250,6 +10286,7 @@ public class Files { self.mode = mode self.quality = quality self.excludeMediaInfo = excludeMediaInfo + self.preserveTransparency = preserveTransparency } func json() throws -> JSON { @@ -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) } @@ -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) } @@ -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 @@ -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") @@ -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: @@ -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( @@ -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) { @@ -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 @@ -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) { @@ -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) { @@ -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 @@ -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") @@ -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: diff --git a/Source/SwiftyDropbox/Shared/Generated/FilesAppAuthRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/FilesAppAuthRoutes.swift index 9bb662f4..02ada972 100644 --- a/Source/SwiftyDropbox/Shared/Generated/FilesAppAuthRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/FilesAppAuthRoutes.swift @@ -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). @@ -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 { 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) } @@ -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. @@ -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 { 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) } diff --git a/Source/SwiftyDropbox/Shared/Generated/FilesRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/FilesRoutes.swift index 9d089ceb..7fce3e2b 100644 --- a/Source/SwiftyDropbox/Shared/Generated/FilesRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/FilesRoutes.swift @@ -52,7 +52,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - scope: files.content.write /// /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an Data object. /// @@ -91,7 +92,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - scope: files.content.write /// /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an URL object. /// @@ -130,7 +132,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - scope: files.content.write /// /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an InputStream object. /// @@ -738,16 +741,15 @@ public class FilesRoutes: DropboxTransportClientOwning { /// maximum temporary upload link duration is 4 hours. Upon consumption or expiration, a new link will have to /// be generated. Multiple links may exist for a specific upload path at any given time. The POST request on /// the temporary upload link must have its Content-Type set to "application/octet-stream". Example temporary - /// upload link consumption request: curl -X POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND - /// --header "Content-Type: application/octet-stream" --data-binary @local_file.txt A successful temporary - /// upload link consumption request returns the content hash of the uploaded data in JSON format. Example - /// successful temporary upload link consumption response: {"content-hash": - /// "599d71033d700ac892a0e48fa61b125d2f5994"} An unsuccessful temporary upload link consumption request returns - /// any of the following status codes: HTTP 400 Bad Request: Content-Type is not one of - /// application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: The temporary upload link - /// does not exist or is currently unavailable, the upload failed, or another error happened. HTTP 410 Gone: The - /// temporary upload link is expired or consumed. Example unsuccessful temporary upload link consumption - /// response: Temporary upload link has been recently consumed. + /// upload link consumption request: curl -X POST --header "Content-Type: + /// application/octet-stream" --data-binary @local_file.txt A successful temporary upload link consumption + /// request returns the content hash of the uploaded data in JSON format. Example successful temporary upload + /// link consumption response: {"content-hash": "599d71033d700ac892a0e48fa61b125d2f5994"} An unsuccessful + /// temporary upload link consumption request returns any of the following status codes: HTTP 400 Bad Request: + /// Content-Type is not one of application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: + /// The temporary upload link does not exist or is currently unavailable, the upload failed, or another error + /// happened. HTTP 410 Gone: The temporary upload link is expired or consumed. Example unsuccessful temporary + /// upload link consumption response: Temporary upload link has been recently consumed. /// /// - scope: files.content.write /// @@ -854,6 +856,9 @@ public class FilesRoutes: 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). @@ -868,11 +873,20 @@ public class FilesRoutes: DropboxTransportClientOwning { mode: Files.ThumbnailMode = .strict, quality: Files.ThumbnailQuality = .quality80, excludeMediaInfo: Bool? = nil, + preserveTransparency: Bool = false, overwrite: Bool = false, destination: URL ) -> DownloadRequestFile { 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) } @@ -893,6 +907,9 @@ public class FilesRoutes: 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. @@ -902,10 +919,19 @@ public class FilesRoutes: DropboxTransportClientOwning { size: Files.ThumbnailSize = .w64h64, mode: Files.ThumbnailMode = .strict, quality: Files.ThumbnailQuality = .quality80, - excludeMediaInfo: Bool? = nil + excludeMediaInfo: Bool? = nil, + preserveTransparency: Bool = false ) -> DownloadRequestMemory { 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) } @@ -1703,7 +1729,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - scope: files.content.write /// /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an Data object. /// @@ -1743,7 +1770,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - scope: files.content.write /// /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an URL object. /// @@ -1783,7 +1811,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - scope: files.content.write /// /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an InputStream object. /// @@ -1902,7 +1931,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - parameter close: If true, the current session will be closed, at which point you won't be able to call /// uploadSessionAppendV2 anymore with the current session. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an Data object. /// @@ -1930,7 +1960,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - parameter close: If true, the current session will be closed, at which point you won't be able to call /// uploadSessionAppendV2 anymore with the current session. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an URL object. /// @@ -1958,7 +1989,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - parameter close: If true, the current session will be closed, at which point you won't be able to call /// uploadSessionAppendV2 anymore with the current session. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an InputStream object. /// @@ -1984,9 +2016,9 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - scope: files.content.write /// /// - parameter entries: Append information for each file in the batch. - /// - parameter contentHash: 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 + /// - parameter contentHash: 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. /// - parameter input: The file to upload, as an Data object. /// @@ -2012,9 +2044,9 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - scope: files.content.write /// /// - parameter entries: Append information for each file in the batch. - /// - parameter contentHash: 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 + /// - parameter contentHash: 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. /// - parameter input: The file to upload, as an URL object. /// @@ -2040,9 +2072,9 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - scope: files.content.write /// /// - parameter entries: Append information for each file in the batch. - /// - parameter contentHash: 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 + /// - parameter contentHash: 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. /// - parameter input: The file to upload, as an InputStream object. /// @@ -2068,7 +2100,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter commit: Contains the path and other optional modifiers for the commit. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an Data object. /// @@ -2094,7 +2127,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter commit: Contains the path and other optional modifiers for the commit. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an URL object. /// @@ -2120,7 +2154,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter commit: Contains the path and other optional modifiers for the commit. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an InputStream object. /// @@ -2240,7 +2275,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in /// UploadSessionType. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an Data object. /// @@ -2284,7 +2320,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in /// UploadSessionType. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an URL object. /// @@ -2328,7 +2365,8 @@ public class FilesRoutes: DropboxTransportClientOwning { /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in /// UploadSessionType. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an InputStream object. /// diff --git a/Source/SwiftyDropbox/Shared/Generated/Riviera.swift b/Source/SwiftyDropbox/Shared/Generated/Riviera.swift index 0a24301b..16ef6eb6 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Riviera.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Riviera.swift @@ -11,16 +11,16 @@ public class Riviera { /// GPS coordinates and related tags extracted from image EXIF data. Fields are populated on a best-effort basis and /// may be empty when absent from the source file. public class ApiExifGpsMetadata: CustomStringConvertible, JSONRepresentable { - /// Latitude / longitude in decimal degrees (positive = N/E, negative = S/W). + /// Latitude in decimal degrees (positive = north, negative = south). public let latitude: Float - /// (no description) + /// Longitude in decimal degrees (positive = east, negative = west). public let longitude: Float /// Altitude in meters, as reported by the source (string to preserve the original representation, which may /// include a reference direction). public let altitude: String - /// Timestamp / datestamp of the GPS fix, in the EXIF-provided format. + /// Time of the GPS fix, in the EXIF-provided format. public let timestamp_: String - /// (no description) + /// Date of the GPS fix, in the EXIF-provided format. public let datestamp: String public init(latitude: Float = 0.0, longitude: Float = 0.0, altitude: String = "", timestamp_: String = "", datestamp: String = "") { comparableValidator()(latitude) @@ -76,40 +76,40 @@ public class Riviera { } } - /// Image EXIF metadata. Mirrors the useful subset of the internal `riviera.ExifMetadata` message. Fields are - /// best-effort and may be empty. + /// Image EXIF metadata. Fields are populated on a best-effort basis and may be empty when absent from the source + /// file. public class ApiExifMetadata: CustomStringConvertible, JSONRepresentable { - /// (no description) + /// Width of the image, in pixels. public let imageWidth: UInt32 - /// (no description) + /// Height of the image, in pixels. public let imageHeight: UInt32 - /// (no description) + /// Manufacturer of the device that captured the image, e.g. "Apple". public let cameraMake: String - /// (no description) + /// Model of the device that captured the image, e.g. "iPhone 15 Pro". public let cameraModel: String - /// (no description) + /// Model of the lens the image was captured with, when the source records it. public let lensModel: String /// Capture time in the EXIF-provided format (local time of the camera). public let dateTimeOriginal: String - /// Timezone offset for `date_time_original`, e.g. "+09:00". + /// Timezone offset for dateTimeOriginal in ApiExifMetadata, e.g. "+09:00". public let offsetTimeOriginal: String /// EXIF orientation value (1-8). See the EXIF spec; 1 is the normal upright orientation. public let orientation: UInt32 - /// fraction in string form, e.g. "1/250" + /// Exposure time the image was captured with, as a fractional-second string, e.g. "1/250". public let exposureTime: String - /// (no description) + /// Aperture the image was captured at, as reported by the EXIF aperture tag. public let apertureValue: Double - /// (no description) + /// ISO sensitivity the image was captured at. public let isoSpeed: UInt32 - /// e.g. "26.0 mm" + /// Focal length the image was captured at, including the unit, e.g. "26.0 mm". public let focalLength: String - /// (no description) + /// Total pixel count of the image, in megapixels. public let megapixels: Double - /// (no description) + /// Creator credited in the EXIF artist tag. public let artist: String - /// (no description) + /// Copyright notice from the EXIF copyright tag. public let copyright: String - /// (no description) + /// Location tags from the image, when the source recorded a location. public let gpsMetadata: Riviera.ApiExifGpsMetadata? public init( imageWidth: UInt32 = 0, @@ -242,16 +242,73 @@ public class Riviera { } } - /// Audio/video container and per-stream metadata. Mirrors the useful subset of the internal `riviera.MediaMetadata` - /// message. + /// A single extracted scene-change keyframe. + public class ApiKeyframe: CustomStringConvertible, JSONRepresentable { + /// Presentation timestamp of the keyframe, in seconds from the start of the video. + public let timestamp_: Double + /// Scene-change score that triggered this keyframe, in the range [0.0, 1.0]. Higher values indicate a more + /// pronounced scene change relative to the preceding frame. The first keyframe of a video is always + /// reported as 1.0: the start of a video is a scene boundary by definition, so that score is not a + /// measured frame-to-frame comparison. + public let sceneScore: Double + /// The extracted frame as a base64-encoded JPEG image. Empty when the request set `include_images = false`. + public let imageBase64: String + public init(timestamp_: Double = 0.0, sceneScore: Double = 0.0, imageBase64: String = "") { + comparableValidator()(timestamp_) + self.timestamp_ = timestamp_ + comparableValidator()(sceneScore) + self.sceneScore = sceneScore + stringValidator()(imageBase64) + self.imageBase64 = imageBase64 + } + + func json() throws -> JSON { + try ApiKeyframeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ApiKeyframeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ApiKeyframe: \(error)" + } + } + } + + public class ApiKeyframeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: ApiKeyframe) throws -> JSON { + let output = [ + "timestamp": try Serialization._DoubleSerializer.serialize(value.timestamp_), + "scene_score": try Serialization._DoubleSerializer.serialize(value.sceneScore), + "image_base64": try Serialization._StringSerializer.serialize(value.imageBase64), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> ApiKeyframe { + switch json { + case .dictionary(let dict): + let timestamp_ = try Serialization._DoubleSerializer.deserialize(dict["timestamp"] ?? .number(0.0)) + let sceneScore = try Serialization._DoubleSerializer.deserialize(dict["scene_score"] ?? .number(0.0)) + let imageBase64 = try Serialization._StringSerializer.deserialize(dict["image_base64"] ?? .str("")) + return ApiKeyframe(timestamp_: timestamp_, sceneScore: sceneScore, imageBase64: imageBase64) + default: + throw JSONSerializerError.deserializeError(type: ApiKeyframe.self, json: json) + } + } + } + + /// Audio/video container and per-stream metadata. Fields are populated on a best-effort basis and may be empty when + /// absent from the source file. public class ApiMediaMetadata: CustomStringConvertible, JSONRepresentable { - /// (no description) + /// Overall bitrate of the container, in bits per second. public let bitrateBps: UInt64 - /// (no description) + /// Duration of the media, in seconds. public let durationS: Double /// Container-level creation time, when present. public let creationTime: String - /// (no description) + /// The audio and video streams the container holds, in container order. public let streams: [Riviera.ApiMediaStream]? public init(bitrateBps: UInt64 = 0, durationS: Double = 0.0, creationTime: String = "", streams: [Riviera.ApiMediaStream]? = nil) { comparableValidator()(bitrateBps) @@ -304,31 +361,33 @@ public class Riviera { /// A single audio or video stream within a media file. public class ApiMediaStream: CustomStringConvertible, JSONRepresentable { - /// (no description) + /// Zero-based index of the stream within the container. public let index: UInt32 - /// "audio", "video", etc. + /// Kind of media the stream carries, e.g. "audio" or "video". public let codecType: String - /// (no description) + /// Name of the codec the stream is encoded with, e.g. "h264" or "aac". public let codecName: String - /// (no description) + /// Bitrate of this stream, in bits per second. public let bitrateBps: UInt64 - /// (no description) + /// Duration of this stream, in seconds. public let durationS: Double - /// Video-specific fields (zero / empty for audio streams). + /// Width of the video frame, in pixels. Zero for audio streams. public let width: UInt32 - /// (no description) + /// Height of the video frame, in pixels. Zero for audio streams. public let height: UInt32 - /// (no description) + /// Frame rate of the stream, in frames per second. Zero for audio streams. public let framesPerSecond: Double - /// (no description) + /// Rotation to apply on playback, in degrees, as recorded in the stream metadata. Zero for audio streams and + /// for video that needs no rotation. public let rotation: Int32 - /// e.g. "16:9" + /// Aspect ratio the video should be displayed at, as a "width:height" string, e.g. "16:9". Empty for audio + /// streams. public let displayAspectRatio: String - /// Audio-specific fields (zero / empty for video streams). + /// Number of audio channels in the stream. Zero for video streams. public let channels: UInt32 - /// (no description) + /// Layout of the audio channels, e.g. "stereo". Empty for video streams. public let channelLayout: String - /// (no description) + /// Sample rate of the audio stream, in samples per second. Zero for video streams. public let sampleRateS: UInt64 /// ISO 639 language code for the stream, when present. public let languageIso639: String @@ -452,32 +511,33 @@ public class Riviera { } } - /// MS Office document metadata. Mirrors the internal `riviera.OfficeMetadata` message. Some fields apply only to - /// specific document types (e.g. `slides` for PowerPoint, `words`/`pages` for Word). + /// MS Office document metadata. Some fields apply only to specific document types (e.g. slides in ApiOfficeMetadata + /// for PowerPoint, words in ApiOfficeMetadata and pages in ApiOfficeMetadata for Word). public class ApiOfficeMetadata: CustomStringConvertible, JSONRepresentable { - /// (no description) + /// Which kind of Office document this metadata was extracted from. public let fileType: Riviera.OfficeFileType - /// (no description) + /// Author recorded in the document properties. public let creator: String - /// (no description) + /// Company recorded in the document properties. public let company: String - /// (no description) + /// Title recorded in the document properties. public let title: String - /// (no description) + /// Subject recorded in the document properties. public let subject: String - /// (no description) + /// Keywords recorded in the document properties, in the document's own formatting (typically a single comma- or + /// space-separated string). public let keywords: String - /// (no description) + /// Description recorded in the document properties. public let description_: String - /// (no description) + /// Total editing time recorded in the document properties, in minutes. public let totalEditTimeMinutes: UInt32 - /// Word only. + /// Page count recorded in the document properties. Word documents only; zero for PowerPoint and Excel. public let pages: UInt32 - /// (no description) + /// Word count recorded in the document properties. Word documents only; zero for PowerPoint and Excel. public let words: UInt32 - /// PowerPoint only. + /// Slide count recorded in the document properties. PowerPoint documents only; zero for Word and Excel. public let slides: UInt32 - /// (no description) + /// Revision number recorded in the document properties. public let revisionNumber: String public init( fileType: Riviera.OfficeFileType = .officeFiletypeUnknown, @@ -590,11 +650,11 @@ public class Riviera { /// PDF document metadata. public class ApiPdfMetadata: CustomStringConvertible, JSONRepresentable { - /// (no description) + /// Number of pages in the document. public let pages: UInt32 - /// Width / height of the first page, in PDF points. + /// Width of the first page, in PDF points. public let width: UInt32 - /// (no description) + /// Height of the first page, in PDF points. public let height: UInt32 public init(pages: UInt32 = 0, width: UInt32 = 0, height: UInt32 = 0) { comparableValidator()(pages) @@ -642,11 +702,12 @@ public class Riviera { } } - /// Structured transcript for APIv2 + /// A transcript, split into segments. public class ApiStructuredTranscript: CustomStringConvertible, JSONRepresentable { - /// (no description) + /// The segments of the transcript, in playback order. public let segments: [Riviera.ApiTranscriptSegment]? - /// (no description) + /// The language of the transcript, as an ISO 639-1 code (e.g. "en"). This is the language detected in the + /// audio, or the one supplied in audioLanguage in GetTranscriptArgs. public let transcriptLocale: String public init(segments: [Riviera.ApiTranscriptSegment]? = nil, transcriptLocale: String = "") { self.segments = segments @@ -689,13 +750,13 @@ public class Riviera { } } - /// Transcript segment for APIv2 + /// A contiguous span of transcribed speech. The span covered by a segment depends on the requested TimestampLevel. public class ApiTranscriptSegment: CustomStringConvertible, JSONRepresentable { - /// (no description) + /// The transcribed text of this segment. public let text: String - /// (no description) + /// Offset of the start of this segment, in seconds from the beginning of the media. public let startTime: Double - /// (no description) + /// Offset of the end of this segment, in seconds from the beginning of the media. public let endTime: Double public init(text: String = "", startTime: Double = 0.0, endTime: Double = 0.0) { stringValidator()(text) @@ -743,7 +804,7 @@ public class Riviera { } } - /// Reason a transcript job failed. Returned in the `failed` variant of `GetTranscriptAsyncCheckResult`. This is a + /// Reason a transcript job failed. Returned in the failed in GetTranscriptAsyncCheckResult variant. This is a /// semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a /// failed job is still a normal successful poll response). Callers should branch on the variant. public enum ContentApiV2Error: CustomStringConvertible, JSONRepresentable { @@ -753,15 +814,16 @@ public class Riviera { /// The request could not be processed as supplied (a problem with the caller's input). The string is a /// human-readable message; retrying the same request will not help. case userError(String) - /// An unspecified error. + /// The audio to transcribe is longer than the supported maximum. case mediaDurationError(Riviera.MediaDurationError) - /// An unspecified error. + /// The file has no audio track, or no audio content could be detected in it. case noAudioError - /// An unspecified error. + /// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. case linkDownloadDisabledError - /// An unspecified error. + /// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, + /// so such links cannot be transcribed. case sharedLinkPasswordProtected - /// An unspecified error. + /// A resource limit was exceeded while producing the result. case limitExceededError /// The referenced file does not exist or is not accessible. case notFoundError @@ -869,15 +931,15 @@ public class Riviera { /// The FileIdOrUrl union public enum FileIdOrUrl: CustomStringConvertible, JSONRepresentable { - /// A Dropbox-issued file id (format: "id:") for a file the authenticated user has access to. + /// A Dropbox-issued file ID for a file the authenticated user has access to, e.g. "id:a4ayc_80_OEAAAAAAAAAYa". case fileId(String) - /// Either a Dropbox shared link (www.dropbox.com) or an external HTTP or HTTPS URL pointing to a supported - /// file. - Dropbox shared links are resolved internally using the caller's authenticated identity and - /// the link's visibility / download settings. They therefore require an authenticated user context - /// (anonymous `url` requests against Dropbox links are rejected with an `access_error`). Links - /// protected by a password are rejected with `shared_link_password_protected`; links with downloads - /// disabled are rejected with `link_download_disabled_error`. - External URLs are fetched through the - /// backend's egress proxy and must point at a supported file extension. + /// Either a Dropbox shared link (www.dropbox.com) or an internet-accessible URL pointing to a supported file. - + /// Dropbox shared links are resolved internally using the caller's authenticated identity and the + /// link's visibility / download settings. They therefore require an authenticated user context; + /// requests made with app auth alone are rejected. Password-protected links and links with downloads + /// disabled are rejected as well. - Other URLs are fetched by Dropbox's servers, so they must be + /// reachable from the public internet -- not only from the calling application's network -- and must + /// point at a supported file extension. case url(String) /// An absolute Dropbox path, e.g. "/folder/example.pdf". case path(String) @@ -945,12 +1007,187 @@ public class Riviera { } } - /// Arguments for the asynchronous `get_markdown_async` route. Exactly one of `file_id`, `path`, or `url` must be - /// supplied via `file_id_or_url` to identify the document to convert to markdown. + /// Arguments for the asynchronous `get_keyframes_async` route. Exactly one of `file_id`, `path`, or `url` must be + /// supplied via `file_id_or_url` to identify the video whose scene-change keyframes should be extracted. + public class GetKeyframesArgs: CustomStringConvertible, JSONRepresentable { + /// Identifier of the video file to extract keyframes from. Callers must set exactly one of the `FileIdOrUrl` + /// variants. Keyframe extraction is supported for video files only; see the route description for the + /// supported formats. Requests against unsupported formats return `unsupported_format_error`. + public let fileIdOrUrl: Riviera.FileIdOrUrl? + /// Sensitivity of scene-change detection. A keyframe is emitted whenever the frame-to-frame scene score crosses + /// this threshold, so a LOWER value yields MORE keyframes. Valid range is (0.0, 1.0]. When omitted + /// (0.0) the service uses a default of 0.3, which is a good starting point for most videos. + public let sceneChangeThreshold: Double + /// When true, each returned keyframe includes the JPEG image bytes, base64-encoded, in + /// `ApiKeyframe.image_base64`. When false, the response contains only per-keyframe metadata (timestamp + /// and scene score) and `image_base64` is left empty -- useful when you only need the scene boundaries + /// and want a small response. NOTE: because the field defaults to false in proto3, callers who want + /// images must set this explicitly to true. + public let includeImages: Bool + public init(fileIdOrUrl: Riviera.FileIdOrUrl? = nil, sceneChangeThreshold: Double = 0.0, includeImages: Bool = false) { + self.fileIdOrUrl = fileIdOrUrl + comparableValidator()(sceneChangeThreshold) + self.sceneChangeThreshold = sceneChangeThreshold + self.includeImages = includeImages + } + + func json() throws -> JSON { + try GetKeyframesArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetKeyframesArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetKeyframesArgs: \(error)" + } + } + } + + public class GetKeyframesArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetKeyframesArgs) throws -> JSON { + let output = [ + "file_id_or_url": try NullableSerializer(Riviera.FileIdOrUrlSerializer()).serialize(value.fileIdOrUrl), + "scene_change_threshold": try Serialization._DoubleSerializer.serialize(value.sceneChangeThreshold), + "include_images": try Serialization._BoolSerializer.serialize(value.includeImages), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> GetKeyframesArgs { + switch json { + case .dictionary(let dict): + let fileIdOrUrl = try NullableSerializer(Riviera.FileIdOrUrlSerializer()).deserialize(dict["file_id_or_url"] ?? .null) + let sceneChangeThreshold = try Serialization._DoubleSerializer.deserialize(dict["scene_change_threshold"] ?? .number(0.0)) + let includeImages = try Serialization._BoolSerializer.deserialize(dict["include_images"] ?? .number(0)) + return GetKeyframesArgs(fileIdOrUrl: fileIdOrUrl, sceneChangeThreshold: sceneChangeThreshold, includeImages: includeImages) + default: + throw JSONSerializerError.deserializeError(type: GetKeyframesArgs.self, json: json) + } + } + } + + /// Result type for EventBus async check - must end in "CheckResult" + public enum GetKeyframesAsyncCheckResult: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case inProgress + /// An unspecified error. + case complete(Riviera.GetKeyframesResult) + /// An unspecified error. + case failed(Riviera.KeyframesExtractionApiV2Error) + /// An unspecified error. + case other + + func json() throws -> JSON { + try GetKeyframesAsyncCheckResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetKeyframesAsyncCheckResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetKeyframesAsyncCheckResult: \(error)" + } + } + } + + public class GetKeyframesAsyncCheckResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetKeyframesAsyncCheckResult) throws -> JSON { + switch value { + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Riviera.GetKeyframesResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Riviera.KeyframesExtractionApiV2ErrorSerializer().serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetKeyframesAsyncCheckResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return GetKeyframesAsyncCheckResult.inProgress + case "complete": + let v = try Riviera.GetKeyframesResultSerializer().deserialize(json) + return GetKeyframesAsyncCheckResult.complete(v) + case "failed": + let v = try Riviera.KeyframesExtractionApiV2ErrorSerializer().deserialize(d["failed"] ?? .null) + return GetKeyframesAsyncCheckResult.failed(v) + case "other": + return GetKeyframesAsyncCheckResult.other + default: + return GetKeyframesAsyncCheckResult.other + } + default: + throw JSONSerializerError.deserializeError(type: GetKeyframesAsyncCheckResult.self, json: json) + } + } + } + + /// The GetKeyframesResult struct + public class GetKeyframesResult: CustomStringConvertible, JSONRepresentable { + /// The extracted keyframes, ordered by `timestamp`. May be empty when no scene changes are detected in the + /// source. + public let frames: [Riviera.ApiKeyframe]? + public init(frames: [Riviera.ApiKeyframe]? = nil) { + self.frames = frames + } + + func json() throws -> JSON { + try GetKeyframesResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetKeyframesResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetKeyframesResult: \(error)" + } + } + } + + public class GetKeyframesResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetKeyframesResult) throws -> JSON { + let output = [ + "frames": try NullableSerializer(ArraySerializer(Riviera.ApiKeyframeSerializer())).serialize(value.frames), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> GetKeyframesResult { + switch json { + case .dictionary(let dict): + let frames = try NullableSerializer(ArraySerializer(Riviera.ApiKeyframeSerializer())).deserialize(dict["frames"] ?? .null) + return GetKeyframesResult(frames: frames) + default: + throw JSONSerializerError.deserializeError(type: GetKeyframesResult.self, json: json) + } + } + } + + /// Arguments for the asynchronous getMarkdownAsync route. Exactly one of fileId in FileIdOrUrl, path in + /// FileIdOrUrl, or url in FileIdOrUrl must be supplied via fileIdOrUrl in GetMarkdownArgs to identify the + /// document to convert to markdown. public class GetMarkdownArgs: CustomStringConvertible, JSONRepresentable { - /// Identifier of the document to convert. Callers must set exactly one of the `FileIdOrUrl` variants. The + /// Identifier of the document to convert. Callers must set exactly one of the FileIdOrUrl variants. The /// referenced file must be a document in a supported format (see the route description for the list); - /// requests against unsupported formats return `unsupported_format_error`. + /// requests against unsupported formats fail with userError in MarkdownConversionApiV2Error. public let fileIdOrUrl: Riviera.FileIdOrUrl? /// Enable OCR for PDF documents. Processing is slower when enabled. public let enableOcr: Bool @@ -1000,13 +1237,13 @@ public class Riviera { } } - /// Result type for EventBus async check + /// Status of a markdown conversion job started by getMarkdownAsync, as returned by getMarkdownAsyncCheck. public enum GetMarkdownAsyncCheckResult: CustomStringConvertible, JSONRepresentable { - /// An unspecified error. + /// The job has not finished yet. Poll again. case inProgress - /// An unspecified error. + /// The job finished successfully. case complete(Riviera.GetMarkdownResult) - /// An unspecified error. + /// The job finished unsuccessfully. case failed(Riviera.MarkdownConversionApiV2Error) /// An unspecified error. case other @@ -1073,7 +1310,7 @@ public class Riviera { /// The GetMarkdownResult struct public class GetMarkdownResult: CustomStringConvertible, JSONRepresentable { - /// The converted markdown content + /// The markdown the source document was converted to. public let markdown: String public init(markdown: String = "") { stringValidator()(markdown) @@ -1113,14 +1350,15 @@ public class Riviera { } } - /// Arguments for the asynchronous `get_metadata_async` route. Exactly one of `file_id`, `path`, or `url` must be - /// supplied via `file_id_or_url` to identify the file whose metadata should be extracted. + /// Arguments for the asynchronous getMetadataAsync route. Exactly one of fileId in FileIdOrUrl, path in + /// FileIdOrUrl, or url in FileIdOrUrl must be supplied via fileIdOrUrl in GetMetadataArgs to identify the file + /// whose metadata should be extracted. public class GetMetadataArgs: CustomStringConvertible, JSONRepresentable { - /// Identifier of the file to extract metadata from. Callers must set exactly one of the `FileIdOrUrl` variants. + /// Identifier of the file to extract metadata from. Callers must set exactly one of the FileIdOrUrl variants. /// The kind of metadata returned is determined by the file type: image files return EXIF metadata, /// audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents (docx, /// pptx, xlsx) return Office metadata. See the route description for the supported formats. Requests - /// against unsupported formats return `unsupported_format_error`. + /// against unsupported formats fail with userError in MetadataExtractionApiV2Error. public let fileIdOrUrl: Riviera.FileIdOrUrl? public init(fileIdOrUrl: Riviera.FileIdOrUrl? = nil) { self.fileIdOrUrl = fileIdOrUrl @@ -1159,13 +1397,13 @@ public class Riviera { } } - /// Result type for EventBus async check - must end in "CheckResult" + /// Status of a metadata extraction job started by getMetadataAsync, as returned by getMetadataAsyncCheck. public enum GetMetadataAsyncCheckResult: CustomStringConvertible, JSONRepresentable { - /// An unspecified error. + /// The job has not finished yet. Poll again. case inProgress - /// An unspecified error. + /// The job finished successfully. case complete(Riviera.GetMetadataResult) - /// An unspecified error. + /// The job finished unsuccessfully. case failed(Riviera.MetadataExtractionApiV2Error) /// An unspecified error. case other @@ -1232,8 +1470,8 @@ public class Riviera { /// The GetMetadataResult struct public class GetMetadataResult: CustomStringConvertible, JSONRepresentable { - /// The kind of metadata that was extracted for the requested file. Callers should read the matching field of - /// the `metadata` oneof. + /// The kind of metadata that was extracted for the requested file. Callers should read the matching variant of + /// metadata in GetMetadataResult. public let metadataType: Riviera.MetadataType /// (no description) public let metadata: Riviera.MetadataUnion? @@ -1279,123 +1517,92 @@ public class Riviera { } } - /// Arguments for the asynchronous `get_transcript_async` route. Exactly one of `file_id`, `path`, or `url` must be - /// supplied via `file_id_or_url` to identify the audio or video asset to transcribe. - public class GetTranscriptArgs: CustomStringConvertible, JSONRepresentable { - /// Identifier of the media asset to transcribe. Callers must set exactly one of the `FileIdOrUrl` variants. The - /// referenced asset must be an audio or video file in a supported format (see the route description for - /// the list); requests against files with no audio track return a `no_audio_error`. + /// Arguments for the asynchronous `get_ocr_async` route. Exactly one of `file_id`, `path`, or `url` must be + /// supplied via `file_id_or_url` to identify the image or PDF whose text should be extracted via OCR (optical + /// character recognition). + public class GetOcrArgs: CustomStringConvertible, JSONRepresentable { + /// Identifier of the file to run OCR on. Callers must set exactly one of the `FileIdOrUrl` variants. OCR is + /// supported for image files and PDFs, including scanned / non-text PDFs; see the route description for + /// the supported formats. Requests against unsupported formats return `unsupported_format_error`. NOTE: + /// for the `url` variant, only Dropbox shared links (www.dropbox.com) are supported. External + /// (non-Dropbox) URLs are not supported and return `unsupported_format_error`; import the file into + /// Dropbox and reference it by `file_id` or `path` instead. public let fileIdOrUrl: Riviera.FileIdOrUrl? - /// Granularity of the time offsets returned for each transcript segment. Defaults to `SENTENCE` when the field - /// is omitted. - SENTENCE: one segment per spoken sentence (recommended). - WORD: one segment per word, - /// useful for fine-grained alignment such as captioning or highlight-as-you-listen experiences. - public let timestampLevel: Riviera.TimestampLevel - /// Comma-delimited list of non-lexical filler words to preserve in the transcript output, e.g. `"uh, ah, uhm"`. - /// By default these fillers are stripped. Unrecognized tokens are ignored. Leave empty to use the - /// default filtering behavior. - public let includedSpecialWords: String - /// Optional ISO 639-1 two-letter language code hinting the spoken language of the source audio (e.g. "en", - /// "ja"). When empty, the service auto-detects the language; supplying a hint improves accuracy and - /// latency for short or ambiguous clips. Unsupported languages fall back to auto-detection. - public let audioLanguage: String - public init( - fileIdOrUrl: Riviera.FileIdOrUrl? = nil, - timestampLevel: Riviera.TimestampLevel = .sentence, - includedSpecialWords: String = "", - audioLanguage: String = "" - ) { + public init(fileIdOrUrl: Riviera.FileIdOrUrl? = nil) { self.fileIdOrUrl = fileIdOrUrl - self.timestampLevel = timestampLevel - stringValidator()(includedSpecialWords) - self.includedSpecialWords = includedSpecialWords - stringValidator()(audioLanguage) - self.audioLanguage = audioLanguage } func json() throws -> JSON { - try GetTranscriptArgsSerializer().serialize(self) + try GetOcrArgsSerializer().serialize(self) } public var description: String { do { - return "\(SerializeUtil.prepareJSONForSerialization(try GetTranscriptArgsSerializer().serialize(self)))" + return "\(SerializeUtil.prepareJSONForSerialization(try GetOcrArgsSerializer().serialize(self)))" } catch { - return "Failed to generate description for GetTranscriptArgs: \(error)" + return "Failed to generate description for GetOcrArgs: \(error)" } } } - public class GetTranscriptArgsSerializer: JSONSerializer { + public class GetOcrArgsSerializer: JSONSerializer { public init() {} - public func serialize(_ value: GetTranscriptArgs) throws -> JSON { + public func serialize(_ value: GetOcrArgs) throws -> JSON { let output = [ "file_id_or_url": try NullableSerializer(Riviera.FileIdOrUrlSerializer()).serialize(value.fileIdOrUrl), - "timestamp_level": try Riviera.TimestampLevelSerializer().serialize(value.timestampLevel), - "included_special_words": try Serialization._StringSerializer.serialize(value.includedSpecialWords), - "audio_language": try Serialization._StringSerializer.serialize(value.audioLanguage), ] return .dictionary(output) } - public func deserialize(_ json: JSON) throws -> GetTranscriptArgs { + public func deserialize(_ json: JSON) throws -> GetOcrArgs { switch json { case .dictionary(let dict): let fileIdOrUrl = try NullableSerializer(Riviera.FileIdOrUrlSerializer()).deserialize(dict["file_id_or_url"] ?? .null) - let timestampLevel = try Riviera.TimestampLevelSerializer().deserialize( - dict["timestamp_level"] ?? Riviera.TimestampLevelSerializer().serialize(.sentence) - ) - let includedSpecialWords = try Serialization._StringSerializer.deserialize(dict["included_special_words"] ?? .str("")) - let audioLanguage = try Serialization._StringSerializer.deserialize(dict["audio_language"] ?? .str("")) - return GetTranscriptArgs( - fileIdOrUrl: fileIdOrUrl, - timestampLevel: timestampLevel, - includedSpecialWords: includedSpecialWords, - audioLanguage: audioLanguage - ) + return GetOcrArgs(fileIdOrUrl: fileIdOrUrl) default: - throw JSONSerializerError.deserializeError(type: GetTranscriptArgs.self, json: json) + throw JSONSerializerError.deserializeError(type: GetOcrArgs.self, json: json) } } } /// Result type for EventBus async check - must end in "CheckResult" - public enum GetTranscriptAsyncCheckResult: CustomStringConvertible, JSONRepresentable { + public enum GetOcrAsyncCheckResult: CustomStringConvertible, JSONRepresentable { /// An unspecified error. case inProgress /// An unspecified error. - case complete(Riviera.GetTranscriptResult) + case complete(Riviera.GetOcrResult) /// An unspecified error. - case failed(Riviera.ContentApiV2Error) + case failed(Riviera.OcrExtractionApiV2Error) /// An unspecified error. case other func json() throws -> JSON { - try GetTranscriptAsyncCheckResultSerializer().serialize(self) + try GetOcrAsyncCheckResultSerializer().serialize(self) } public var description: String { do { - return "\(SerializeUtil.prepareJSONForSerialization(try GetTranscriptAsyncCheckResultSerializer().serialize(self)))" + return "\(SerializeUtil.prepareJSONForSerialization(try GetOcrAsyncCheckResultSerializer().serialize(self)))" } catch { - return "Failed to generate description for GetTranscriptAsyncCheckResult: \(error)" + return "Failed to generate description for GetOcrAsyncCheckResult: \(error)" } } } - public class GetTranscriptAsyncCheckResultSerializer: JSONSerializer { + public class GetOcrAsyncCheckResultSerializer: JSONSerializer { public init() {} - public func serialize(_ value: GetTranscriptAsyncCheckResult) throws -> JSON { + public func serialize(_ value: GetOcrAsyncCheckResult) throws -> JSON { switch value { case .inProgress: var d = [String: JSON]() d[".tag"] = .str("in_progress") return .dictionary(d) case .complete(let arg): - var d = try Serialization.getFields(Riviera.GetTranscriptResultSerializer().serialize(arg)) + var d = try Serialization.getFields(Riviera.GetOcrResultSerializer().serialize(arg)) d[".tag"] = .str("complete") return .dictionary(d) case .failed(let arg): - var d = try ["failed": Riviera.ContentApiV2ErrorSerializer().serialize(arg)] + var d = try ["failed": Riviera.OcrExtractionApiV2ErrorSerializer().serialize(arg)] d[".tag"] = .str("failed") return .dictionary(d) case .other: @@ -1405,93 +1612,586 @@ public class Riviera { } } - public func deserialize(_ json: JSON) throws -> GetTranscriptAsyncCheckResult { + public func deserialize(_ json: JSON) throws -> GetOcrAsyncCheckResult { switch json { case .dictionary(let d): let tag = try Serialization.getTag(d) switch tag { case "in_progress": - return GetTranscriptAsyncCheckResult.inProgress + return GetOcrAsyncCheckResult.inProgress case "complete": - let v = try Riviera.GetTranscriptResultSerializer().deserialize(json) - return GetTranscriptAsyncCheckResult.complete(v) + let v = try Riviera.GetOcrResultSerializer().deserialize(json) + return GetOcrAsyncCheckResult.complete(v) case "failed": - let v = try Riviera.ContentApiV2ErrorSerializer().deserialize(d["failed"] ?? .null) - return GetTranscriptAsyncCheckResult.failed(v) + let v = try Riviera.OcrExtractionApiV2ErrorSerializer().deserialize(d["failed"] ?? .null) + return GetOcrAsyncCheckResult.failed(v) case "other": - return GetTranscriptAsyncCheckResult.other + return GetOcrAsyncCheckResult.other default: - return GetTranscriptAsyncCheckResult.other + return GetOcrAsyncCheckResult.other } default: - throw JSONSerializerError.deserializeError(type: GetTranscriptAsyncCheckResult.self, json: json) + throw JSONSerializerError.deserializeError(type: GetOcrAsyncCheckResult.self, json: json) } } } - /// The GetTranscriptResult struct - public class GetTranscriptResult: CustomStringConvertible, JSONRepresentable { - /// The structured transcript produced for the requested media asset, with per-segment text, start/end offsets - /// (in seconds from the beginning of the media), and the detected or caller-supplied locale. - public let structuredTranscript: Riviera.ApiStructuredTranscript? - public init(structuredTranscript: Riviera.ApiStructuredTranscript? = nil) { - self.structuredTranscript = structuredTranscript + /// The GetOcrResult struct + public class GetOcrResult: CustomStringConvertible, JSONRepresentable { + /// The plain-text content extracted from the file via OCR. Words within a line are separated by a single space, + /// lines are newline-separated in reading order, and for multi-page PDFs pages are separated by a blank + /// line in page order. May be empty when no text is detected in the source. + public let text: String + /// The same content as hOCR: HTML that carries the position of every recognized word. Each page is a + /// `
` holding `

` elements with one `` per word, and each element carries + /// `data-x`, `data-y`, `data-width`, and `data-height` attributes in pixels relative to the upright + /// page (whose dimensions are on the `

`). Use this when you need word coordinates -- to + /// highlight matches over a page image, for example; use `text` when you just need the words. + public let hocr: String + public init(text: String = "", hocr: String = "") { + stringValidator()(text) + self.text = text + stringValidator()(hocr) + self.hocr = hocr } func json() throws -> JSON { - try GetTranscriptResultSerializer().serialize(self) + try GetOcrResultSerializer().serialize(self) } public var description: String { do { - return "\(SerializeUtil.prepareJSONForSerialization(try GetTranscriptResultSerializer().serialize(self)))" + return "\(SerializeUtil.prepareJSONForSerialization(try GetOcrResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetOcrResult: \(error)" + } + } + } + + public class GetOcrResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetOcrResult) throws -> JSON { + let output = [ + "text": try Serialization._StringSerializer.serialize(value.text), + "hocr": try Serialization._StringSerializer.serialize(value.hocr), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> GetOcrResult { + switch json { + case .dictionary(let dict): + let text = try Serialization._StringSerializer.deserialize(dict["text"] ?? .str("")) + let hocr = try Serialization._StringSerializer.deserialize(dict["hocr"] ?? .str("")) + return GetOcrResult(text: text, hocr: hocr) + default: + throw JSONSerializerError.deserializeError(type: GetOcrResult.self, json: json) + } + } + } + + /// Arguments for the asynchronous `get_text_async` route. Exactly one of `file_id`, `path`, or `url` must be + /// supplied via `file_id_or_url` to identify the document whose plain-text content should be extracted. + public class GetTextArgs: CustomStringConvertible, JSONRepresentable { + /// Identifier of the document to extract text from. Callers must set exactly one of the `FileIdOrUrl` variants. + /// Text extraction is supported for common document formats (Word, PowerPoint, Excel, PDF, RTF, and + /// Dropbox document types); see the route description for the supported formats. Requests against + /// unsupported formats return `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox + /// shared links (www.dropbox.com) are supported. External (non-Dropbox) URLs are not supported and + /// return `unsupported_format_error`; import the file into Dropbox and reference it by `file_id` or + /// `path` instead. + public let fileIdOrUrl: Riviera.FileIdOrUrl? + public init(fileIdOrUrl: Riviera.FileIdOrUrl? = nil) { + self.fileIdOrUrl = fileIdOrUrl + } + + func json() throws -> JSON { + try GetTextArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTextArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTextArgs: \(error)" + } + } + } + + public class GetTextArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTextArgs) throws -> JSON { + let output = [ + "file_id_or_url": try NullableSerializer(Riviera.FileIdOrUrlSerializer()).serialize(value.fileIdOrUrl), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> GetTextArgs { + switch json { + case .dictionary(let dict): + let fileIdOrUrl = try NullableSerializer(Riviera.FileIdOrUrlSerializer()).deserialize(dict["file_id_or_url"] ?? .null) + return GetTextArgs(fileIdOrUrl: fileIdOrUrl) + default: + throw JSONSerializerError.deserializeError(type: GetTextArgs.self, json: json) + } + } + } + + /// Result type for EventBus async check - must end in "CheckResult" + public enum GetTextAsyncCheckResult: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case inProgress + /// An unspecified error. + case complete(Riviera.GetTextResult) + /// An unspecified error. + case failed(Riviera.TextExtractionApiV2Error) + /// An unspecified error. + case other + + func json() throws -> JSON { + try GetTextAsyncCheckResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTextAsyncCheckResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTextAsyncCheckResult: \(error)" + } + } + } + + public class GetTextAsyncCheckResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTextAsyncCheckResult) throws -> JSON { + switch value { + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Riviera.GetTextResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Riviera.TextExtractionApiV2ErrorSerializer().serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetTextAsyncCheckResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return GetTextAsyncCheckResult.inProgress + case "complete": + let v = try Riviera.GetTextResultSerializer().deserialize(json) + return GetTextAsyncCheckResult.complete(v) + case "failed": + let v = try Riviera.TextExtractionApiV2ErrorSerializer().deserialize(d["failed"] ?? .null) + return GetTextAsyncCheckResult.failed(v) + case "other": + return GetTextAsyncCheckResult.other + default: + return GetTextAsyncCheckResult.other + } + default: + throw JSONSerializerError.deserializeError(type: GetTextAsyncCheckResult.self, json: json) + } + } + } + + /// The GetTextResult struct + public class GetTextResult: CustomStringConvertible, JSONRepresentable { + /// The plain-text content extracted from the document. For multi-page documents the text is concatenated in + /// document order. May be empty when no text is detected in the source. + public let text: String + public init(text: String = "") { + stringValidator()(text) + self.text = text + } + + func json() throws -> JSON { + try GetTextResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTextResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTextResult: \(error)" + } + } + } + + public class GetTextResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTextResult) throws -> JSON { + let output = [ + "text": try Serialization._StringSerializer.serialize(value.text), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> GetTextResult { + switch json { + case .dictionary(let dict): + let text = try Serialization._StringSerializer.deserialize(dict["text"] ?? .str("")) + return GetTextResult(text: text) + default: + throw JSONSerializerError.deserializeError(type: GetTextResult.self, json: json) + } + } + } + + /// Arguments for the asynchronous getTranscriptAsync route. Exactly one of fileId in FileIdOrUrl, path in + /// FileIdOrUrl, or url in FileIdOrUrl must be supplied via fileIdOrUrl in GetTranscriptArgs to identify the + /// audio or video asset to transcribe. + public class GetTranscriptArgs: CustomStringConvertible, JSONRepresentable { + /// Identifier of the media asset to transcribe. Callers must set exactly one of the FileIdOrUrl variants. The + /// referenced asset must be an audio or video file in a supported format (see the route description for + /// the list); requests against files with no audio track fail with noAudioError in ContentApiV2Error. + public let fileIdOrUrl: Riviera.FileIdOrUrl? + /// Granularity of the time offsets returned for each transcript segment. Defaults to sentence in TimestampLevel + /// when the field is omitted. + public let timestampLevel: Riviera.TimestampLevel + /// Comma-delimited list of non-lexical filler words to preserve in the transcript output, e.g. `"uh, ah, uhm"`. + /// By default these fillers are stripped. Unrecognized tokens are ignored. Leave empty to use the + /// default filtering behavior. + public let includedSpecialWords: String + /// Hint for the spoken language of the source audio, as an ISO 639-1 code (e.g. "en", "ja"). When empty, the + /// service auto-detects the language; supplying a hint improves accuracy and latency for short or + /// ambiguous clips. Languages the service does not support fall back to auto-detection. + public let audioLanguage: String + public init( + fileIdOrUrl: Riviera.FileIdOrUrl? = nil, + timestampLevel: Riviera.TimestampLevel = .sentence, + includedSpecialWords: String = "", + audioLanguage: String = "" + ) { + self.fileIdOrUrl = fileIdOrUrl + self.timestampLevel = timestampLevel + stringValidator()(includedSpecialWords) + self.includedSpecialWords = includedSpecialWords + stringValidator()(audioLanguage) + self.audioLanguage = audioLanguage + } + + func json() throws -> JSON { + try GetTranscriptArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTranscriptArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTranscriptArgs: \(error)" + } + } + } + + public class GetTranscriptArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTranscriptArgs) throws -> JSON { + let output = [ + "file_id_or_url": try NullableSerializer(Riviera.FileIdOrUrlSerializer()).serialize(value.fileIdOrUrl), + "timestamp_level": try Riviera.TimestampLevelSerializer().serialize(value.timestampLevel), + "included_special_words": try Serialization._StringSerializer.serialize(value.includedSpecialWords), + "audio_language": try Serialization._StringSerializer.serialize(value.audioLanguage), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> GetTranscriptArgs { + switch json { + case .dictionary(let dict): + let fileIdOrUrl = try NullableSerializer(Riviera.FileIdOrUrlSerializer()).deserialize(dict["file_id_or_url"] ?? .null) + let timestampLevel = try Riviera.TimestampLevelSerializer().deserialize( + dict["timestamp_level"] ?? Riviera.TimestampLevelSerializer().serialize(.sentence) + ) + let includedSpecialWords = try Serialization._StringSerializer.deserialize(dict["included_special_words"] ?? .str("")) + let audioLanguage = try Serialization._StringSerializer.deserialize(dict["audio_language"] ?? .str("")) + return GetTranscriptArgs( + fileIdOrUrl: fileIdOrUrl, + timestampLevel: timestampLevel, + includedSpecialWords: includedSpecialWords, + audioLanguage: audioLanguage + ) + default: + throw JSONSerializerError.deserializeError(type: GetTranscriptArgs.self, json: json) + } + } + } + + /// Status of a transcript job started by getTranscriptAsync, as returned by getTranscriptAsyncCheck. + public enum GetTranscriptAsyncCheckResult: CustomStringConvertible, JSONRepresentable { + /// The job has not finished yet. Poll again. + case inProgress + /// The job finished successfully. + case complete(Riviera.GetTranscriptResult) + /// The job finished unsuccessfully. + case failed(Riviera.ContentApiV2Error) + /// An unspecified error. + case other + + func json() throws -> JSON { + try GetTranscriptAsyncCheckResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTranscriptAsyncCheckResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetTranscriptAsyncCheckResult: \(error)" + } + } + } + + public class GetTranscriptAsyncCheckResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTranscriptAsyncCheckResult) throws -> JSON { + switch value { + case .inProgress: + var d = [String: JSON]() + d[".tag"] = .str("in_progress") + return .dictionary(d) + case .complete(let arg): + var d = try Serialization.getFields(Riviera.GetTranscriptResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Riviera.ContentApiV2ErrorSerializer().serialize(arg)] + d[".tag"] = .str("failed") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> GetTranscriptAsyncCheckResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return GetTranscriptAsyncCheckResult.inProgress + case "complete": + let v = try Riviera.GetTranscriptResultSerializer().deserialize(json) + return GetTranscriptAsyncCheckResult.complete(v) + case "failed": + let v = try Riviera.ContentApiV2ErrorSerializer().deserialize(d["failed"] ?? .null) + return GetTranscriptAsyncCheckResult.failed(v) + case "other": + return GetTranscriptAsyncCheckResult.other + default: + return GetTranscriptAsyncCheckResult.other + } + default: + throw JSONSerializerError.deserializeError(type: GetTranscriptAsyncCheckResult.self, json: json) + } + } + } + + /// The GetTranscriptResult struct + public class GetTranscriptResult: CustomStringConvertible, JSONRepresentable { + /// The transcript produced for the requested media asset. + public let structuredTranscript: Riviera.ApiStructuredTranscript? + public init(structuredTranscript: Riviera.ApiStructuredTranscript? = nil) { + self.structuredTranscript = structuredTranscript + } + + func json() throws -> JSON { + try GetTranscriptResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetTranscriptResultSerializer().serialize(self)))" } catch { return "Failed to generate description for GetTranscriptResult: \(error)" } } - } - - public class GetTranscriptResultSerializer: JSONSerializer { - public init() {} - public func serialize(_ value: GetTranscriptResult) throws -> JSON { - let output = [ - "structured_transcript": try NullableSerializer(Riviera.ApiStructuredTranscriptSerializer()).serialize(value.structuredTranscript), - ] - return .dictionary(output) - } + } + + public class GetTranscriptResultSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetTranscriptResult) throws -> JSON { + let output = [ + "structured_transcript": try NullableSerializer(Riviera.ApiStructuredTranscriptSerializer()).serialize(value.structuredTranscript), + ] + return .dictionary(output) + } + + public func deserialize(_ json: JSON) throws -> GetTranscriptResult { + switch json { + case .dictionary(let dict): + let structuredTranscript = try NullableSerializer(Riviera.ApiStructuredTranscriptSerializer()).deserialize( + dict["structured_transcript"] ?? .null + ) + return GetTranscriptResult(structuredTranscript: structuredTranscript) + default: + throw JSONSerializerError.deserializeError(type: GetTranscriptResult.self, json: json) + } + } + } + + /// Reason a keyframe extraction job failed. Returned in the `failed` variant of `GetKeyframesAsyncCheckResult`. + /// This is a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that + /// surfaces a failed job is still a normal successful poll response). Callers should branch on the variant. + public enum KeyframesExtractionApiV2Error: CustomStringConvertible, JSONRepresentable { + /// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying + /// with backoff may succeed. + case serverError(String) + /// The request could not be processed as supplied (a problem with the caller's input). The string is a + /// human-readable message; retrying the same request will not help. + case userError(String) + /// The source file is not in a format this route supports. + case unsupportedFormatError + /// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. + case linkDownloadDisabledError + /// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, + /// so such links cannot be processed. + case sharedLinkPasswordProtected + /// The request exceeded a service limit -- for example the source video is too large, or the extraction + /// produced more keyframes / more total image data than the response can carry. Lower the resolution, + /// raise `scene_change_threshold`, or set `include_images = false`. + case limitExceededError + /// The source file was readable but could not be processed, for example because it is corrupt. + case conversionFailureError + /// The referenced file does not exist or is not accessible. + case notFoundError + /// The target is a folder, not a file. + case isAFolderError + /// An unspecified error. + case other + + func json() throws -> JSON { + try KeyframesExtractionApiV2ErrorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try KeyframesExtractionApiV2ErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for KeyframesExtractionApiV2Error: \(error)" + } + } + } + + public class KeyframesExtractionApiV2ErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: KeyframesExtractionApiV2Error) throws -> JSON { + switch value { + case .serverError(let arg): + var d = try ["server_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("server_error") + return .dictionary(d) + case .userError(let arg): + var d = try ["user_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .unsupportedFormatError: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_format_error") + return .dictionary(d) + case .linkDownloadDisabledError: + var d = [String: JSON]() + d[".tag"] = .str("link_download_disabled_error") + return .dictionary(d) + case .sharedLinkPasswordProtected: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_password_protected") + return .dictionary(d) + case .limitExceededError: + var d = [String: JSON]() + d[".tag"] = .str("limit_exceeded_error") + return .dictionary(d) + case .conversionFailureError: + var d = [String: JSON]() + d[".tag"] = .str("conversion_failure_error") + return .dictionary(d) + case .notFoundError: + var d = [String: JSON]() + d[".tag"] = .str("not_found_error") + return .dictionary(d) + case .isAFolderError: + var d = [String: JSON]() + d[".tag"] = .str("is_a_folder_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } - public func deserialize(_ json: JSON) throws -> GetTranscriptResult { + public func deserialize(_ json: JSON) throws -> KeyframesExtractionApiV2Error { switch json { - case .dictionary(let dict): - let structuredTranscript = try NullableSerializer(Riviera.ApiStructuredTranscriptSerializer()).deserialize( - dict["structured_transcript"] ?? .null - ) - return GetTranscriptResult(structuredTranscript: structuredTranscript) + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "server_error": + let v = try Serialization._StringSerializer.deserialize(d["server_error"] ?? .null) + return KeyframesExtractionApiV2Error.serverError(v) + case "user_error": + let v = try Serialization._StringSerializer.deserialize(d["user_error"] ?? .null) + return KeyframesExtractionApiV2Error.userError(v) + case "unsupported_format_error": + return KeyframesExtractionApiV2Error.unsupportedFormatError + case "link_download_disabled_error": + return KeyframesExtractionApiV2Error.linkDownloadDisabledError + case "shared_link_password_protected": + return KeyframesExtractionApiV2Error.sharedLinkPasswordProtected + case "limit_exceeded_error": + return KeyframesExtractionApiV2Error.limitExceededError + case "conversion_failure_error": + return KeyframesExtractionApiV2Error.conversionFailureError + case "not_found_error": + return KeyframesExtractionApiV2Error.notFoundError + case "is_a_folder_error": + return KeyframesExtractionApiV2Error.isAFolderError + case "other": + return KeyframesExtractionApiV2Error.other + default: + return KeyframesExtractionApiV2Error.other + } default: - throw JSONSerializerError.deserializeError(type: GetTranscriptResult.self, json: json) + throw JSONSerializerError.deserializeError(type: KeyframesExtractionApiV2Error.self, json: json) } } } - /// Reason a markdown conversion job failed. Returned in the `failed` variant of `GetMarkdownAsyncCheckResult`. This - /// is a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a + /// Reason a markdown conversion job failed. Returned in the failed in GetMarkdownAsyncCheckResult variant. This is + /// a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a /// failed job is still a normal successful poll response). Callers should branch on the variant. public enum MarkdownConversionApiV2Error: CustomStringConvertible, JSONRepresentable { /// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying /// with backoff may succeed. case serverError(String) - /// The request could not be processed as supplied (a problem with the caller's input). The string is a - /// human-readable message; retrying the same request will not help. + /// The request could not be processed as supplied (a problem with the caller's input) -- for example an + /// unsupported file format or a file over the size limit. The string is a human-readable message; + /// retrying the same request will not help. case userError(String) - /// An unspecified error. + /// The source file is not in a format this route can convert. case unsupportedFormatError - /// An unspecified error. + /// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. case linkDownloadDisabledError - /// An unspecified error. + /// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, + /// so such links cannot be converted. case sharedLinkPasswordProtected - /// An unspecified error. + /// A resource limit was exceeded while producing the result. case limitExceededError - /// An unspecified error. + /// The source file was readable but could not be converted, for example because it is corrupt. case conversionFailureError /// The referenced file does not exist or is not accessible. case notFoundError @@ -1598,7 +2298,7 @@ public class Riviera { /// The MediaDurationError struct public class MediaDurationError: CustomStringConvertible, JSONRepresentable { - /// (no description) + /// The maximum supported duration, in seconds, of the audio to transcribe. public let limit: Int32 public init(limit: Int32 = 0) { comparableValidator()(limit) @@ -1638,25 +2338,241 @@ public class Riviera { } } - /// Reason a metadata extraction job failed. Returned in the `failed` variant of `GetMetadataAsyncCheckResult`. This - /// is a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a + /// Reason a metadata extraction job failed. Returned in the failed in GetMetadataAsyncCheckResult variant. This is + /// a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a + /// failed job is still a normal successful poll response). Callers should branch on the variant. + public enum MetadataExtractionApiV2Error: CustomStringConvertible, JSONRepresentable { + /// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying + /// with backoff may succeed. + case serverError(String) + /// The request could not be processed as supplied (a problem with the caller's input) -- for example an + /// unsupported file format or a file over the size limit for its metadata kind. The string is a + /// human-readable message; retrying the same request will not help. + case userError(String) + /// The source file is not in a format this route can extract metadata from. + case unsupportedFormatError + /// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. + case linkDownloadDisabledError + /// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, + /// so metadata cannot be extracted from such links. + case sharedLinkPasswordProtected + /// A resource limit was exceeded while producing the result. + case limitExceededError + /// The source file was readable but its metadata could not be extracted, for example because the file is + /// corrupt. + case conversionFailureError + /// The referenced file does not exist or is not accessible. + case notFoundError + /// The target is a folder, not a file. + case isAFolderError + /// An unspecified error. + case other + + func json() throws -> JSON { + try MetadataExtractionApiV2ErrorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MetadataExtractionApiV2ErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MetadataExtractionApiV2Error: \(error)" + } + } + } + + public class MetadataExtractionApiV2ErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MetadataExtractionApiV2Error) throws -> JSON { + switch value { + case .serverError(let arg): + var d = try ["server_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("server_error") + return .dictionary(d) + case .userError(let arg): + var d = try ["user_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .unsupportedFormatError: + var d = [String: JSON]() + d[".tag"] = .str("unsupported_format_error") + return .dictionary(d) + case .linkDownloadDisabledError: + var d = [String: JSON]() + d[".tag"] = .str("link_download_disabled_error") + return .dictionary(d) + case .sharedLinkPasswordProtected: + var d = [String: JSON]() + d[".tag"] = .str("shared_link_password_protected") + return .dictionary(d) + case .limitExceededError: + var d = [String: JSON]() + d[".tag"] = .str("limit_exceeded_error") + return .dictionary(d) + case .conversionFailureError: + var d = [String: JSON]() + d[".tag"] = .str("conversion_failure_error") + return .dictionary(d) + case .notFoundError: + var d = [String: JSON]() + d[".tag"] = .str("not_found_error") + return .dictionary(d) + case .isAFolderError: + var d = [String: JSON]() + d[".tag"] = .str("is_a_folder_error") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MetadataExtractionApiV2Error { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "server_error": + let v = try Serialization._StringSerializer.deserialize(d["server_error"] ?? .null) + return MetadataExtractionApiV2Error.serverError(v) + case "user_error": + let v = try Serialization._StringSerializer.deserialize(d["user_error"] ?? .null) + return MetadataExtractionApiV2Error.userError(v) + case "unsupported_format_error": + return MetadataExtractionApiV2Error.unsupportedFormatError + case "link_download_disabled_error": + return MetadataExtractionApiV2Error.linkDownloadDisabledError + case "shared_link_password_protected": + return MetadataExtractionApiV2Error.sharedLinkPasswordProtected + case "limit_exceeded_error": + return MetadataExtractionApiV2Error.limitExceededError + case "conversion_failure_error": + return MetadataExtractionApiV2Error.conversionFailureError + case "not_found_error": + return MetadataExtractionApiV2Error.notFoundError + case "is_a_folder_error": + return MetadataExtractionApiV2Error.isAFolderError + case "other": + return MetadataExtractionApiV2Error.other + default: + return MetadataExtractionApiV2Error.other + } + default: + throw JSONSerializerError.deserializeError(type: MetadataExtractionApiV2Error.self, json: json) + } + } + } + + /// Which metadata variant is populated in a GetMetadataResult, derived from the file type. + public enum MetadataType: CustomStringConvertible, JSONRepresentable { + /// No metadata kind applies to the file, so no variant of metadata in GetMetadataResult is populated. Riviera + /// only produces metadata for the formats listed on getMetadataAsync; a request for any other file + /// normally fails with userError in MetadataExtractionApiV2Error rather than completing with this + /// value. An app that does receive it should treat the file as having no extractable metadata; retrying + /// will not change the outcome. + case metadataTypeUnknown + /// exif in MetadataUnion is populated. + case metadataTypeExif + /// media in MetadataUnion is populated. + case metadataTypeMedia + /// pdf in MetadataUnion is populated. + case metadataTypePdf + /// office in MetadataUnion is populated. + case metadataTypeOffice + /// An unspecified error. + case other + + func json() throws -> JSON { + try MetadataTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try MetadataTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for MetadataType: \(error)" + } + } + } + + public class MetadataTypeSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: MetadataType) throws -> JSON { + switch value { + case .metadataTypeUnknown: + var d = [String: JSON]() + d[".tag"] = .str("metadata_type_unknown") + return .dictionary(d) + case .metadataTypeExif: + var d = [String: JSON]() + d[".tag"] = .str("metadata_type_exif") + return .dictionary(d) + case .metadataTypeMedia: + var d = [String: JSON]() + d[".tag"] = .str("metadata_type_media") + return .dictionary(d) + case .metadataTypePdf: + var d = [String: JSON]() + d[".tag"] = .str("metadata_type_pdf") + return .dictionary(d) + case .metadataTypeOffice: + var d = [String: JSON]() + d[".tag"] = .str("metadata_type_office") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + + public func deserialize(_ json: JSON) throws -> MetadataType { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "metadata_type_unknown": + return MetadataType.metadataTypeUnknown + case "metadata_type_exif": + return MetadataType.metadataTypeExif + case "metadata_type_media": + return MetadataType.metadataTypeMedia + case "metadata_type_pdf": + return MetadataType.metadataTypePdf + case "metadata_type_office": + return MetadataType.metadataTypeOffice + case "other": + return MetadataType.other + default: + return MetadataType.other + } + default: + throw JSONSerializerError.deserializeError(type: MetadataType.self, json: json) + } + } + } + + /// Reason an OCR extraction job failed. Returned in the `failed` variant of `GetOcrAsyncCheckResult`. This is a + /// semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a /// failed job is still a normal successful poll response). Callers should branch on the variant. - public enum MetadataExtractionApiV2Error: CustomStringConvertible, JSONRepresentable { + public enum OcrExtractionApiV2Error: CustomStringConvertible, JSONRepresentable { /// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying /// with backoff may succeed. case serverError(String) /// The request could not be processed as supplied (a problem with the caller's input). The string is a /// human-readable message; retrying the same request will not help. case userError(String) - /// An unspecified error. + /// The source file is not in a format this route supports. case unsupportedFormatError - /// An unspecified error. + /// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. case linkDownloadDisabledError - /// An unspecified error. + /// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, + /// so such links cannot be processed. case sharedLinkPasswordProtected - /// An unspecified error. + /// A resource limit was exceeded while producing the result. case limitExceededError - /// An unspecified error. + /// The source file was readable but could not be processed, for example because it is corrupt. case conversionFailureError /// The referenced file does not exist or is not accessible. case notFoundError @@ -1666,21 +2582,21 @@ public class Riviera { case other func json() throws -> JSON { - try MetadataExtractionApiV2ErrorSerializer().serialize(self) + try OcrExtractionApiV2ErrorSerializer().serialize(self) } public var description: String { do { - return "\(SerializeUtil.prepareJSONForSerialization(try MetadataExtractionApiV2ErrorSerializer().serialize(self)))" + return "\(SerializeUtil.prepareJSONForSerialization(try OcrExtractionApiV2ErrorSerializer().serialize(self)))" } catch { - return "Failed to generate description for MetadataExtractionApiV2Error: \(error)" + return "Failed to generate description for OcrExtractionApiV2Error: \(error)" } } } - public class MetadataExtractionApiV2ErrorSerializer: JSONSerializer { + public class OcrExtractionApiV2ErrorSerializer: JSONSerializer { public init() {} - public func serialize(_ value: MetadataExtractionApiV2Error) throws -> JSON { + public func serialize(_ value: OcrExtractionApiV2Error) throws -> JSON { switch value { case .serverError(let arg): var d = try ["server_error": Serialization._StringSerializer.serialize(arg)] @@ -1725,93 +2641,87 @@ public class Riviera { } } - public func deserialize(_ json: JSON) throws -> MetadataExtractionApiV2Error { + public func deserialize(_ json: JSON) throws -> OcrExtractionApiV2Error { switch json { case .dictionary(let d): let tag = try Serialization.getTag(d) switch tag { case "server_error": let v = try Serialization._StringSerializer.deserialize(d["server_error"] ?? .null) - return MetadataExtractionApiV2Error.serverError(v) + return OcrExtractionApiV2Error.serverError(v) case "user_error": let v = try Serialization._StringSerializer.deserialize(d["user_error"] ?? .null) - return MetadataExtractionApiV2Error.userError(v) + return OcrExtractionApiV2Error.userError(v) case "unsupported_format_error": - return MetadataExtractionApiV2Error.unsupportedFormatError + return OcrExtractionApiV2Error.unsupportedFormatError case "link_download_disabled_error": - return MetadataExtractionApiV2Error.linkDownloadDisabledError + return OcrExtractionApiV2Error.linkDownloadDisabledError case "shared_link_password_protected": - return MetadataExtractionApiV2Error.sharedLinkPasswordProtected + return OcrExtractionApiV2Error.sharedLinkPasswordProtected case "limit_exceeded_error": - return MetadataExtractionApiV2Error.limitExceededError + return OcrExtractionApiV2Error.limitExceededError case "conversion_failure_error": - return MetadataExtractionApiV2Error.conversionFailureError + return OcrExtractionApiV2Error.conversionFailureError case "not_found_error": - return MetadataExtractionApiV2Error.notFoundError + return OcrExtractionApiV2Error.notFoundError case "is_a_folder_error": - return MetadataExtractionApiV2Error.isAFolderError + return OcrExtractionApiV2Error.isAFolderError case "other": - return MetadataExtractionApiV2Error.other + return OcrExtractionApiV2Error.other default: - return MetadataExtractionApiV2Error.other + return OcrExtractionApiV2Error.other } default: - throw JSONSerializerError.deserializeError(type: MetadataExtractionApiV2Error.self, json: json) + throw JSONSerializerError.deserializeError(type: OcrExtractionApiV2Error.self, json: json) } } } - /// Which metadata variant is populated in a `GetMetadataResult`, derived from the file type. - public enum MetadataType: CustomStringConvertible, JSONRepresentable { - /// An unspecified error. - case metadataTypeUnknown + /// The kind of MS Office document that produced an ApiOfficeMetadata result. + public enum OfficeFileType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. - case metadataTypeExif + case officeFiletypeUnknown /// An unspecified error. - case metadataTypeMedia + case officeFiletypeWord /// An unspecified error. - case metadataTypePdf + case officeFiletypePowerpoint /// An unspecified error. - case metadataTypeOffice + case officeFiletypeExcel /// An unspecified error. case other func json() throws -> JSON { - try MetadataTypeSerializer().serialize(self) + try OfficeFileTypeSerializer().serialize(self) } public var description: String { do { - return "\(SerializeUtil.prepareJSONForSerialization(try MetadataTypeSerializer().serialize(self)))" + return "\(SerializeUtil.prepareJSONForSerialization(try OfficeFileTypeSerializer().serialize(self)))" } catch { - return "Failed to generate description for MetadataType: \(error)" + return "Failed to generate description for OfficeFileType: \(error)" } } } - public class MetadataTypeSerializer: JSONSerializer { + public class OfficeFileTypeSerializer: JSONSerializer { public init() {} - public func serialize(_ value: MetadataType) throws -> JSON { + public func serialize(_ value: OfficeFileType) throws -> JSON { switch value { - case .metadataTypeUnknown: - var d = [String: JSON]() - d[".tag"] = .str("metadata_type_unknown") - return .dictionary(d) - case .metadataTypeExif: + case .officeFiletypeUnknown: var d = [String: JSON]() - d[".tag"] = .str("metadata_type_exif") + d[".tag"] = .str("office_filetype_unknown") return .dictionary(d) - case .metadataTypeMedia: + case .officeFiletypeWord: var d = [String: JSON]() - d[".tag"] = .str("metadata_type_media") + d[".tag"] = .str("office_filetype_word") return .dictionary(d) - case .metadataTypePdf: + case .officeFiletypePowerpoint: var d = [String: JSON]() - d[".tag"] = .str("metadata_type_pdf") + d[".tag"] = .str("office_filetype_powerpoint") return .dictionary(d) - case .metadataTypeOffice: + case .officeFiletypeExcel: var d = [String: JSON]() - d[".tag"] = .str("metadata_type_office") + d[".tag"] = .str("office_filetype_excel") return .dictionary(d) case .other: var d = [String: JSON]() @@ -1820,77 +2730,110 @@ public class Riviera { } } - public func deserialize(_ json: JSON) throws -> MetadataType { + public func deserialize(_ json: JSON) throws -> OfficeFileType { switch json { case .dictionary(let d): let tag = try Serialization.getTag(d) switch tag { - case "metadata_type_unknown": - return MetadataType.metadataTypeUnknown - case "metadata_type_exif": - return MetadataType.metadataTypeExif - case "metadata_type_media": - return MetadataType.metadataTypeMedia - case "metadata_type_pdf": - return MetadataType.metadataTypePdf - case "metadata_type_office": - return MetadataType.metadataTypeOffice + case "office_filetype_unknown": + return OfficeFileType.officeFiletypeUnknown + case "office_filetype_word": + return OfficeFileType.officeFiletypeWord + case "office_filetype_powerpoint": + return OfficeFileType.officeFiletypePowerpoint + case "office_filetype_excel": + return OfficeFileType.officeFiletypeExcel case "other": - return MetadataType.other + return OfficeFileType.other default: - return MetadataType.other + return OfficeFileType.other } default: - throw JSONSerializerError.deserializeError(type: MetadataType.self, json: json) + throw JSONSerializerError.deserializeError(type: OfficeFileType.self, json: json) } } } - /// The kind of MS Office document that produced an `ApiOfficeMetadata` result. - public enum OfficeFileType: CustomStringConvertible, JSONRepresentable { - /// An unspecified error. - case officeFiletypeUnknown - /// An unspecified error. - case officeFiletypeWord - /// An unspecified error. - case officeFiletypePowerpoint - /// An unspecified error. - case officeFiletypeExcel + /// Reason a text extraction job failed. Returned in the `failed` variant of `GetTextAsyncCheckResult`. This is a + /// semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a + /// failed job is still a normal successful poll response). Callers should branch on the variant. + public enum TextExtractionApiV2Error: CustomStringConvertible, JSONRepresentable { + /// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying + /// with backoff may succeed. + case serverError(String) + /// The request could not be processed as supplied (a problem with the caller's input). The string is a + /// human-readable message; retrying the same request will not help. + case userError(String) + /// The source file is not in a format this route supports. + case unsupportedFormatError + /// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. + case linkDownloadDisabledError + /// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, + /// so such links cannot be processed. + case sharedLinkPasswordProtected + /// A resource limit was exceeded while producing the result. + case limitExceededError + /// The source file was readable but could not be processed, for example because it is corrupt. + case conversionFailureError + /// The referenced file does not exist or is not accessible. + case notFoundError + /// The target is a folder, not a file. + case isAFolderError /// An unspecified error. case other func json() throws -> JSON { - try OfficeFileTypeSerializer().serialize(self) + try TextExtractionApiV2ErrorSerializer().serialize(self) } public var description: String { do { - return "\(SerializeUtil.prepareJSONForSerialization(try OfficeFileTypeSerializer().serialize(self)))" + return "\(SerializeUtil.prepareJSONForSerialization(try TextExtractionApiV2ErrorSerializer().serialize(self)))" } catch { - return "Failed to generate description for OfficeFileType: \(error)" + return "Failed to generate description for TextExtractionApiV2Error: \(error)" } } } - public class OfficeFileTypeSerializer: JSONSerializer { + public class TextExtractionApiV2ErrorSerializer: JSONSerializer { public init() {} - public func serialize(_ value: OfficeFileType) throws -> JSON { + public func serialize(_ value: TextExtractionApiV2Error) throws -> JSON { switch value { - case .officeFiletypeUnknown: + case .serverError(let arg): + var d = try ["server_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("server_error") + return .dictionary(d) + case .userError(let arg): + var d = try ["user_error": Serialization._StringSerializer.serialize(arg)] + d[".tag"] = .str("user_error") + return .dictionary(d) + case .unsupportedFormatError: var d = [String: JSON]() - d[".tag"] = .str("office_filetype_unknown") + d[".tag"] = .str("unsupported_format_error") return .dictionary(d) - case .officeFiletypeWord: + case .linkDownloadDisabledError: var d = [String: JSON]() - d[".tag"] = .str("office_filetype_word") + d[".tag"] = .str("link_download_disabled_error") return .dictionary(d) - case .officeFiletypePowerpoint: + case .sharedLinkPasswordProtected: var d = [String: JSON]() - d[".tag"] = .str("office_filetype_powerpoint") + d[".tag"] = .str("shared_link_password_protected") return .dictionary(d) - case .officeFiletypeExcel: + case .limitExceededError: var d = [String: JSON]() - d[".tag"] = .str("office_filetype_excel") + d[".tag"] = .str("limit_exceeded_error") + return .dictionary(d) + case .conversionFailureError: + var d = [String: JSON]() + d[".tag"] = .str("conversion_failure_error") + return .dictionary(d) + case .notFoundError: + var d = [String: JSON]() + d[".tag"] = .str("not_found_error") + return .dictionary(d) + case .isAFolderError: + var d = [String: JSON]() + d[".tag"] = .str("is_a_folder_error") return .dictionary(d) case .other: var d = [String: JSON]() @@ -1899,35 +2842,49 @@ public class Riviera { } } - public func deserialize(_ json: JSON) throws -> OfficeFileType { + public func deserialize(_ json: JSON) throws -> TextExtractionApiV2Error { switch json { case .dictionary(let d): let tag = try Serialization.getTag(d) switch tag { - case "office_filetype_unknown": - return OfficeFileType.officeFiletypeUnknown - case "office_filetype_word": - return OfficeFileType.officeFiletypeWord - case "office_filetype_powerpoint": - return OfficeFileType.officeFiletypePowerpoint - case "office_filetype_excel": - return OfficeFileType.officeFiletypeExcel + case "server_error": + let v = try Serialization._StringSerializer.deserialize(d["server_error"] ?? .null) + return TextExtractionApiV2Error.serverError(v) + case "user_error": + let v = try Serialization._StringSerializer.deserialize(d["user_error"] ?? .null) + return TextExtractionApiV2Error.userError(v) + case "unsupported_format_error": + return TextExtractionApiV2Error.unsupportedFormatError + case "link_download_disabled_error": + return TextExtractionApiV2Error.linkDownloadDisabledError + case "shared_link_password_protected": + return TextExtractionApiV2Error.sharedLinkPasswordProtected + case "limit_exceeded_error": + return TextExtractionApiV2Error.limitExceededError + case "conversion_failure_error": + return TextExtractionApiV2Error.conversionFailureError + case "not_found_error": + return TextExtractionApiV2Error.notFoundError + case "is_a_folder_error": + return TextExtractionApiV2Error.isAFolderError case "other": - return OfficeFileType.other + return TextExtractionApiV2Error.other default: - return OfficeFileType.other + return TextExtractionApiV2Error.other } default: - throw JSONSerializerError.deserializeError(type: OfficeFileType.self, json: json) + throw JSONSerializerError.deserializeError(type: TextExtractionApiV2Error.self, json: json) } } } - /// The TimestampLevel union + /// Granularity of the time offsets returned for each transcript segment. public enum TimestampLevel: CustomStringConvertible, JSONRepresentable { - /// An unspecified error. + /// One segment per spoken sentence (recommended). This is the default when timestampLevel in GetTranscriptArgs + /// is omitted. case sentence - /// An unspecified error. + /// One segment per word, useful for fine-grained alignment such as captioning or highlight-as-you-listen + /// experiences. case word /// An unspecified error. case other @@ -1984,15 +2941,15 @@ public class Riviera { } } - /// Exactly one variant is populated, corresponding to `metadata_type`. + /// The extracted metadata. Exactly one variant is populated, corresponding to metadataType in GetMetadataResult. public enum MetadataUnion: CustomStringConvertible, JSONRepresentable { - /// An unspecified error. + /// EXIF metadata, for image files. case exif(Riviera.ApiExifMetadata) - /// An unspecified error. + /// Container and per-stream metadata, for audio and video files. case media(Riviera.ApiMediaMetadata) - /// An unspecified error. + /// Document metadata, for PDFs. case pdf(Riviera.ApiPdfMetadata) - /// An unspecified error. + /// Document metadata, for MS Office files. case office(Riviera.ApiOfficeMetadata) /// An unspecified error. case other @@ -2067,6 +3024,34 @@ public class Riviera { /// Stone Route Objects + static let getKeyframesAsync = Route( + name: "get_keyframes_async", + version: 1, + namespace: "riviera", + deprecated: false, + argSerializer: Riviera.GetKeyframesArgsSerializer(), + responseSerializer: Async.LaunchResultBaseSerializer(), + errorSerializer: Serialization._VoidSerializer, + attributes: RouteAttributes( + auth: [.app, .user], + host: .api, + style: .rpc + ) + ) + static let getKeyframesAsyncCheck = Route( + name: "get_keyframes_async/check", + version: 1, + namespace: "riviera", + deprecated: false, + argSerializer: Async.PollArgSerializer(), + responseSerializer: Riviera.GetKeyframesAsyncCheckResultSerializer(), + errorSerializer: Async.PollErrorSerializer(), + attributes: RouteAttributes( + auth: [.app, .user], + host: .api, + style: .rpc + ) + ) static let getMarkdownAsync = Route( name: "get_markdown_async", version: 1, @@ -2123,6 +3108,62 @@ public class Riviera { style: .rpc ) ) + static let getOcrAsync = Route( + name: "get_ocr_async", + version: 1, + namespace: "riviera", + deprecated: false, + argSerializer: Riviera.GetOcrArgsSerializer(), + responseSerializer: Async.LaunchResultBaseSerializer(), + errorSerializer: Serialization._VoidSerializer, + attributes: RouteAttributes( + auth: [.app, .user], + host: .api, + style: .rpc + ) + ) + static let getOcrAsyncCheck = Route( + name: "get_ocr_async/check", + version: 1, + namespace: "riviera", + deprecated: false, + argSerializer: Async.PollArgSerializer(), + responseSerializer: Riviera.GetOcrAsyncCheckResultSerializer(), + errorSerializer: Async.PollErrorSerializer(), + attributes: RouteAttributes( + auth: [.app, .user], + host: .api, + style: .rpc + ) + ) + static let getTextAsync = Route( + name: "get_text_async", + version: 1, + namespace: "riviera", + deprecated: false, + argSerializer: Riviera.GetTextArgsSerializer(), + responseSerializer: Async.LaunchResultBaseSerializer(), + errorSerializer: Serialization._VoidSerializer, + attributes: RouteAttributes( + auth: [.app, .user], + host: .api, + style: .rpc + ) + ) + static let getTextAsyncCheck = Route( + name: "get_text_async/check", + version: 1, + namespace: "riviera", + deprecated: false, + argSerializer: Async.PollArgSerializer(), + responseSerializer: Riviera.GetTextAsyncCheckResultSerializer(), + errorSerializer: Async.PollErrorSerializer(), + attributes: RouteAttributes( + auth: [.app, .user], + host: .api, + style: .rpc + ) + ) static let getTranscriptAsync = Route( name: "get_transcript_async", version: 1, diff --git a/Source/SwiftyDropbox/Shared/Generated/RivieraAppAuthRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/RivieraAppAuthRoutes.swift index 5f9a16bc..a489d6a9 100644 --- a/Source/SwiftyDropbox/Shared/Generated/RivieraAppAuthRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/RivieraAppAuthRoutes.swift @@ -14,15 +14,73 @@ public class RivieraAppAuthRoutes: DropboxTransportClientOwning { self.client = client } + /// Asynchronous scene-change keyframe extraction for video files. Detects scene changes in the source video and + /// returns one representative keyframe per detected scene, each tagged with its timestamp (seconds from the + /// start of the video) and scene-change score. Set `include_images = true` to also receive each frame as a + /// base64-encoded JPEG; when the field is omitted the response carries keyframe metadata only. Supported video + /// formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, + /// .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. Unsupported formats return an + /// `unsupported_format_error`. Limits: the source file must be at most 10 GB. To keep responses within service + /// limits the number of keyframes and the total image payload are bounded; requests that would exceed these + /// limits return a `limit_exceeded_error` -- raise `scene_change_threshold` or set `include_images = false` to + /// stay within bounds. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the video file to extract keyframes from. Callers must set exactly one of + /// the `FileIdOrUrl` variants. Keyframe extraction is supported for video files only; see the route description + /// for the supported formats. Requests against unsupported formats return `unsupported_format_error`. + /// - parameter sceneChangeThreshold: Sensitivity of scene-change detection. A keyframe is emitted whenever the + /// frame-to-frame scene score crosses this threshold, so a LOWER value yields MORE keyframes. Valid range is + /// (0.0, 1.0]. When omitted (0.0) the service uses a default of 0.3, which is a good starting point for most + /// videos. + /// - parameter includeImages: When true, each returned keyframe includes the JPEG image bytes, base64-encoded, in + /// `ApiKeyframe.image_base64`. When false, the response contains only per-keyframe metadata (timestamp and + /// scene score) and `image_base64` is left empty -- useful when you only need the scene boundaries and want a + /// small response. NOTE: because the field defaults to false in proto3, callers who want images must set this + /// explicitly to true. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @discardableResult public func getKeyframesAsync(fileIdOrUrl: Riviera.FileIdOrUrl? = nil, sceneChangeThreshold: Double = 0.0, includeImages: Bool = false) -> RpcRequest< + Async.LaunchResultBaseSerializer, + VoidSerializer + > { + let route = Riviera.getKeyframesAsync + let serverArgs = Riviera.GetKeyframesArgs(fileIdOrUrl: fileIdOrUrl, sceneChangeThreshold: sceneChangeThreshold, includeImages: includeImages) + return client.request(route, serverArgs: serverArgs) + } + + /// Returns the status or result of specified get_keyframes_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetKeyframesAsyncCheckResult` + /// object on success or a `Async.PollError` object on failure. + @discardableResult public func getKeyframesAsyncCheck(asyncJobId: String) -> RpcRequest< + Riviera.GetKeyframesAsyncCheckResultSerializer, + Async.PollErrorSerializer + > { + let route = Riviera.getKeyframesAsyncCheck + let serverArgs = Async.PollArg(asyncJobId: asyncJobId) + return client.request(route, serverArgs: serverArgs) + } + /// Asynchronous document-to-markdown conversion for supported file formats. Supported formats: .binder, .docx, - /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Unsupported formats return an - /// `unsupported_format_error`. Size limit: the source file must be at most 50 MB. Larger files are rejected. + /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Files in other formats fail with userError in + /// MarkdownConversionApiV2Error. Size limit: the source file must be at most 50 MB. Larger files fail with + /// userError in MarkdownConversionApiV2Error. The markdown is not returned by this route. Poll + /// getMarkdownAsyncCheck with the returned async job ID until it reports complete in + /// GetMarkdownAsyncCheckResult or failed in GetMarkdownAsyncCheckResult. /// /// - scope: files.content.read /// - /// - parameter fileIdOrUrl: Identifier of the document to convert. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The referenced file must be a document in a supported format (see the route - /// description for the list); requests against unsupported formats return `unsupported_format_error`. + /// - parameter fileIdOrUrl: Identifier of the document to convert. Callers must set exactly one of the FileIdOrUrl + /// variants. The referenced file must be a document in a supported format (see the route description for the + /// list); requests against unsupported formats fail with userError in MarkdownConversionApiV2Error. /// - parameter enableOcr: Enable OCR for PDF documents. Processing is slower when enabled. /// - parameter embedImages: When true, embed images as base64 data URIs in the markdown output. This can /// significantly increase output size. @@ -63,15 +121,20 @@ public class RivieraAppAuthRoutes: DropboxTransportClientOwning { /// Audio/video (media) formats: .aac, .aif, .aiff, .flac, .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma, .3gp, /// .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, /// .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. - PDF format: .pdf. - MS Office formats: .docx, .pptx, .xlsx. - /// Unsupported formats return an `unsupported_format_error`. + /// Files in other formats fail with userError in MetadataExtractionApiV2Error. Size limits depend on the kind + /// of metadata being extracted: at most 200 MB for image (EXIF) files, 100 GB for audio/video files, 500 MB for + /// PDFs, and 288 MB for MS Office files. Files over the limit for their kind fail with userError in + /// MetadataExtractionApiV2Error. The metadata is not returned by this route. Poll getMetadataAsyncCheck with + /// the returned async job ID until it reports complete in GetMetadataAsyncCheckResult or failed in + /// GetMetadataAsyncCheckResult. /// /// - scope: files.content.read /// /// - parameter fileIdOrUrl: Identifier of the file to extract metadata from. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The kind of metadata returned is determined by the file type: image files return - /// EXIF metadata, audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents - /// (docx, pptx, xlsx) return Office metadata. See the route description for the supported formats. Requests - /// against unsupported formats return `unsupported_format_error`. + /// FileIdOrUrl variants. The kind of metadata returned is determined by the file type: image files return EXIF + /// metadata, audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents (docx, + /// pptx, xlsx) return Office metadata. See the route description for the supported formats. Requests against + /// unsupported formats fail with userError in MetadataExtractionApiV2Error. /// /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success /// or a `Void` object on failure. @@ -99,27 +162,107 @@ public class RivieraAppAuthRoutes: DropboxTransportClientOwning { return client.request(route, serverArgs: serverArgs) } + /// Asynchronous OCR (optical character recognition) text extraction for images and PDFs, including scanned / + /// non-text PDFs. Supported formats: - Image formats: .bmp, .gif, .heic, .jpeg, .jpg, .png, .tif, .tiff, .webp. + /// - PDF format: .pdf. Unsupported formats return an `unsupported_format_error`. For the `url` variant only + /// Dropbox shared links are supported; external URLs return `unsupported_format_error`. Text-based PDFs already + /// carry a text layer, so OCR is not run against them and the result is empty; use `get_text_async` to read the + /// embedded text layer of such a PDF. The result carries the extracted words as plain text, plus the same + /// content as hOCR with per-word coordinates. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the file to run OCR on. Callers must set exactly one of the `FileIdOrUrl` + /// variants. OCR is supported for image files and PDFs, including scanned / non-text PDFs; see the route + /// description for the supported formats. Requests against unsupported formats return + /// `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared links (www.dropbox.com) are + /// supported. External (non-Dropbox) URLs are not supported and return `unsupported_format_error`; import the + /// file into Dropbox and reference it by `file_id` or `path` instead. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @discardableResult public func getOcrAsync(fileIdOrUrl: Riviera.FileIdOrUrl? = nil) -> RpcRequest { + let route = Riviera.getOcrAsync + let serverArgs = Riviera.GetOcrArgs(fileIdOrUrl: fileIdOrUrl) + return client.request(route, serverArgs: serverArgs) + } + + /// Returns the status or result of specified get_ocr_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetOcrAsyncCheckResult` object on + /// success or a `Async.PollError` object on failure. + @discardableResult public func getOcrAsyncCheck(asyncJobId: String) -> RpcRequest { + let route = Riviera.getOcrAsyncCheck + let serverArgs = Async.PollArg(asyncJobId: asyncJobId) + return client.request(route, serverArgs: serverArgs) + } + + /// Asynchronous plain-text extraction from documents. Supported formats include: - Word processing: .doc, .docx, + /// .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox + /// document types: .paper, .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant only Dropbox shared links + /// are supported; external URLs return `unsupported_format_error`. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the document to extract text from. Callers must set exactly one of the + /// `FileIdOrUrl` variants. Text extraction is supported for common document formats (Word, PowerPoint, Excel, + /// PDF, RTF, and Dropbox document types); see the route description for the supported formats. Requests against + /// unsupported formats return `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared + /// links (www.dropbox.com) are supported. External (non-Dropbox) URLs are not supported and return + /// `unsupported_format_error`; import the file into Dropbox and reference it by `file_id` or `path` instead. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @discardableResult public func getTextAsync(fileIdOrUrl: Riviera.FileIdOrUrl? = nil) -> RpcRequest { + let route = Riviera.getTextAsync + let serverArgs = Riviera.GetTextArgs(fileIdOrUrl: fileIdOrUrl) + return client.request(route, serverArgs: serverArgs) + } + + /// Returns the status or result of specified get_text_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetTextAsyncCheckResult` object on + /// success or a `Async.PollError` object on failure. + @discardableResult public func getTextAsyncCheck(asyncJobId: String) -> RpcRequest { + let route = Riviera.getTextAsyncCheck + let serverArgs = Async.PollArg(asyncJobId: asyncJobId) + return client.request(route, serverArgs: serverArgs) + } + /// Asynchronous transcript generation for audio and video files. Supported audio formats: .aac, .aif, .aiff, .flac, /// .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma. Supported video formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, /// .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, - /// .wmv. Unsupported formats return an `unsupported_format_error`. Size limits: the source file must be at most - /// 10 GB and its audio track at most 1 hour in duration. Files exceeding these limits are rejected. + /// .wmv. Files in other formats fail with userError in ContentApiV2Error. Size limits: the source file must be + /// at most 10 GB and its audio track at most 1 hour in duration. Files exceeding either limit fail with + /// userError in ContentApiV2Error. The transcript is not returned by this route. Poll getTranscriptAsyncCheck + /// with the returned async job ID until it reports complete in GetTranscriptAsyncCheckResult or failed in + /// GetTranscriptAsyncCheckResult. /// /// - scope: files.content.read /// /// - parameter fileIdOrUrl: Identifier of the media asset to transcribe. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The referenced asset must be an audio or video file in a supported format (see the - /// route description for the list); requests against files with no audio track return a `no_audio_error`. + /// FileIdOrUrl variants. The referenced asset must be an audio or video file in a supported format (see the + /// route description for the list); requests against files with no audio track fail with noAudioError in + /// ContentApiV2Error. /// - parameter timestampLevel: Granularity of the time offsets returned for each transcript segment. Defaults to - /// `SENTENCE` when the field is omitted. - SENTENCE: one segment per spoken sentence (recommended). - WORD: one - /// segment per word, useful for fine-grained alignment such as captioning or highlight-as-you-listen - /// experiences. + /// sentence in TimestampLevel when the field is omitted. /// - parameter includedSpecialWords: Comma-delimited list of non-lexical filler words to preserve in the transcript /// output, e.g. `"uh, ah, uhm"`. By default these fillers are stripped. Unrecognized tokens are ignored. Leave /// empty to use the default filtering behavior. - /// - parameter audioLanguage: Optional ISO 639-1 two-letter language code hinting the spoken language of the source - /// audio (e.g. "en", "ja"). When empty, the service auto-detects the language; supplying a hint improves - /// accuracy and latency for short or ambiguous clips. Unsupported languages fall back to auto-detection. + /// - parameter audioLanguage: Hint for the spoken language of the source audio, as an ISO 639-1 code (e.g. "en", + /// "ja"). When empty, the service auto-detects the language; supplying a hint improves accuracy and latency for + /// short or ambiguous clips. Languages the service does not support fall back to auto-detection. /// /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success /// or a `Void` object on failure. diff --git a/Source/SwiftyDropbox/Shared/Generated/RivieraRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/RivieraRoutes.swift index 086be160..d58e4f1c 100644 --- a/Source/SwiftyDropbox/Shared/Generated/RivieraRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/RivieraRoutes.swift @@ -14,15 +14,73 @@ public class RivieraRoutes: DropboxTransportClientOwning { self.client = client } + /// Asynchronous scene-change keyframe extraction for video files. Detects scene changes in the source video and + /// returns one representative keyframe per detected scene, each tagged with its timestamp (seconds from the + /// start of the video) and scene-change score. Set `include_images = true` to also receive each frame as a + /// base64-encoded JPEG; when the field is omitted the response carries keyframe metadata only. Supported video + /// formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, + /// .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. Unsupported formats return an + /// `unsupported_format_error`. Limits: the source file must be at most 10 GB. To keep responses within service + /// limits the number of keyframes and the total image payload are bounded; requests that would exceed these + /// limits return a `limit_exceeded_error` -- raise `scene_change_threshold` or set `include_images = false` to + /// stay within bounds. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the video file to extract keyframes from. Callers must set exactly one of + /// the `FileIdOrUrl` variants. Keyframe extraction is supported for video files only; see the route description + /// for the supported formats. Requests against unsupported formats return `unsupported_format_error`. + /// - parameter sceneChangeThreshold: Sensitivity of scene-change detection. A keyframe is emitted whenever the + /// frame-to-frame scene score crosses this threshold, so a LOWER value yields MORE keyframes. Valid range is + /// (0.0, 1.0]. When omitted (0.0) the service uses a default of 0.3, which is a good starting point for most + /// videos. + /// - parameter includeImages: When true, each returned keyframe includes the JPEG image bytes, base64-encoded, in + /// `ApiKeyframe.image_base64`. When false, the response contains only per-keyframe metadata (timestamp and + /// scene score) and `image_base64` is left empty -- useful when you only need the scene boundaries and want a + /// small response. NOTE: because the field defaults to false in proto3, callers who want images must set this + /// explicitly to true. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @discardableResult public func getKeyframesAsync(fileIdOrUrl: Riviera.FileIdOrUrl? = nil, sceneChangeThreshold: Double = 0.0, includeImages: Bool = false) -> RpcRequest< + Async.LaunchResultBaseSerializer, + VoidSerializer + > { + let route = Riviera.getKeyframesAsync + let serverArgs = Riviera.GetKeyframesArgs(fileIdOrUrl: fileIdOrUrl, sceneChangeThreshold: sceneChangeThreshold, includeImages: includeImages) + return client.request(route, serverArgs: serverArgs) + } + + /// Returns the status or result of specified get_keyframes_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetKeyframesAsyncCheckResult` + /// object on success or a `Async.PollError` object on failure. + @discardableResult public func getKeyframesAsyncCheck(asyncJobId: String) -> RpcRequest< + Riviera.GetKeyframesAsyncCheckResultSerializer, + Async.PollErrorSerializer + > { + let route = Riviera.getKeyframesAsyncCheck + let serverArgs = Async.PollArg(asyncJobId: asyncJobId) + return client.request(route, serverArgs: serverArgs) + } + /// Asynchronous document-to-markdown conversion for supported file formats. Supported formats: .binder, .docx, - /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Unsupported formats return an - /// `unsupported_format_error`. Size limit: the source file must be at most 50 MB. Larger files are rejected. + /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Files in other formats fail with userError in + /// MarkdownConversionApiV2Error. Size limit: the source file must be at most 50 MB. Larger files fail with + /// userError in MarkdownConversionApiV2Error. The markdown is not returned by this route. Poll + /// getMarkdownAsyncCheck with the returned async job ID until it reports complete in + /// GetMarkdownAsyncCheckResult or failed in GetMarkdownAsyncCheckResult. /// /// - scope: files.content.read /// - /// - parameter fileIdOrUrl: Identifier of the document to convert. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The referenced file must be a document in a supported format (see the route - /// description for the list); requests against unsupported formats return `unsupported_format_error`. + /// - parameter fileIdOrUrl: Identifier of the document to convert. Callers must set exactly one of the FileIdOrUrl + /// variants. The referenced file must be a document in a supported format (see the route description for the + /// list); requests against unsupported formats fail with userError in MarkdownConversionApiV2Error. /// - parameter enableOcr: Enable OCR for PDF documents. Processing is slower when enabled. /// - parameter embedImages: When true, embed images as base64 data URIs in the markdown output. This can /// significantly increase output size. @@ -63,15 +121,20 @@ public class RivieraRoutes: DropboxTransportClientOwning { /// Audio/video (media) formats: .aac, .aif, .aiff, .flac, .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma, .3gp, /// .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, /// .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. - PDF format: .pdf. - MS Office formats: .docx, .pptx, .xlsx. - /// Unsupported formats return an `unsupported_format_error`. + /// Files in other formats fail with userError in MetadataExtractionApiV2Error. Size limits depend on the kind + /// of metadata being extracted: at most 200 MB for image (EXIF) files, 100 GB for audio/video files, 500 MB for + /// PDFs, and 288 MB for MS Office files. Files over the limit for their kind fail with userError in + /// MetadataExtractionApiV2Error. The metadata is not returned by this route. Poll getMetadataAsyncCheck with + /// the returned async job ID until it reports complete in GetMetadataAsyncCheckResult or failed in + /// GetMetadataAsyncCheckResult. /// /// - scope: files.content.read /// /// - parameter fileIdOrUrl: Identifier of the file to extract metadata from. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The kind of metadata returned is determined by the file type: image files return - /// EXIF metadata, audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents - /// (docx, pptx, xlsx) return Office metadata. See the route description for the supported formats. Requests - /// against unsupported formats return `unsupported_format_error`. + /// FileIdOrUrl variants. The kind of metadata returned is determined by the file type: image files return EXIF + /// metadata, audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents (docx, + /// pptx, xlsx) return Office metadata. See the route description for the supported formats. Requests against + /// unsupported formats fail with userError in MetadataExtractionApiV2Error. /// /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success /// or a `Void` object on failure. @@ -99,27 +162,107 @@ public class RivieraRoutes: DropboxTransportClientOwning { return client.request(route, serverArgs: serverArgs) } + /// Asynchronous OCR (optical character recognition) text extraction for images and PDFs, including scanned / + /// non-text PDFs. Supported formats: - Image formats: .bmp, .gif, .heic, .jpeg, .jpg, .png, .tif, .tiff, .webp. + /// - PDF format: .pdf. Unsupported formats return an `unsupported_format_error`. For the `url` variant only + /// Dropbox shared links are supported; external URLs return `unsupported_format_error`. Text-based PDFs already + /// carry a text layer, so OCR is not run against them and the result is empty; use `get_text_async` to read the + /// embedded text layer of such a PDF. The result carries the extracted words as plain text, plus the same + /// content as hOCR with per-word coordinates. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the file to run OCR on. Callers must set exactly one of the `FileIdOrUrl` + /// variants. OCR is supported for image files and PDFs, including scanned / non-text PDFs; see the route + /// description for the supported formats. Requests against unsupported formats return + /// `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared links (www.dropbox.com) are + /// supported. External (non-Dropbox) URLs are not supported and return `unsupported_format_error`; import the + /// file into Dropbox and reference it by `file_id` or `path` instead. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @discardableResult public func getOcrAsync(fileIdOrUrl: Riviera.FileIdOrUrl? = nil) -> RpcRequest { + let route = Riviera.getOcrAsync + let serverArgs = Riviera.GetOcrArgs(fileIdOrUrl: fileIdOrUrl) + return client.request(route, serverArgs: serverArgs) + } + + /// Returns the status or result of specified get_ocr_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetOcrAsyncCheckResult` object on + /// success or a `Async.PollError` object on failure. + @discardableResult public func getOcrAsyncCheck(asyncJobId: String) -> RpcRequest { + let route = Riviera.getOcrAsyncCheck + let serverArgs = Async.PollArg(asyncJobId: asyncJobId) + return client.request(route, serverArgs: serverArgs) + } + + /// Asynchronous plain-text extraction from documents. Supported formats include: - Word processing: .doc, .docx, + /// .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox + /// document types: .paper, .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant only Dropbox shared links + /// are supported; external URLs return `unsupported_format_error`. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the document to extract text from. Callers must set exactly one of the + /// `FileIdOrUrl` variants. Text extraction is supported for common document formats (Word, PowerPoint, Excel, + /// PDF, RTF, and Dropbox document types); see the route description for the supported formats. Requests against + /// unsupported formats return `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared + /// links (www.dropbox.com) are supported. External (non-Dropbox) URLs are not supported and return + /// `unsupported_format_error`; import the file into Dropbox and reference it by `file_id` or `path` instead. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @discardableResult public func getTextAsync(fileIdOrUrl: Riviera.FileIdOrUrl? = nil) -> RpcRequest { + let route = Riviera.getTextAsync + let serverArgs = Riviera.GetTextArgs(fileIdOrUrl: fileIdOrUrl) + return client.request(route, serverArgs: serverArgs) + } + + /// Returns the status or result of specified get_text_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetTextAsyncCheckResult` object on + /// success or a `Async.PollError` object on failure. + @discardableResult public func getTextAsyncCheck(asyncJobId: String) -> RpcRequest { + let route = Riviera.getTextAsyncCheck + let serverArgs = Async.PollArg(asyncJobId: asyncJobId) + return client.request(route, serverArgs: serverArgs) + } + /// Asynchronous transcript generation for audio and video files. Supported audio formats: .aac, .aif, .aiff, .flac, /// .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma. Supported video formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, /// .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, - /// .wmv. Unsupported formats return an `unsupported_format_error`. Size limits: the source file must be at most - /// 10 GB and its audio track at most 1 hour in duration. Files exceeding these limits are rejected. + /// .wmv. Files in other formats fail with userError in ContentApiV2Error. Size limits: the source file must be + /// at most 10 GB and its audio track at most 1 hour in duration. Files exceeding either limit fail with + /// userError in ContentApiV2Error. The transcript is not returned by this route. Poll getTranscriptAsyncCheck + /// with the returned async job ID until it reports complete in GetTranscriptAsyncCheckResult or failed in + /// GetTranscriptAsyncCheckResult. /// /// - scope: files.content.read /// /// - parameter fileIdOrUrl: Identifier of the media asset to transcribe. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The referenced asset must be an audio or video file in a supported format (see the - /// route description for the list); requests against files with no audio track return a `no_audio_error`. + /// FileIdOrUrl variants. The referenced asset must be an audio or video file in a supported format (see the + /// route description for the list); requests against files with no audio track fail with noAudioError in + /// ContentApiV2Error. /// - parameter timestampLevel: Granularity of the time offsets returned for each transcript segment. Defaults to - /// `SENTENCE` when the field is omitted. - SENTENCE: one segment per spoken sentence (recommended). - WORD: one - /// segment per word, useful for fine-grained alignment such as captioning or highlight-as-you-listen - /// experiences. + /// sentence in TimestampLevel when the field is omitted. /// - parameter includedSpecialWords: Comma-delimited list of non-lexical filler words to preserve in the transcript /// output, e.g. `"uh, ah, uhm"`. By default these fillers are stripped. Unrecognized tokens are ignored. Leave /// empty to use the default filtering behavior. - /// - parameter audioLanguage: Optional ISO 639-1 two-letter language code hinting the spoken language of the source - /// audio (e.g. "en", "ja"). When empty, the service auto-detects the language; supplying a hint improves - /// accuracy and latency for short or ambiguous clips. Unsupported languages fall back to auto-detection. + /// - parameter audioLanguage: Hint for the spoken language of the source audio, as an ISO 639-1 code (e.g. "en", + /// "ja"). When empty, the service auto-detects the language; supplying a hint improves accuracy and latency for + /// short or ambiguous clips. Languages the service does not support fall back to auto-detection. /// /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success /// or a `Void` object on failure. diff --git a/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift b/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift index 2b0000bf..18256ec4 100644 --- a/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift +++ b/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift @@ -16207,12 +16207,24 @@ public class TeamLog { /// An unspecified error. case protectActionRemoveCollaboratorDetails(TeamLog.ProtectActionRemoveCollaboratorDetails) /// An unspecified error. + case protectActionRemoveDomainsDetails(TeamLog.ProtectActionRemoveDomainsDetails) + /// An unspecified error. case protectActionRemoveLinkDetails(TeamLog.ProtectActionRemoveLinkDetails) /// An unspecified error. case protectActionStopSharingDetails(TeamLog.ProtectActionStopSharingDetails) /// An unspecified error. case protectInternalDomainsChangedDetails(TeamLog.ProtectInternalDomainsChangedDetails) /// An unspecified error. + case protectPolicyActivatedDetails(TeamLog.ProtectPolicyActivatedDetails) + /// An unspecified error. + case protectPolicyDeactivatedDetails(TeamLog.ProtectPolicyDeactivatedDetails) + /// An unspecified error. + case protectPolicyScheduledDetails(TeamLog.ProtectPolicyScheduledDetails) + /// An unspecified error. + case protectPolicyUpdatedDetails(TeamLog.ProtectPolicyUpdatedDetails) + /// An unspecified error. + case protectReportViewDetails(TeamLog.ProtectReportViewDetails) + /// An unspecified error. case classificationCreateReportDetails(TeamLog.ClassificationCreateReportDetails) /// An unspecified error. case classificationCreateReportFailDetails(TeamLog.ClassificationCreateReportFailDetails) @@ -16777,6 +16789,10 @@ public class TeamLog { /// An unspecified error. case teamExtensionsPolicyChangedDetails(TeamLog.TeamExtensionsPolicyChangedDetails) /// An unspecified error. + case teamExternalSharingControlsActivationStateChangedDetails(TeamLog.TeamExternalSharingControlsActivationStateChangedDetails) + /// An unspecified error. + case teamExternalSharingControlsRecipientListsChangedDetails(TeamLog.TeamExternalSharingControlsRecipientListsChangedDetails) + /// An unspecified error. case teamMemberStorageRequestPolicyChangedDetails(TeamLog.TeamMemberStorageRequestPolicyChangedDetails) /// An unspecified error. case teamSelectiveSyncPolicyChangedDetails(TeamLog.TeamSelectiveSyncPolicyChangedDetails) @@ -18043,6 +18059,10 @@ public class TeamLog { var d = try Serialization.getFields(TeamLog.ProtectActionRemoveCollaboratorDetailsSerializer().serialize(arg)) d[".tag"] = .str("protect_action_remove_collaborator_details") return .dictionary(d) + case .protectActionRemoveDomainsDetails(let arg): + var d = try Serialization.getFields(TeamLog.ProtectActionRemoveDomainsDetailsSerializer().serialize(arg)) + d[".tag"] = .str("protect_action_remove_domains_details") + return .dictionary(d) case .protectActionRemoveLinkDetails(let arg): var d = try Serialization.getFields(TeamLog.ProtectActionRemoveLinkDetailsSerializer().serialize(arg)) d[".tag"] = .str("protect_action_remove_link_details") @@ -18055,6 +18075,26 @@ public class TeamLog { var d = try Serialization.getFields(TeamLog.ProtectInternalDomainsChangedDetailsSerializer().serialize(arg)) d[".tag"] = .str("protect_internal_domains_changed_details") return .dictionary(d) + case .protectPolicyActivatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ProtectPolicyActivatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("protect_policy_activated_details") + return .dictionary(d) + case .protectPolicyDeactivatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ProtectPolicyDeactivatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("protect_policy_deactivated_details") + return .dictionary(d) + case .protectPolicyScheduledDetails(let arg): + var d = try Serialization.getFields(TeamLog.ProtectPolicyScheduledDetailsSerializer().serialize(arg)) + d[".tag"] = .str("protect_policy_scheduled_details") + return .dictionary(d) + case .protectPolicyUpdatedDetails(let arg): + var d = try Serialization.getFields(TeamLog.ProtectPolicyUpdatedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("protect_policy_updated_details") + return .dictionary(d) + case .protectReportViewDetails(let arg): + var d = try Serialization.getFields(TeamLog.ProtectReportViewDetailsSerializer().serialize(arg)) + d[".tag"] = .str("protect_report_view_details") + return .dictionary(d) case .classificationCreateReportDetails(let arg): var d = try Serialization.getFields(TeamLog.ClassificationCreateReportDetailsSerializer().serialize(arg)) d[".tag"] = .str("classification_create_report_details") @@ -19183,6 +19223,14 @@ public class TeamLog { var d = try Serialization.getFields(TeamLog.TeamExtensionsPolicyChangedDetailsSerializer().serialize(arg)) d[".tag"] = .str("team_extensions_policy_changed_details") return .dictionary(d) + case .teamExternalSharingControlsActivationStateChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamExternalSharingControlsActivationStateChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_external_sharing_controls_activation_state_changed_details") + return .dictionary(d) + case .teamExternalSharingControlsRecipientListsChangedDetails(let arg): + var d = try Serialization.getFields(TeamLog.TeamExternalSharingControlsRecipientListsChangedDetailsSerializer().serialize(arg)) + d[".tag"] = .str("team_external_sharing_controls_recipient_lists_changed_details") + return .dictionary(d) case .teamMemberStorageRequestPolicyChangedDetails(let arg): var d = try Serialization.getFields(TeamLog.TeamMemberStorageRequestPolicyChangedDetailsSerializer().serialize(arg)) d[".tag"] = .str("team_member_storage_request_policy_changed_details") @@ -20280,6 +20328,9 @@ public class TeamLog { case "protect_action_remove_collaborator_details": let v = try TeamLog.ProtectActionRemoveCollaboratorDetailsSerializer().deserialize(json) return EventDetails.protectActionRemoveCollaboratorDetails(v) + case "protect_action_remove_domains_details": + let v = try TeamLog.ProtectActionRemoveDomainsDetailsSerializer().deserialize(json) + return EventDetails.protectActionRemoveDomainsDetails(v) case "protect_action_remove_link_details": let v = try TeamLog.ProtectActionRemoveLinkDetailsSerializer().deserialize(json) return EventDetails.protectActionRemoveLinkDetails(v) @@ -20289,6 +20340,21 @@ public class TeamLog { case "protect_internal_domains_changed_details": let v = try TeamLog.ProtectInternalDomainsChangedDetailsSerializer().deserialize(json) return EventDetails.protectInternalDomainsChangedDetails(v) + case "protect_policy_activated_details": + let v = try TeamLog.ProtectPolicyActivatedDetailsSerializer().deserialize(json) + return EventDetails.protectPolicyActivatedDetails(v) + case "protect_policy_deactivated_details": + let v = try TeamLog.ProtectPolicyDeactivatedDetailsSerializer().deserialize(json) + return EventDetails.protectPolicyDeactivatedDetails(v) + case "protect_policy_scheduled_details": + let v = try TeamLog.ProtectPolicyScheduledDetailsSerializer().deserialize(json) + return EventDetails.protectPolicyScheduledDetails(v) + case "protect_policy_updated_details": + let v = try TeamLog.ProtectPolicyUpdatedDetailsSerializer().deserialize(json) + return EventDetails.protectPolicyUpdatedDetails(v) + case "protect_report_view_details": + let v = try TeamLog.ProtectReportViewDetailsSerializer().deserialize(json) + return EventDetails.protectReportViewDetails(v) case "classification_create_report_details": let v = try TeamLog.ClassificationCreateReportDetailsSerializer().deserialize(json) return EventDetails.classificationCreateReportDetails(v) @@ -21135,6 +21201,12 @@ public class TeamLog { case "team_extensions_policy_changed_details": let v = try TeamLog.TeamExtensionsPolicyChangedDetailsSerializer().deserialize(json) return EventDetails.teamExtensionsPolicyChangedDetails(v) + case "team_external_sharing_controls_activation_state_changed_details": + let v = try TeamLog.TeamExternalSharingControlsActivationStateChangedDetailsSerializer().deserialize(json) + return EventDetails.teamExternalSharingControlsActivationStateChangedDetails(v) + case "team_external_sharing_controls_recipient_lists_changed_details": + let v = try TeamLog.TeamExternalSharingControlsRecipientListsChangedDetailsSerializer().deserialize(json) + return EventDetails.teamExternalSharingControlsRecipientListsChangedDetails(v) case "team_member_storage_request_policy_changed_details": let v = try TeamLog.TeamMemberStorageRequestPolicyChangedDetailsSerializer().deserialize(json) return EventDetails.teamMemberStorageRequestPolicyChangedDetails(v) @@ -21892,12 +21964,24 @@ public class TeamLog { case protectActionExport(TeamLog.ProtectActionExportType) /// (protect) Removed collaborators via Dropbox Protect case protectActionRemoveCollaborator(TeamLog.ProtectActionRemoveCollaboratorType) + /// (protect) Removed domains via Dropbox Protect + case protectActionRemoveDomains(TeamLog.ProtectActionRemoveDomainsType) /// (protect) Removed a link via Dropbox Protect case protectActionRemoveLink(TeamLog.ProtectActionRemoveLinkType) /// (protect) Stopped sharing content via Dropbox Protect case protectActionStopSharing(TeamLog.ProtectActionStopSharingType) /// (protect) Modified Protect internal domains list case protectInternalDomainsChanged(TeamLog.ProtectInternalDomainsChangedType) + /// (protect) Activated a Dropbox Protect policy + case protectPolicyActivated(TeamLog.ProtectPolicyActivatedType) + /// (protect) Deactivated a Dropbox Protect policy + case protectPolicyDeactivated(TeamLog.ProtectPolicyDeactivatedType) + /// (protect) Scheduled a Dropbox Protect policy + case protectPolicyScheduled(TeamLog.ProtectPolicyScheduledType) + /// (protect) Updated a Dropbox Protect policy + case protectPolicyUpdated(TeamLog.ProtectPolicyUpdatedType) + /// (protect) Viewed a Dropbox Protect report + case protectReportView(TeamLog.ProtectReportViewType) /// (reports) Created Classification report case classificationCreateReport(TeamLog.ClassificationCreateReportType) /// (reports) Couldn't create Classification report @@ -22468,6 +22552,10 @@ public class TeamLog { case teamBrandingPolicyChanged(TeamLog.TeamBrandingPolicyChangedType) /// (team_policies) Changed App Integrations setting for team case teamExtensionsPolicyChanged(TeamLog.TeamExtensionsPolicyChangedType) + /// (team_policies) Changed external sharing controls activation state + case teamExternalSharingControlsActivationStateChanged(TeamLog.TeamExternalSharingControlsActivationStateChangedType) + /// (team_policies) Changed approved or blocked entries for external sharing controls + case teamExternalSharingControlsRecipientListsChanged(TeamLog.TeamExternalSharingControlsRecipientListsChangedType) /// (team_policies) Changed team member storage request policy for team case teamMemberStorageRequestPolicyChanged(TeamLog.TeamMemberStorageRequestPolicyChangedType) /// (team_policies) Enabled/disabled Team Selective Sync for team @@ -23736,6 +23824,10 @@ public class TeamLog { var d = try Serialization.getFields(TeamLog.ProtectActionRemoveCollaboratorTypeSerializer().serialize(arg)) d[".tag"] = .str("protect_action_remove_collaborator") return .dictionary(d) + case .protectActionRemoveDomains(let arg): + var d = try Serialization.getFields(TeamLog.ProtectActionRemoveDomainsTypeSerializer().serialize(arg)) + d[".tag"] = .str("protect_action_remove_domains") + return .dictionary(d) case .protectActionRemoveLink(let arg): var d = try Serialization.getFields(TeamLog.ProtectActionRemoveLinkTypeSerializer().serialize(arg)) d[".tag"] = .str("protect_action_remove_link") @@ -23748,6 +23840,26 @@ public class TeamLog { var d = try Serialization.getFields(TeamLog.ProtectInternalDomainsChangedTypeSerializer().serialize(arg)) d[".tag"] = .str("protect_internal_domains_changed") return .dictionary(d) + case .protectPolicyActivated(let arg): + var d = try Serialization.getFields(TeamLog.ProtectPolicyActivatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("protect_policy_activated") + return .dictionary(d) + case .protectPolicyDeactivated(let arg): + var d = try Serialization.getFields(TeamLog.ProtectPolicyDeactivatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("protect_policy_deactivated") + return .dictionary(d) + case .protectPolicyScheduled(let arg): + var d = try Serialization.getFields(TeamLog.ProtectPolicyScheduledTypeSerializer().serialize(arg)) + d[".tag"] = .str("protect_policy_scheduled") + return .dictionary(d) + case .protectPolicyUpdated(let arg): + var d = try Serialization.getFields(TeamLog.ProtectPolicyUpdatedTypeSerializer().serialize(arg)) + d[".tag"] = .str("protect_policy_updated") + return .dictionary(d) + case .protectReportView(let arg): + var d = try Serialization.getFields(TeamLog.ProtectReportViewTypeSerializer().serialize(arg)) + d[".tag"] = .str("protect_report_view") + return .dictionary(d) case .classificationCreateReport(let arg): var d = try Serialization.getFields(TeamLog.ClassificationCreateReportTypeSerializer().serialize(arg)) d[".tag"] = .str("classification_create_report") @@ -24876,6 +24988,14 @@ public class TeamLog { var d = try Serialization.getFields(TeamLog.TeamExtensionsPolicyChangedTypeSerializer().serialize(arg)) d[".tag"] = .str("team_extensions_policy_changed") return .dictionary(d) + case .teamExternalSharingControlsActivationStateChanged(let arg): + var d = try Serialization.getFields(TeamLog.TeamExternalSharingControlsActivationStateChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_external_sharing_controls_activation_state_changed") + return .dictionary(d) + case .teamExternalSharingControlsRecipientListsChanged(let arg): + var d = try Serialization.getFields(TeamLog.TeamExternalSharingControlsRecipientListsChangedTypeSerializer().serialize(arg)) + d[".tag"] = .str("team_external_sharing_controls_recipient_lists_changed") + return .dictionary(d) case .teamMemberStorageRequestPolicyChanged(let arg): var d = try Serialization.getFields(TeamLog.TeamMemberStorageRequestPolicyChangedTypeSerializer().serialize(arg)) d[".tag"] = .str("team_member_storage_request_policy_changed") @@ -25969,6 +26089,9 @@ public class TeamLog { case "protect_action_remove_collaborator": let v = try TeamLog.ProtectActionRemoveCollaboratorTypeSerializer().deserialize(json) return EventType.protectActionRemoveCollaborator(v) + case "protect_action_remove_domains": + let v = try TeamLog.ProtectActionRemoveDomainsTypeSerializer().deserialize(json) + return EventType.protectActionRemoveDomains(v) case "protect_action_remove_link": let v = try TeamLog.ProtectActionRemoveLinkTypeSerializer().deserialize(json) return EventType.protectActionRemoveLink(v) @@ -25978,6 +26101,21 @@ public class TeamLog { case "protect_internal_domains_changed": let v = try TeamLog.ProtectInternalDomainsChangedTypeSerializer().deserialize(json) return EventType.protectInternalDomainsChanged(v) + case "protect_policy_activated": + let v = try TeamLog.ProtectPolicyActivatedTypeSerializer().deserialize(json) + return EventType.protectPolicyActivated(v) + case "protect_policy_deactivated": + let v = try TeamLog.ProtectPolicyDeactivatedTypeSerializer().deserialize(json) + return EventType.protectPolicyDeactivated(v) + case "protect_policy_scheduled": + let v = try TeamLog.ProtectPolicyScheduledTypeSerializer().deserialize(json) + return EventType.protectPolicyScheduled(v) + case "protect_policy_updated": + let v = try TeamLog.ProtectPolicyUpdatedTypeSerializer().deserialize(json) + return EventType.protectPolicyUpdated(v) + case "protect_report_view": + let v = try TeamLog.ProtectReportViewTypeSerializer().deserialize(json) + return EventType.protectReportView(v) case "classification_create_report": let v = try TeamLog.ClassificationCreateReportTypeSerializer().deserialize(json) return EventType.classificationCreateReport(v) @@ -26824,6 +26962,12 @@ public class TeamLog { case "team_extensions_policy_changed": let v = try TeamLog.TeamExtensionsPolicyChangedTypeSerializer().deserialize(json) return EventType.teamExtensionsPolicyChanged(v) + case "team_external_sharing_controls_activation_state_changed": + let v = try TeamLog.TeamExternalSharingControlsActivationStateChangedTypeSerializer().deserialize(json) + return EventType.teamExternalSharingControlsActivationStateChanged(v) + case "team_external_sharing_controls_recipient_lists_changed": + let v = try TeamLog.TeamExternalSharingControlsRecipientListsChangedTypeSerializer().deserialize(json) + return EventType.teamExternalSharingControlsRecipientListsChanged(v) case "team_member_storage_request_policy_changed": let v = try TeamLog.TeamMemberStorageRequestPolicyChangedTypeSerializer().deserialize(json) return EventType.teamMemberStorageRequestPolicyChanged(v) @@ -27578,12 +27722,24 @@ public class TeamLog { case protectActionExport /// (protect) Removed collaborators via Dropbox Protect case protectActionRemoveCollaborator + /// (protect) Removed domains via Dropbox Protect + case protectActionRemoveDomains /// (protect) Removed a link via Dropbox Protect case protectActionRemoveLink /// (protect) Stopped sharing content via Dropbox Protect case protectActionStopSharing /// (protect) Modified Protect internal domains list case protectInternalDomainsChanged + /// (protect) Activated a Dropbox Protect policy + case protectPolicyActivated + /// (protect) Deactivated a Dropbox Protect policy + case protectPolicyDeactivated + /// (protect) Scheduled a Dropbox Protect policy + case protectPolicyScheduled + /// (protect) Updated a Dropbox Protect policy + case protectPolicyUpdated + /// (protect) Viewed a Dropbox Protect report + case protectReportView /// (reports) Created Classification report case classificationCreateReport /// (reports) Couldn't create Classification report @@ -28154,6 +28310,10 @@ public class TeamLog { case teamBrandingPolicyChanged /// (team_policies) Changed App Integrations setting for team case teamExtensionsPolicyChanged + /// (team_policies) Changed external sharing controls activation state + case teamExternalSharingControlsActivationStateChanged + /// (team_policies) Changed approved or blocked entries for external sharing controls + case teamExternalSharingControlsRecipientListsChanged /// (team_policies) Changed team member storage request policy for team case teamMemberStorageRequestPolicyChanged /// (team_policies) Enabled/disabled Team Selective Sync for team @@ -29422,6 +29582,10 @@ public class TeamLog { var d = [String: JSON]() d[".tag"] = .str("protect_action_remove_collaborator") return .dictionary(d) + case .protectActionRemoveDomains: + var d = [String: JSON]() + d[".tag"] = .str("protect_action_remove_domains") + return .dictionary(d) case .protectActionRemoveLink: var d = [String: JSON]() d[".tag"] = .str("protect_action_remove_link") @@ -29434,6 +29598,26 @@ public class TeamLog { var d = [String: JSON]() d[".tag"] = .str("protect_internal_domains_changed") return .dictionary(d) + case .protectPolicyActivated: + var d = [String: JSON]() + d[".tag"] = .str("protect_policy_activated") + return .dictionary(d) + case .protectPolicyDeactivated: + var d = [String: JSON]() + d[".tag"] = .str("protect_policy_deactivated") + return .dictionary(d) + case .protectPolicyScheduled: + var d = [String: JSON]() + d[".tag"] = .str("protect_policy_scheduled") + return .dictionary(d) + case .protectPolicyUpdated: + var d = [String: JSON]() + d[".tag"] = .str("protect_policy_updated") + return .dictionary(d) + case .protectReportView: + var d = [String: JSON]() + d[".tag"] = .str("protect_report_view") + return .dictionary(d) case .classificationCreateReport: var d = [String: JSON]() d[".tag"] = .str("classification_create_report") @@ -30562,6 +30746,14 @@ public class TeamLog { var d = [String: JSON]() d[".tag"] = .str("team_extensions_policy_changed") return .dictionary(d) + case .teamExternalSharingControlsActivationStateChanged: + var d = [String: JSON]() + d[".tag"] = .str("team_external_sharing_controls_activation_state_changed") + return .dictionary(d) + case .teamExternalSharingControlsRecipientListsChanged: + var d = [String: JSON]() + d[".tag"] = .str("team_external_sharing_controls_recipient_lists_changed") + return .dictionary(d) case .teamMemberStorageRequestPolicyChanged: var d = [String: JSON]() d[".tag"] = .str("team_member_storage_request_policy_changed") @@ -31373,12 +31565,24 @@ public class TeamLog { return EventTypeArg.protectActionExport case "protect_action_remove_collaborator": return EventTypeArg.protectActionRemoveCollaborator + case "protect_action_remove_domains": + return EventTypeArg.protectActionRemoveDomains case "protect_action_remove_link": return EventTypeArg.protectActionRemoveLink case "protect_action_stop_sharing": return EventTypeArg.protectActionStopSharing case "protect_internal_domains_changed": return EventTypeArg.protectInternalDomainsChanged + case "protect_policy_activated": + return EventTypeArg.protectPolicyActivated + case "protect_policy_deactivated": + return EventTypeArg.protectPolicyDeactivated + case "protect_policy_scheduled": + return EventTypeArg.protectPolicyScheduled + case "protect_policy_updated": + return EventTypeArg.protectPolicyUpdated + case "protect_report_view": + return EventTypeArg.protectReportView case "classification_create_report": return EventTypeArg.classificationCreateReport case "classification_create_report_fail": @@ -31943,6 +32147,10 @@ public class TeamLog { return EventTypeArg.teamBrandingPolicyChanged case "team_extensions_policy_changed": return EventTypeArg.teamExtensionsPolicyChanged + case "team_external_sharing_controls_activation_state_changed": + return EventTypeArg.teamExternalSharingControlsActivationStateChanged + case "team_external_sharing_controls_recipient_lists_changed": + return EventTypeArg.teamExternalSharingControlsRecipientListsChanged case "team_member_storage_request_policy_changed": return EventTypeArg.teamMemberStorageRequestPolicyChanged case "team_selective_sync_policy_changed": @@ -32869,6 +33077,73 @@ public class TeamLog { } } + /// The ExternalSharingControlsActivationState union + public enum ExternalSharingControlsActivationState: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case active + /// An unspecified error. + case disabled + /// An unspecified error. + case legacy + /// An unspecified error. + case other + + func json() throws -> JSON { + try ExternalSharingControlsActivationStateSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ExternalSharingControlsActivationStateSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ExternalSharingControlsActivationState: \(error)" + } + } + } + public class ExternalSharingControlsActivationStateSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ExternalSharingControlsActivationState) throws -> JSON { + switch value { + case .active: + var d = [String: JSON]() + d[".tag"] = .str("active") + return .dictionary(d) + case .disabled: + var d = [String: JSON]() + d[".tag"] = .str("disabled") + return .dictionary(d) + case .legacy: + var d = [String: JSON]() + d[".tag"] = .str("legacy") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + public func deserialize(_ json: JSON) throws -> ExternalSharingControlsActivationState { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "active": + return ExternalSharingControlsActivationState.active + case "disabled": + return ExternalSharingControlsActivationState.disabled + case "legacy": + return ExternalSharingControlsActivationState.legacy + case "other": + return ExternalSharingControlsActivationState.other + default: + return ExternalSharingControlsActivationState.other + } + default: + throw JSONSerializerError.deserializeError(type: ExternalSharingControlsActivationState.self, json: json) + } + } + } + /// Created External sharing report. public class ExternalSharingCreateReportDetails: CustomStringConvertible, JSONRepresentable { @@ -44214,8 +44489,12 @@ public class TeamLog { public class MediaHubProjectTeamAddDetails: CustomStringConvertible, JSONRepresentable { /// Replay project. public let project: TeamLog.MediaHubProjectLogInfo? - public init(project: TeamLog.MediaHubProjectLogInfo? = nil) { + /// The email address of the Replay project member targeted by the event. + public let invitee: String? + public init(project: TeamLog.MediaHubProjectLogInfo? = nil, invitee: String? = nil) { self.project = project + nullableValidator(stringValidator(maxLength: 255))(invitee) + self.invitee = invitee } func json() throws -> JSON { @@ -44235,6 +44514,7 @@ public class TeamLog { public func serialize(_ value: MediaHubProjectTeamAddDetails) throws -> JSON { let output = [ "project": try NullableSerializer(TeamLog.MediaHubProjectLogInfoSerializer()).serialize(value.project), + "invitee": try NullableSerializer(Serialization._StringSerializer).serialize(value.invitee), ] return .dictionary(output) } @@ -44242,7 +44522,8 @@ public class TeamLog { switch json { case .dictionary(let dict): let project = try NullableSerializer(TeamLog.MediaHubProjectLogInfoSerializer()).deserialize(dict["project"] ?? .null) - return MediaHubProjectTeamAddDetails(project: project) + let invitee = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["invitee"] ?? .null) + return MediaHubProjectTeamAddDetails(project: project, invitee: invitee) default: throw JSONSerializerError.deserializeError(type: MediaHubProjectTeamAddDetails.self, json: json) } @@ -44293,8 +44574,12 @@ public class TeamLog { public class MediaHubProjectTeamDeleteDetails: CustomStringConvertible, JSONRepresentable { /// Replay project. public let project: TeamLog.MediaHubProjectLogInfo? - public init(project: TeamLog.MediaHubProjectLogInfo? = nil) { + /// The email address of the Replay project member targeted by the event. + public let invitee: String? + public init(project: TeamLog.MediaHubProjectLogInfo? = nil, invitee: String? = nil) { self.project = project + nullableValidator(stringValidator(maxLength: 255))(invitee) + self.invitee = invitee } func json() throws -> JSON { @@ -44314,6 +44599,7 @@ public class TeamLog { public func serialize(_ value: MediaHubProjectTeamDeleteDetails) throws -> JSON { let output = [ "project": try NullableSerializer(TeamLog.MediaHubProjectLogInfoSerializer()).serialize(value.project), + "invitee": try NullableSerializer(Serialization._StringSerializer).serialize(value.invitee), ] return .dictionary(output) } @@ -44321,7 +44607,8 @@ public class TeamLog { switch json { case .dictionary(let dict): let project = try NullableSerializer(TeamLog.MediaHubProjectLogInfoSerializer()).deserialize(dict["project"] ?? .null) - return MediaHubProjectTeamDeleteDetails(project: project) + let invitee = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["invitee"] ?? .null) + return MediaHubProjectTeamDeleteDetails(project: project, invitee: invitee) default: throw JSONSerializerError.deserializeError(type: MediaHubProjectTeamDeleteDetails.self, json: json) } @@ -44376,10 +44663,14 @@ public class TeamLog { public let newRole: TeamLog.MediaHubProjectRole /// Replay project. public let project: TeamLog.MediaHubProjectLogInfo? - public init(previousRole: TeamLog.MediaHubProjectRole, newRole: TeamLog.MediaHubProjectRole, project: TeamLog.MediaHubProjectLogInfo? = nil) { + /// The email address of the Replay project member targeted by the event. + public let invitee: String? + public init(previousRole: TeamLog.MediaHubProjectRole, newRole: TeamLog.MediaHubProjectRole, project: TeamLog.MediaHubProjectLogInfo? = nil, invitee: String? = nil) { self.previousRole = previousRole self.newRole = newRole self.project = project + nullableValidator(stringValidator(maxLength: 255))(invitee) + self.invitee = invitee } func json() throws -> JSON { @@ -44401,6 +44692,7 @@ public class TeamLog { "previous_role": try TeamLog.MediaHubProjectRoleSerializer().serialize(value.previousRole), "new_role": try TeamLog.MediaHubProjectRoleSerializer().serialize(value.newRole), "project": try NullableSerializer(TeamLog.MediaHubProjectLogInfoSerializer()).serialize(value.project), + "invitee": try NullableSerializer(Serialization._StringSerializer).serialize(value.invitee), ] return .dictionary(output) } @@ -44410,7 +44702,8 @@ public class TeamLog { let previousRole = try TeamLog.MediaHubProjectRoleSerializer().deserialize(dict["previous_role"] ?? .null) let newRole = try TeamLog.MediaHubProjectRoleSerializer().deserialize(dict["new_role"] ?? .null) let project = try NullableSerializer(TeamLog.MediaHubProjectLogInfoSerializer()).deserialize(dict["project"] ?? .null) - return MediaHubProjectTeamRoleChangedDetails(previousRole: previousRole, newRole: newRole, project: project) + let invitee = try NullableSerializer(Serialization._StringSerializer).deserialize(dict["invitee"] ?? .null) + return MediaHubProjectTeamRoleChangedDetails(previousRole: previousRole, newRole: newRole, project: project, invitee: invitee) default: throw JSONSerializerError.deserializeError(type: MediaHubProjectTeamRoleChangedDetails.self, json: json) } @@ -44464,6 +44757,8 @@ public class TeamLog { /// An unspecified error. case public_ /// An unspecified error. + case publicLoggedInOnly + /// An unspecified error. case teamOnly /// An unspecified error. case other @@ -44492,6 +44787,10 @@ public class TeamLog { var d = [String: JSON]() d[".tag"] = .str("public") return .dictionary(d) + case .publicLoggedInOnly: + var d = [String: JSON]() + d[".tag"] = .str("public_logged_in_only") + return .dictionary(d) case .teamOnly: var d = [String: JSON]() d[".tag"] = .str("team_only") @@ -44511,6 +44810,8 @@ public class TeamLog { return MediaHubSharedLinkAudience.noOne case "public": return MediaHubSharedLinkAudience.public_ + case "public_logged_in_only": + return MediaHubSharedLinkAudience.publicLoggedInOnly case "team_only": return MediaHubSharedLinkAudience.teamOnly case "other": @@ -56813,6 +57114,86 @@ public class TeamLog { } } + /// Removed domains via Dropbox Protect. + public class ProtectActionRemoveDomainsDetails: CustomStringConvertible, JSONRepresentable { + /// Action ID. + public let actionId: String + public init(actionId: String) { + stringValidator()(actionId) + self.actionId = actionId + } + + func json() throws -> JSON { + try ProtectActionRemoveDomainsDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectActionRemoveDomainsDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectActionRemoveDomainsDetails: \(error)" + } + } + } + public class ProtectActionRemoveDomainsDetailsSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectActionRemoveDomainsDetails) throws -> JSON { + let output = [ + "action_id": try Serialization._StringSerializer.serialize(value.actionId), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectActionRemoveDomainsDetails { + switch json { + case .dictionary(let dict): + let actionId = try Serialization._StringSerializer.deserialize(dict["action_id"] ?? .null) + return ProtectActionRemoveDomainsDetails(actionId: actionId) + default: + throw JSONSerializerError.deserializeError(type: ProtectActionRemoveDomainsDetails.self, json: json) + } + } + } + + /// The ProtectActionRemoveDomainsType struct + public class ProtectActionRemoveDomainsType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try ProtectActionRemoveDomainsTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectActionRemoveDomainsTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectActionRemoveDomainsType: \(error)" + } + } + } + public class ProtectActionRemoveDomainsTypeSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectActionRemoveDomainsType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectActionRemoveDomainsType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ProtectActionRemoveDomainsType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ProtectActionRemoveDomainsType.self, json: json) + } + } + } + /// Removed a link via Dropbox Protect. public class ProtectActionRemoveLinkDetails: CustomStringConvertible, JSONRepresentable { /// Action ID. @@ -57059,6 +57440,1056 @@ public class TeamLog { } } + /// Activated a Dropbox Protect policy. + public class ProtectPolicyActivatedDetails: CustomStringConvertible, JSONRepresentable { + /// Policy ID. + public let policyId: String + public init(policyId: String) { + stringValidator()(policyId) + self.policyId = policyId + } + + func json() throws -> JSON { + try ProtectPolicyActivatedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectPolicyActivatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectPolicyActivatedDetails: \(error)" + } + } + } + public class ProtectPolicyActivatedDetailsSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectPolicyActivatedDetails) throws -> JSON { + let output = [ + "policy_id": try Serialization._StringSerializer.serialize(value.policyId), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectPolicyActivatedDetails { + switch json { + case .dictionary(let dict): + let policyId = try Serialization._StringSerializer.deserialize(dict["policy_id"] ?? .null) + return ProtectPolicyActivatedDetails(policyId: policyId) + default: + throw JSONSerializerError.deserializeError(type: ProtectPolicyActivatedDetails.self, json: json) + } + } + } + + /// The ProtectPolicyActivatedType struct + public class ProtectPolicyActivatedType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try ProtectPolicyActivatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectPolicyActivatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectPolicyActivatedType: \(error)" + } + } + } + public class ProtectPolicyActivatedTypeSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectPolicyActivatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectPolicyActivatedType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ProtectPolicyActivatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ProtectPolicyActivatedType.self, json: json) + } + } + } + + /// Deactivated a Dropbox Protect policy. + public class ProtectPolicyDeactivatedDetails: CustomStringConvertible, JSONRepresentable { + /// Policy ID. + public let policyId: String + public init(policyId: String) { + stringValidator()(policyId) + self.policyId = policyId + } + + func json() throws -> JSON { + try ProtectPolicyDeactivatedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectPolicyDeactivatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectPolicyDeactivatedDetails: \(error)" + } + } + } + public class ProtectPolicyDeactivatedDetailsSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectPolicyDeactivatedDetails) throws -> JSON { + let output = [ + "policy_id": try Serialization._StringSerializer.serialize(value.policyId), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectPolicyDeactivatedDetails { + switch json { + case .dictionary(let dict): + let policyId = try Serialization._StringSerializer.deserialize(dict["policy_id"] ?? .null) + return ProtectPolicyDeactivatedDetails(policyId: policyId) + default: + throw JSONSerializerError.deserializeError(type: ProtectPolicyDeactivatedDetails.self, json: json) + } + } + } + + /// The ProtectPolicyDeactivatedType struct + public class ProtectPolicyDeactivatedType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try ProtectPolicyDeactivatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectPolicyDeactivatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectPolicyDeactivatedType: \(error)" + } + } + } + public class ProtectPolicyDeactivatedTypeSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectPolicyDeactivatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectPolicyDeactivatedType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ProtectPolicyDeactivatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ProtectPolicyDeactivatedType.self, json: json) + } + } + } + + /// Scheduled a Dropbox Protect policy. + public class ProtectPolicyScheduledDetails: CustomStringConvertible, JSONRepresentable { + /// Policy ID. + public let policyId: String + public init(policyId: String) { + stringValidator()(policyId) + self.policyId = policyId + } + + func json() throws -> JSON { + try ProtectPolicyScheduledDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectPolicyScheduledDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectPolicyScheduledDetails: \(error)" + } + } + } + public class ProtectPolicyScheduledDetailsSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectPolicyScheduledDetails) throws -> JSON { + let output = [ + "policy_id": try Serialization._StringSerializer.serialize(value.policyId), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectPolicyScheduledDetails { + switch json { + case .dictionary(let dict): + let policyId = try Serialization._StringSerializer.deserialize(dict["policy_id"] ?? .null) + return ProtectPolicyScheduledDetails(policyId: policyId) + default: + throw JSONSerializerError.deserializeError(type: ProtectPolicyScheduledDetails.self, json: json) + } + } + } + + /// The ProtectPolicyScheduledType struct + public class ProtectPolicyScheduledType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try ProtectPolicyScheduledTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectPolicyScheduledTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectPolicyScheduledType: \(error)" + } + } + } + public class ProtectPolicyScheduledTypeSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectPolicyScheduledType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectPolicyScheduledType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ProtectPolicyScheduledType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ProtectPolicyScheduledType.self, json: json) + } + } + } + + /// Updated a Dropbox Protect policy. + public class ProtectPolicyUpdatedDetails: CustomStringConvertible, JSONRepresentable { + /// Policy ID. + public let policyId: String + public init(policyId: String) { + stringValidator()(policyId) + self.policyId = policyId + } + + func json() throws -> JSON { + try ProtectPolicyUpdatedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectPolicyUpdatedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectPolicyUpdatedDetails: \(error)" + } + } + } + public class ProtectPolicyUpdatedDetailsSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectPolicyUpdatedDetails) throws -> JSON { + let output = [ + "policy_id": try Serialization._StringSerializer.serialize(value.policyId), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectPolicyUpdatedDetails { + switch json { + case .dictionary(let dict): + let policyId = try Serialization._StringSerializer.deserialize(dict["policy_id"] ?? .null) + return ProtectPolicyUpdatedDetails(policyId: policyId) + default: + throw JSONSerializerError.deserializeError(type: ProtectPolicyUpdatedDetails.self, json: json) + } + } + } + + /// The ProtectPolicyUpdatedType struct + public class ProtectPolicyUpdatedType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try ProtectPolicyUpdatedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectPolicyUpdatedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectPolicyUpdatedType: \(error)" + } + } + } + public class ProtectPolicyUpdatedTypeSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectPolicyUpdatedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectPolicyUpdatedType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ProtectPolicyUpdatedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ProtectPolicyUpdatedType.self, json: json) + } + } + } + + /// The category that a Dropbox Protect report belongs to + public enum ProtectReportCategory: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case overview + /// An unspecified error. + case staleAccess + /// An unspecified error. + case other + + func json() throws -> JSON { + try ProtectReportCategorySerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectReportCategorySerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectReportCategory: \(error)" + } + } + } + public class ProtectReportCategorySerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectReportCategory) throws -> JSON { + switch value { + case .overview: + var d = [String: JSON]() + d[".tag"] = .str("overview") + return .dictionary(d) + case .staleAccess: + var d = [String: JSON]() + d[".tag"] = .str("stale_access") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + public func deserialize(_ json: JSON) throws -> ProtectReportCategory { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "overview": + return ProtectReportCategory.overview + case "stale_access": + return ProtectReportCategory.staleAccess + case "other": + return ProtectReportCategory.other + default: + return ProtectReportCategory.other + } + default: + throw JSONSerializerError.deserializeError(type: ProtectReportCategory.self, json: json) + } + } + } + + /// The metric that a Dropbox Protect report corresponds to + public enum ProtectReportMetric: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case externalModifiedOver1Year + /// An unspecified error. + case externalModifiedOver1YearCompany + /// An unspecified error. + case externalModifiedOver1YearOutside + /// An unspecified error. + case externalModifiedOver1YearPersonal + /// An unspecified error. + case externalModifiedOver1YearPublic + /// An unspecified error. + case externalModifiedOver2Years + /// An unspecified error. + case externalModifiedOver2YearsCompany + /// An unspecified error. + case externalModifiedOver2YearsOutside + /// An unspecified error. + case externalModifiedOver2YearsPersonal + /// An unspecified error. + case externalModifiedOver2YearsPublic + /// An unspecified error. + case externalModifiedOver3Years + /// An unspecified error. + case externalModifiedOver3YearsCompany + /// An unspecified error. + case externalModifiedOver3YearsOutside + /// An unspecified error. + case externalModifiedOver3YearsPersonal + /// An unspecified error. + case externalModifiedOver3YearsPublic + /// An unspecified error. + case externalModifiedOver5Years + /// An unspecified error. + case externalModifiedOver5YearsCompany + /// An unspecified error. + case externalModifiedOver5YearsOutside + /// An unspecified error. + case externalModifiedOver5YearsPersonal + /// An unspecified error. + case externalModifiedOver5YearsPublic + /// An unspecified error. + case foldersCompany + /// An unspecified error. + case foldersInternal + /// An unspecified error. + case foldersOutside + /// An unspecified error. + case foldersPersonal + /// An unspecified error. + case foldersPublic + /// An unspecified error. + case internalModifiedOver1Year + /// An unspecified error. + case internalModifiedOver1YearCompany + /// An unspecified error. + case internalModifiedOver1YearOutside + /// An unspecified error. + case internalModifiedOver1YearPersonal + /// An unspecified error. + case internalModifiedOver1YearPublic + /// An unspecified error. + case internalModifiedOver2Years + /// An unspecified error. + case internalModifiedOver2YearsCompany + /// An unspecified error. + case internalModifiedOver2YearsOutside + /// An unspecified error. + case internalModifiedOver2YearsPersonal + /// An unspecified error. + case internalModifiedOver2YearsPublic + /// An unspecified error. + case internalModifiedOver3Years + /// An unspecified error. + case internalModifiedOver3YearsCompany + /// An unspecified error. + case internalModifiedOver3YearsOutside + /// An unspecified error. + case internalModifiedOver3YearsPersonal + /// An unspecified error. + case internalModifiedOver3YearsPublic + /// An unspecified error. + case internalModifiedOver5Years + /// An unspecified error. + case internalModifiedOver5YearsCompany + /// An unspecified error. + case internalModifiedOver5YearsOutside + /// An unspecified error. + case internalModifiedOver5YearsPersonal + /// An unspecified error. + case internalModifiedOver5YearsPublic + /// An unspecified error. + case itemsAll + /// An unspecified error. + case itemsCompanyAccess + /// An unspecified error. + case itemsInternallyOwned + /// An unspecified error. + case itemsModifiedOver1Year + /// An unspecified error. + case itemsModifiedOver3Years + /// An unspecified error. + case itemsOutsideAccess + /// An unspecified error. + case itemsPersonalAccess + /// An unspecified error. + case itemsPublicLinks + /// An unspecified error. + case otherFolders + /// An unspecified error. + case otherSharedDrives + /// An unspecified error. + case sharedDrivesInternal + /// An unspecified error. + case sharedDrivesOutside + /// An unspecified error. + case sharedDrivesPersonal + /// An unspecified error. + case other + + func json() throws -> JSON { + try ProtectReportMetricSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectReportMetricSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectReportMetric: \(error)" + } + } + } + public class ProtectReportMetricSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectReportMetric) throws -> JSON { + switch value { + case .externalModifiedOver1Year: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_1_year") + return .dictionary(d) + case .externalModifiedOver1YearCompany: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_1_year_company") + return .dictionary(d) + case .externalModifiedOver1YearOutside: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_1_year_outside") + return .dictionary(d) + case .externalModifiedOver1YearPersonal: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_1_year_personal") + return .dictionary(d) + case .externalModifiedOver1YearPublic: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_1_year_public") + return .dictionary(d) + case .externalModifiedOver2Years: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_2_years") + return .dictionary(d) + case .externalModifiedOver2YearsCompany: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_2_years_company") + return .dictionary(d) + case .externalModifiedOver2YearsOutside: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_2_years_outside") + return .dictionary(d) + case .externalModifiedOver2YearsPersonal: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_2_years_personal") + return .dictionary(d) + case .externalModifiedOver2YearsPublic: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_2_years_public") + return .dictionary(d) + case .externalModifiedOver3Years: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_3_years") + return .dictionary(d) + case .externalModifiedOver3YearsCompany: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_3_years_company") + return .dictionary(d) + case .externalModifiedOver3YearsOutside: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_3_years_outside") + return .dictionary(d) + case .externalModifiedOver3YearsPersonal: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_3_years_personal") + return .dictionary(d) + case .externalModifiedOver3YearsPublic: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_3_years_public") + return .dictionary(d) + case .externalModifiedOver5Years: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_5_years") + return .dictionary(d) + case .externalModifiedOver5YearsCompany: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_5_years_company") + return .dictionary(d) + case .externalModifiedOver5YearsOutside: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_5_years_outside") + return .dictionary(d) + case .externalModifiedOver5YearsPersonal: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_5_years_personal") + return .dictionary(d) + case .externalModifiedOver5YearsPublic: + var d = [String: JSON]() + d[".tag"] = .str("external_modified_over_5_years_public") + return .dictionary(d) + case .foldersCompany: + var d = [String: JSON]() + d[".tag"] = .str("folders_company") + return .dictionary(d) + case .foldersInternal: + var d = [String: JSON]() + d[".tag"] = .str("folders_internal") + return .dictionary(d) + case .foldersOutside: + var d = [String: JSON]() + d[".tag"] = .str("folders_outside") + return .dictionary(d) + case .foldersPersonal: + var d = [String: JSON]() + d[".tag"] = .str("folders_personal") + return .dictionary(d) + case .foldersPublic: + var d = [String: JSON]() + d[".tag"] = .str("folders_public") + return .dictionary(d) + case .internalModifiedOver1Year: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_1_year") + return .dictionary(d) + case .internalModifiedOver1YearCompany: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_1_year_company") + return .dictionary(d) + case .internalModifiedOver1YearOutside: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_1_year_outside") + return .dictionary(d) + case .internalModifiedOver1YearPersonal: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_1_year_personal") + return .dictionary(d) + case .internalModifiedOver1YearPublic: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_1_year_public") + return .dictionary(d) + case .internalModifiedOver2Years: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_2_years") + return .dictionary(d) + case .internalModifiedOver2YearsCompany: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_2_years_company") + return .dictionary(d) + case .internalModifiedOver2YearsOutside: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_2_years_outside") + return .dictionary(d) + case .internalModifiedOver2YearsPersonal: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_2_years_personal") + return .dictionary(d) + case .internalModifiedOver2YearsPublic: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_2_years_public") + return .dictionary(d) + case .internalModifiedOver3Years: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_3_years") + return .dictionary(d) + case .internalModifiedOver3YearsCompany: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_3_years_company") + return .dictionary(d) + case .internalModifiedOver3YearsOutside: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_3_years_outside") + return .dictionary(d) + case .internalModifiedOver3YearsPersonal: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_3_years_personal") + return .dictionary(d) + case .internalModifiedOver3YearsPublic: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_3_years_public") + return .dictionary(d) + case .internalModifiedOver5Years: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_5_years") + return .dictionary(d) + case .internalModifiedOver5YearsCompany: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_5_years_company") + return .dictionary(d) + case .internalModifiedOver5YearsOutside: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_5_years_outside") + return .dictionary(d) + case .internalModifiedOver5YearsPersonal: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_5_years_personal") + return .dictionary(d) + case .internalModifiedOver5YearsPublic: + var d = [String: JSON]() + d[".tag"] = .str("internal_modified_over_5_years_public") + return .dictionary(d) + case .itemsAll: + var d = [String: JSON]() + d[".tag"] = .str("items_all") + return .dictionary(d) + case .itemsCompanyAccess: + var d = [String: JSON]() + d[".tag"] = .str("items_company_access") + return .dictionary(d) + case .itemsInternallyOwned: + var d = [String: JSON]() + d[".tag"] = .str("items_internally_owned") + return .dictionary(d) + case .itemsModifiedOver1Year: + var d = [String: JSON]() + d[".tag"] = .str("items_modified_over_1_year") + return .dictionary(d) + case .itemsModifiedOver3Years: + var d = [String: JSON]() + d[".tag"] = .str("items_modified_over_3_years") + return .dictionary(d) + case .itemsOutsideAccess: + var d = [String: JSON]() + d[".tag"] = .str("items_outside_access") + return .dictionary(d) + case .itemsPersonalAccess: + var d = [String: JSON]() + d[".tag"] = .str("items_personal_access") + return .dictionary(d) + case .itemsPublicLinks: + var d = [String: JSON]() + d[".tag"] = .str("items_public_links") + return .dictionary(d) + case .otherFolders: + var d = [String: JSON]() + d[".tag"] = .str("other_folders") + return .dictionary(d) + case .otherSharedDrives: + var d = [String: JSON]() + d[".tag"] = .str("other_shared_drives") + return .dictionary(d) + case .sharedDrivesInternal: + var d = [String: JSON]() + d[".tag"] = .str("shared_drives_internal") + return .dictionary(d) + case .sharedDrivesOutside: + var d = [String: JSON]() + d[".tag"] = .str("shared_drives_outside") + return .dictionary(d) + case .sharedDrivesPersonal: + var d = [String: JSON]() + d[".tag"] = .str("shared_drives_personal") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + public func deserialize(_ json: JSON) throws -> ProtectReportMetric { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "external_modified_over_1_year": + return ProtectReportMetric.externalModifiedOver1Year + case "external_modified_over_1_year_company": + return ProtectReportMetric.externalModifiedOver1YearCompany + case "external_modified_over_1_year_outside": + return ProtectReportMetric.externalModifiedOver1YearOutside + case "external_modified_over_1_year_personal": + return ProtectReportMetric.externalModifiedOver1YearPersonal + case "external_modified_over_1_year_public": + return ProtectReportMetric.externalModifiedOver1YearPublic + case "external_modified_over_2_years": + return ProtectReportMetric.externalModifiedOver2Years + case "external_modified_over_2_years_company": + return ProtectReportMetric.externalModifiedOver2YearsCompany + case "external_modified_over_2_years_outside": + return ProtectReportMetric.externalModifiedOver2YearsOutside + case "external_modified_over_2_years_personal": + return ProtectReportMetric.externalModifiedOver2YearsPersonal + case "external_modified_over_2_years_public": + return ProtectReportMetric.externalModifiedOver2YearsPublic + case "external_modified_over_3_years": + return ProtectReportMetric.externalModifiedOver3Years + case "external_modified_over_3_years_company": + return ProtectReportMetric.externalModifiedOver3YearsCompany + case "external_modified_over_3_years_outside": + return ProtectReportMetric.externalModifiedOver3YearsOutside + case "external_modified_over_3_years_personal": + return ProtectReportMetric.externalModifiedOver3YearsPersonal + case "external_modified_over_3_years_public": + return ProtectReportMetric.externalModifiedOver3YearsPublic + case "external_modified_over_5_years": + return ProtectReportMetric.externalModifiedOver5Years + case "external_modified_over_5_years_company": + return ProtectReportMetric.externalModifiedOver5YearsCompany + case "external_modified_over_5_years_outside": + return ProtectReportMetric.externalModifiedOver5YearsOutside + case "external_modified_over_5_years_personal": + return ProtectReportMetric.externalModifiedOver5YearsPersonal + case "external_modified_over_5_years_public": + return ProtectReportMetric.externalModifiedOver5YearsPublic + case "folders_company": + return ProtectReportMetric.foldersCompany + case "folders_internal": + return ProtectReportMetric.foldersInternal + case "folders_outside": + return ProtectReportMetric.foldersOutside + case "folders_personal": + return ProtectReportMetric.foldersPersonal + case "folders_public": + return ProtectReportMetric.foldersPublic + case "internal_modified_over_1_year": + return ProtectReportMetric.internalModifiedOver1Year + case "internal_modified_over_1_year_company": + return ProtectReportMetric.internalModifiedOver1YearCompany + case "internal_modified_over_1_year_outside": + return ProtectReportMetric.internalModifiedOver1YearOutside + case "internal_modified_over_1_year_personal": + return ProtectReportMetric.internalModifiedOver1YearPersonal + case "internal_modified_over_1_year_public": + return ProtectReportMetric.internalModifiedOver1YearPublic + case "internal_modified_over_2_years": + return ProtectReportMetric.internalModifiedOver2Years + case "internal_modified_over_2_years_company": + return ProtectReportMetric.internalModifiedOver2YearsCompany + case "internal_modified_over_2_years_outside": + return ProtectReportMetric.internalModifiedOver2YearsOutside + case "internal_modified_over_2_years_personal": + return ProtectReportMetric.internalModifiedOver2YearsPersonal + case "internal_modified_over_2_years_public": + return ProtectReportMetric.internalModifiedOver2YearsPublic + case "internal_modified_over_3_years": + return ProtectReportMetric.internalModifiedOver3Years + case "internal_modified_over_3_years_company": + return ProtectReportMetric.internalModifiedOver3YearsCompany + case "internal_modified_over_3_years_outside": + return ProtectReportMetric.internalModifiedOver3YearsOutside + case "internal_modified_over_3_years_personal": + return ProtectReportMetric.internalModifiedOver3YearsPersonal + case "internal_modified_over_3_years_public": + return ProtectReportMetric.internalModifiedOver3YearsPublic + case "internal_modified_over_5_years": + return ProtectReportMetric.internalModifiedOver5Years + case "internal_modified_over_5_years_company": + return ProtectReportMetric.internalModifiedOver5YearsCompany + case "internal_modified_over_5_years_outside": + return ProtectReportMetric.internalModifiedOver5YearsOutside + case "internal_modified_over_5_years_personal": + return ProtectReportMetric.internalModifiedOver5YearsPersonal + case "internal_modified_over_5_years_public": + return ProtectReportMetric.internalModifiedOver5YearsPublic + case "items_all": + return ProtectReportMetric.itemsAll + case "items_company_access": + return ProtectReportMetric.itemsCompanyAccess + case "items_internally_owned": + return ProtectReportMetric.itemsInternallyOwned + case "items_modified_over_1_year": + return ProtectReportMetric.itemsModifiedOver1Year + case "items_modified_over_3_years": + return ProtectReportMetric.itemsModifiedOver3Years + case "items_outside_access": + return ProtectReportMetric.itemsOutsideAccess + case "items_personal_access": + return ProtectReportMetric.itemsPersonalAccess + case "items_public_links": + return ProtectReportMetric.itemsPublicLinks + case "other_folders": + return ProtectReportMetric.otherFolders + case "other_shared_drives": + return ProtectReportMetric.otherSharedDrives + case "shared_drives_internal": + return ProtectReportMetric.sharedDrivesInternal + case "shared_drives_outside": + return ProtectReportMetric.sharedDrivesOutside + case "shared_drives_personal": + return ProtectReportMetric.sharedDrivesPersonal + case "other": + return ProtectReportMetric.other + default: + return ProtectReportMetric.other + } + default: + throw JSONSerializerError.deserializeError(type: ProtectReportMetric.self, json: json) + } + } + } + + /// The section that a Dropbox Protect report belongs to + public enum ProtectReportSection: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case items + /// An unspecified error. + case overviewOther + /// An unspecified error. + case ownedExternally + /// An unspecified error. + case ownedInternally + /// An unspecified error. + case other + + func json() throws -> JSON { + try ProtectReportSectionSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectReportSectionSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectReportSection: \(error)" + } + } + } + public class ProtectReportSectionSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectReportSection) throws -> JSON { + switch value { + case .items: + var d = [String: JSON]() + d[".tag"] = .str("items") + return .dictionary(d) + case .overviewOther: + var d = [String: JSON]() + d[".tag"] = .str("overview_other") + return .dictionary(d) + case .ownedExternally: + var d = [String: JSON]() + d[".tag"] = .str("owned_externally") + return .dictionary(d) + case .ownedInternally: + var d = [String: JSON]() + d[".tag"] = .str("owned_internally") + return .dictionary(d) + case .other: + var d = [String: JSON]() + d[".tag"] = .str("other") + return .dictionary(d) + } + } + public func deserialize(_ json: JSON) throws -> ProtectReportSection { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "items": + return ProtectReportSection.items + case "overview_other": + return ProtectReportSection.overviewOther + case "owned_externally": + return ProtectReportSection.ownedExternally + case "owned_internally": + return ProtectReportSection.ownedInternally + case "other": + return ProtectReportSection.other + default: + return ProtectReportSection.other + } + default: + throw JSONSerializerError.deserializeError(type: ProtectReportSection.self, json: json) + } + } + } + + /// Viewed a Dropbox Protect report. + public class ProtectReportViewDetails: CustomStringConvertible, JSONRepresentable { + /// The category of the report that was viewed. + public let reportCategory: TeamLog.ProtectReportCategory + /// The section of the report that was viewed. + public let reportSection: TeamLog.ProtectReportSection? + /// The metric of the report that was viewed. + public let reportMetric: TeamLog.ProtectReportMetric? + public init(reportCategory: TeamLog.ProtectReportCategory, reportSection: TeamLog.ProtectReportSection? = nil, reportMetric: TeamLog.ProtectReportMetric? = nil) { + self.reportCategory = reportCategory + self.reportSection = reportSection + self.reportMetric = reportMetric + } + + func json() throws -> JSON { + try ProtectReportViewDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectReportViewDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectReportViewDetails: \(error)" + } + } + } + public class ProtectReportViewDetailsSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectReportViewDetails) throws -> JSON { + let output = [ + "report_category": try TeamLog.ProtectReportCategorySerializer().serialize(value.reportCategory), + "report_section": try NullableSerializer(TeamLog.ProtectReportSectionSerializer()).serialize(value.reportSection), + "report_metric": try NullableSerializer(TeamLog.ProtectReportMetricSerializer()).serialize(value.reportMetric), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectReportViewDetails { + switch json { + case .dictionary(let dict): + let reportCategory = try TeamLog.ProtectReportCategorySerializer().deserialize(dict["report_category"] ?? .null) + let reportSection = try NullableSerializer(TeamLog.ProtectReportSectionSerializer()).deserialize(dict["report_section"] ?? .null) + let reportMetric = try NullableSerializer(TeamLog.ProtectReportMetricSerializer()).deserialize(dict["report_metric"] ?? .null) + return ProtectReportViewDetails(reportCategory: reportCategory, reportSection: reportSection, reportMetric: reportMetric) + default: + throw JSONSerializerError.deserializeError(type: ProtectReportViewDetails.self, json: json) + } + } + } + + /// The ProtectReportViewType struct + public class ProtectReportViewType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try ProtectReportViewTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try ProtectReportViewTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for ProtectReportViewType: \(error)" + } + } + } + public class ProtectReportViewTypeSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: ProtectReportViewType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> ProtectReportViewType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return ProtectReportViewType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: ProtectReportViewType.self, json: json) + } + } + } + /// Quick action type. public enum QuickActionType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. @@ -74459,6 +75890,188 @@ public class TeamLog { } } + /// Changed external sharing controls activation state. + public class TeamExternalSharingControlsActivationStateChangedDetails: CustomStringConvertible, JSONRepresentable { + /// Previous external sharing controls activation state. + public let previousActivationState: TeamLog.ExternalSharingControlsActivationState + /// New external sharing controls activation state. + public let newActivationState: TeamLog.ExternalSharingControlsActivationState + public init(previousActivationState: TeamLog.ExternalSharingControlsActivationState, newActivationState: TeamLog.ExternalSharingControlsActivationState) { + self.previousActivationState = previousActivationState + self.newActivationState = newActivationState + } + + func json() throws -> JSON { + try TeamExternalSharingControlsActivationStateChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamExternalSharingControlsActivationStateChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamExternalSharingControlsActivationStateChangedDetails: \(error)" + } + } + } + public class TeamExternalSharingControlsActivationStateChangedDetailsSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: TeamExternalSharingControlsActivationStateChangedDetails) throws -> JSON { + let output = [ + "previous_activation_state": try TeamLog.ExternalSharingControlsActivationStateSerializer().serialize(value.previousActivationState), + "new_activation_state": try TeamLog.ExternalSharingControlsActivationStateSerializer().serialize(value.newActivationState), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> TeamExternalSharingControlsActivationStateChangedDetails { + switch json { + case .dictionary(let dict): + let previousActivationState = try TeamLog.ExternalSharingControlsActivationStateSerializer().deserialize(dict["previous_activation_state"] ?? .null) + let newActivationState = try TeamLog.ExternalSharingControlsActivationStateSerializer().deserialize(dict["new_activation_state"] ?? .null) + return TeamExternalSharingControlsActivationStateChangedDetails(previousActivationState: previousActivationState, newActivationState: newActivationState) + default: + throw JSONSerializerError.deserializeError(type: TeamExternalSharingControlsActivationStateChangedDetails.self, json: json) + } + } + } + + /// The TeamExternalSharingControlsActivationStateChangedType struct + public class TeamExternalSharingControlsActivationStateChangedType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try TeamExternalSharingControlsActivationStateChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamExternalSharingControlsActivationStateChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamExternalSharingControlsActivationStateChangedType: \(error)" + } + } + } + public class TeamExternalSharingControlsActivationStateChangedTypeSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: TeamExternalSharingControlsActivationStateChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> TeamExternalSharingControlsActivationStateChangedType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamExternalSharingControlsActivationStateChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamExternalSharingControlsActivationStateChangedType.self, json: json) + } + } + } + + /// Changed approved or blocked entries for external sharing controls. + public class TeamExternalSharingControlsRecipientListsChangedDetails: CustomStringConvertible, JSONRepresentable { + /// Added approved external sharing recipient entries. + public let addedApprovedEntries: Array? + /// Removed approved external sharing recipient entries. + public let removedApprovedEntries: Array? + /// Added blocked external sharing recipient entries. + public let addedBlockedEntries: Array? + /// Removed blocked external sharing recipient entries. + public let removedBlockedEntries: Array? + public init(addedApprovedEntries: Array? = nil, removedApprovedEntries: Array? = nil, addedBlockedEntries: Array? = nil, removedBlockedEntries: Array? = nil) { + nullableValidator(arrayValidator(minItems: 1, itemValidator: stringValidator()))(addedApprovedEntries) + self.addedApprovedEntries = addedApprovedEntries + nullableValidator(arrayValidator(minItems: 1, itemValidator: stringValidator()))(removedApprovedEntries) + self.removedApprovedEntries = removedApprovedEntries + nullableValidator(arrayValidator(minItems: 1, itemValidator: stringValidator()))(addedBlockedEntries) + self.addedBlockedEntries = addedBlockedEntries + nullableValidator(arrayValidator(minItems: 1, itemValidator: stringValidator()))(removedBlockedEntries) + self.removedBlockedEntries = removedBlockedEntries + } + + func json() throws -> JSON { + try TeamExternalSharingControlsRecipientListsChangedDetailsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamExternalSharingControlsRecipientListsChangedDetailsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamExternalSharingControlsRecipientListsChangedDetails: \(error)" + } + } + } + public class TeamExternalSharingControlsRecipientListsChangedDetailsSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: TeamExternalSharingControlsRecipientListsChangedDetails) throws -> JSON { + let output = [ + "added_approved_entries": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.addedApprovedEntries), + "removed_approved_entries": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.removedApprovedEntries), + "added_blocked_entries": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.addedBlockedEntries), + "removed_blocked_entries": try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).serialize(value.removedBlockedEntries), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> TeamExternalSharingControlsRecipientListsChangedDetails { + switch json { + case .dictionary(let dict): + let addedApprovedEntries = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["added_approved_entries"] ?? .null) + let removedApprovedEntries = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["removed_approved_entries"] ?? .null) + let addedBlockedEntries = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["added_blocked_entries"] ?? .null) + let removedBlockedEntries = try NullableSerializer(ArraySerializer(Serialization._StringSerializer)).deserialize(dict["removed_blocked_entries"] ?? .null) + return TeamExternalSharingControlsRecipientListsChangedDetails(addedApprovedEntries: addedApprovedEntries, removedApprovedEntries: removedApprovedEntries, addedBlockedEntries: addedBlockedEntries, removedBlockedEntries: removedBlockedEntries) + default: + throw JSONSerializerError.deserializeError(type: TeamExternalSharingControlsRecipientListsChangedDetails.self, json: json) + } + } + } + + /// The TeamExternalSharingControlsRecipientListsChangedType struct + public class TeamExternalSharingControlsRecipientListsChangedType: CustomStringConvertible, JSONRepresentable { + /// (no description) + public let description_: String + public init(description_: String) { + stringValidator()(description_) + self.description_ = description_ + } + + func json() throws -> JSON { + try TeamExternalSharingControlsRecipientListsChangedTypeSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TeamExternalSharingControlsRecipientListsChangedTypeSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TeamExternalSharingControlsRecipientListsChangedType: \(error)" + } + } + } + public class TeamExternalSharingControlsRecipientListsChangedTypeSerializer: JSONSerializer { + public init() { } + public func serialize(_ value: TeamExternalSharingControlsRecipientListsChangedType) throws -> JSON { + let output = [ + "description": try Serialization._StringSerializer.serialize(value.description_), + ] + return .dictionary(output) + } + public func deserialize(_ json: JSON) throws -> TeamExternalSharingControlsRecipientListsChangedType { + switch json { + case .dictionary(let dict): + let description_ = try Serialization._StringSerializer.deserialize(dict["description"] ?? .null) + return TeamExternalSharingControlsRecipientListsChangedType(description_: description_) + default: + throw JSONSerializerError.deserializeError(type: TeamExternalSharingControlsRecipientListsChangedType.self, json: json) + } + } + } + /// Changed archival status of team folder. public class TeamFolderChangeStatusDetails: CustomStringConvertible, JSONRepresentable { /// New team folder status. diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuth.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuth.swift index 8a306461..750566d2 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuth.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXAuth.swift @@ -203,7 +203,10 @@ public class DBXAuthAuthError: NSObject { } } -/// 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. @objc public class DBXAuthAuthErrorInvalidAccessToken: DBXAuthAuthError { @objc @@ -326,7 +329,7 @@ public class DBXAuthInvalidAccountTypeError: NSObject { } } -/// Current account type doesn't have permission to access this route endpoint. +/// Current account type doesn't have permission to access this endpoint. @objc public class DBXAuthInvalidAccountTypeErrorEndpoint: DBXAuthInvalidAccountTypeError { @objc diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFiles.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFiles.swift index ea8741a6..797ad2d8 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFiles.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFiles.swift @@ -6110,6 +6110,10 @@ public class DBXFilesRelocationError: NSObject { case .cantMoveIntoFamily(let swiftArg): let arg = DBXFilesMoveIntoFamilyError(swift: swiftArg) return DBXFilesRelocationErrorCantMoveIntoFamily(arg) + case .teamFolderInsufficientQuota: + return DBXFilesRelocationErrorTeamFolderInsufficientQuota() + case .memberFolderInsufficientQuota: + return DBXFilesRelocationErrorMemberFolderInsufficientQuota() case .other: return DBXFilesRelocationErrorOther() } @@ -6188,6 +6192,16 @@ public class DBXFilesRelocationError: NSObject { self as? DBXFilesRelocationErrorCantMoveIntoFamily } + @objc + public var asTeamFolderInsufficientQuota: DBXFilesRelocationErrorTeamFolderInsufficientQuota? { + self as? DBXFilesRelocationErrorTeamFolderInsufficientQuota + } + + @objc + public var asMemberFolderInsufficientQuota: DBXFilesRelocationErrorMemberFolderInsufficientQuota? { + self as? DBXFilesRelocationErrorMemberFolderInsufficientQuota + } + @objc public var asOther: DBXFilesRelocationErrorOther? { self as? DBXFilesRelocationErrorOther @@ -6356,6 +6370,26 @@ public class DBXFilesRelocationErrorCantMoveIntoFamily: DBXFilesRelocationError } } +/// The destination team folder has reached its storage limit. +@objc +public class DBXFilesRelocationErrorTeamFolderInsufficientQuota: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.teamFolderInsufficientQuota + super.init(swift: swift) + } +} + +/// The user's member folder has reached its storage limit. +@objc +public class DBXFilesRelocationErrorMemberFolderInsufficientQuota: DBXFilesRelocationError { + @objc + public init() { + let swift = Files.RelocationError.memberFolderInsufficientQuota + super.init(swift: swift) + } +} + /// An unspecified error. @objc public class DBXFilesRelocationErrorOther: DBXFilesRelocationError { @@ -6410,6 +6444,10 @@ public class DBXFilesRelocationBatchError: NSObject { case .cantMoveIntoFamily(let swiftArg): let arg = DBXFilesMoveIntoFamilyError(swift: swiftArg) return DBXFilesRelocationBatchErrorCantMoveIntoFamily(arg) + case .teamFolderInsufficientQuota: + return DBXFilesRelocationBatchErrorTeamFolderInsufficientQuota() + case .memberFolderInsufficientQuota: + return DBXFilesRelocationBatchErrorMemberFolderInsufficientQuota() case .other: return DBXFilesRelocationBatchErrorOther() case .tooManyWriteOperations: @@ -6490,6 +6528,16 @@ public class DBXFilesRelocationBatchError: NSObject { self as? DBXFilesRelocationBatchErrorCantMoveIntoFamily } + @objc + public var asTeamFolderInsufficientQuota: DBXFilesRelocationBatchErrorTeamFolderInsufficientQuota? { + self as? DBXFilesRelocationBatchErrorTeamFolderInsufficientQuota + } + + @objc + public var asMemberFolderInsufficientQuota: DBXFilesRelocationBatchErrorMemberFolderInsufficientQuota? { + self as? DBXFilesRelocationBatchErrorMemberFolderInsufficientQuota + } + @objc public var asOther: DBXFilesRelocationBatchErrorOther? { self as? DBXFilesRelocationBatchErrorOther @@ -6663,6 +6711,26 @@ public class DBXFilesRelocationBatchErrorCantMoveIntoFamily: DBXFilesRelocationB } } +/// The destination team folder has reached its storage limit. +@objc +public class DBXFilesRelocationBatchErrorTeamFolderInsufficientQuota: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.teamFolderInsufficientQuota + super.init(swift: swift) + } +} + +/// The user's member folder has reached its storage limit. +@objc +public class DBXFilesRelocationBatchErrorMemberFolderInsufficientQuota: DBXFilesRelocationBatchError { + @objc + public init() { + let swift = Files.RelocationBatchError.memberFolderInsufficientQuota + super.init(swift: swift) + } +} + /// An unspecified error. @objc public class DBXFilesRelocationBatchErrorOther: DBXFilesRelocationBatchError { @@ -9642,6 +9710,10 @@ public class DBXFilesThumbnailV2Arg: NSObject { /// FileMetadata is not populated. This improves latency for use cases where `media_info` is not needed. @objc public var excludeMediaInfo: NSNumber? { swift.excludeMediaInfo as NSNumber? } + /// 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. + @objc + public var preserveTransparency: NSNumber { swift.preserveTransparency as NSNumber } @objc public init( @@ -9650,7 +9722,8 @@ public class DBXFilesThumbnailV2Arg: NSObject { size: DBXFilesThumbnailSize, mode: DBXFilesThumbnailMode, quality: DBXFilesThumbnailQuality, - excludeMediaInfo: NSNumber? + excludeMediaInfo: NSNumber?, + preserveTransparency: NSNumber ) { self.swift = Files.ThumbnailV2Arg( resource: resource.swift, @@ -9658,7 +9731,8 @@ public class DBXFilesThumbnailV2Arg: NSObject { size: size.swift, mode: mode.swift, quality: quality.swift, - excludeMediaInfo: excludeMediaInfo?.boolValue + excludeMediaInfo: excludeMediaInfo?.boolValue, + preserveTransparency: preserveTransparency.boolValue ) } @@ -9698,6 +9772,8 @@ public class DBXFilesThumbnailV2Error: NSObject { return DBXFilesThumbnailV2ErrorAccessDenied() case .notFound: return DBXFilesThumbnailV2ErrorNotFound() + case .unsupportedOutputFormat: + return DBXFilesThumbnailV2ErrorUnsupportedOutputFormat() case .other: return DBXFilesThumbnailV2ErrorOther() } @@ -9741,6 +9817,11 @@ public class DBXFilesThumbnailV2Error: NSObject { self as? DBXFilesThumbnailV2ErrorNotFound } + @objc + public var asUnsupportedOutputFormat: DBXFilesThumbnailV2ErrorUnsupportedOutputFormat? { + self as? DBXFilesThumbnailV2ErrorUnsupportedOutputFormat + } + @objc public var asOther: DBXFilesThumbnailV2ErrorOther? { self as? DBXFilesThumbnailV2ErrorOther @@ -9821,6 +9902,16 @@ public class DBXFilesThumbnailV2ErrorNotFound: DBXFilesThumbnailV2Error { } } +/// Transparency preservation is supported only for PNG and WebP output. +@objc +public class DBXFilesThumbnailV2ErrorUnsupportedOutputFormat: DBXFilesThumbnailV2Error { + @objc + public init() { + let swift = Files.ThumbnailV2Error.unsupportedOutputFormat + super.init(swift: swift) + } +} + /// An unspecified error. @objc public class DBXFilesThumbnailV2ErrorOther: DBXFilesThumbnailV2Error { @@ -9880,7 +9971,8 @@ public class DBXFilesUnlockFileBatchArg: NSObject { @objc public class DBXFilesUploadArg: DBXFilesCommitInfo { /// 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. @objc public var contentHash: String? { subSwift.contentHash } @@ -10062,7 +10154,8 @@ public class DBXFilesUploadSessionAppendArg: NSObject { @objc public var close: NSNumber { swift.close as NSNumber } /// 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. @objc public var contentHash: String? { swift.contentHash } @@ -10088,9 +10181,10 @@ public class DBXFilesUploadSessionAppendBatchArg: NSObject { /// Append information for each file in the batch. @objc public var entries: [DBXFilesUploadSessionAppendBatchArgEntry] { swift.entries.map { DBXFilesUploadSessionAppendBatchArgEntry(swift: $0) } } - /// 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. @objc public var contentHash: String? { swift.contentHash } @@ -10666,7 +10760,8 @@ public class DBXFilesUploadSessionFinishArg: NSObject { @objc public var commit: DBXFilesCommitInfo { DBXFilesCommitInfo(swift: swift.commit) } /// 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. @objc public var contentHash: String? { swift.contentHash } @@ -11385,7 +11480,8 @@ public class DBXFilesUploadSessionStartArg: NSObject { } /// 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. @objc public var contentHash: String? { swift.contentHash } @@ -11840,6 +11936,10 @@ public class DBXFilesWriteError: NSObject { return DBXFilesWriteErrorTooManyWriteOperations() case .accessRestricted: return DBXFilesWriteErrorAccessRestricted() + case .teamFolderInsufficientSpace: + return DBXFilesWriteErrorTeamFolderInsufficientSpace() + case .memberFolderInsufficientSpace: + return DBXFilesWriteErrorMemberFolderInsufficientSpace() case .other: return DBXFilesWriteErrorOther() } @@ -11893,6 +11993,16 @@ public class DBXFilesWriteError: NSObject { self as? DBXFilesWriteErrorAccessRestricted } + @objc + public var asTeamFolderInsufficientSpace: DBXFilesWriteErrorTeamFolderInsufficientSpace? { + self as? DBXFilesWriteErrorTeamFolderInsufficientSpace + } + + @objc + public var asMemberFolderInsufficientSpace: DBXFilesWriteErrorMemberFolderInsufficientSpace? { + self as? DBXFilesWriteErrorMemberFolderInsufficientSpace + } + @objc public var asOther: DBXFilesWriteErrorOther? { self as? DBXFilesWriteErrorOther @@ -11999,6 +12109,26 @@ public class DBXFilesWriteErrorAccessRestricted: DBXFilesWriteError { } } +/// The destination team folder has reached its storage limit. +@objc +public class DBXFilesWriteErrorTeamFolderInsufficientSpace: DBXFilesWriteError { + @objc + public init() { + let swift = Files.WriteError.teamFolderInsufficientSpace + super.init(swift: swift) + } +} + +/// The user's member folder has reached its storage limit. +@objc +public class DBXFilesWriteErrorMemberFolderInsufficientSpace: DBXFilesWriteError { + @objc + public init() { + let swift = Files.WriteError.memberFolderInsufficientSpace + super.init(swift: swift) + } +} + /// An unspecified error. @objc public class DBXFilesWriteErrorOther: DBXFilesWriteError { diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesAppAuthRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesAppAuthRoutes.swift index 78263eff..97971129 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesAppAuthRoutes.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesAppAuthRoutes.swift @@ -36,6 +36,9 @@ public class DBXFilesAppAuthRoutes: NSObject { /// - 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). @@ -51,6 +54,7 @@ public class DBXFilesAppAuthRoutes: NSObject { mode: DBXFilesThumbnailMode, quality: DBXFilesThumbnailQuality, excludeMediaInfo: NSNumber?, + preserveTransparency: NSNumber, overwrite: Bool, destination: URL ) -> DBXFilesGetThumbnailDownloadRequestFileV2 { @@ -61,6 +65,7 @@ public class DBXFilesAppAuthRoutes: NSObject { mode: mode.swift, quality: quality.swift, excludeMediaInfo: excludeMediaInfo?.boolValue, + preserveTransparency: preserveTransparency.boolValue, overwrite: overwrite, destination: destination ) @@ -98,6 +103,9 @@ public class DBXFilesAppAuthRoutes: NSObject { /// - 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. @@ -108,7 +116,8 @@ public class DBXFilesAppAuthRoutes: NSObject { size: DBXFilesThumbnailSize, mode: DBXFilesThumbnailMode, quality: DBXFilesThumbnailQuality, - excludeMediaInfo: NSNumber? + excludeMediaInfo: NSNumber?, + preserveTransparency: NSNumber ) -> DBXFilesGetThumbnailDownloadRequestMemoryV2 { let swift = swift.getThumbnailV2( resource: resource.swift, @@ -116,7 +125,8 @@ public class DBXFilesAppAuthRoutes: NSObject { size: size.swift, mode: mode.swift, quality: quality.swift, - excludeMediaInfo: excludeMediaInfo?.boolValue + excludeMediaInfo: excludeMediaInfo?.boolValue, + preserveTransparency: preserveTransparency.boolValue ) return DBXFilesGetThumbnailDownloadRequestMemoryV2(swift: swift) } diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesRoutes.swift index 9228107c..47a11528 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesRoutes.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXFilesRoutes.swift @@ -596,16 +596,15 @@ public class DBXFilesRoutes: NSObject { /// maximum temporary upload link duration is 4 hours. Upon consumption or expiration, a new link will have to /// be generated. Multiple links may exist for a specific upload path at any given time. The POST request on /// the temporary upload link must have its Content-Type set to "application/octet-stream". Example temporary - /// upload link consumption request: curl -X POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND - /// --header "Content-Type: application/octet-stream" --data-binary @local_file.txt A successful temporary - /// upload link consumption request returns the content hash of the uploaded data in JSON format. Example - /// successful temporary upload link consumption response: {"content-hash": - /// "599d71033d700ac892a0e48fa61b125d2f5994"} An unsuccessful temporary upload link consumption request returns - /// any of the following status codes: HTTP 400 Bad Request: Content-Type is not one of - /// application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: The temporary upload link - /// does not exist or is currently unavailable, the upload failed, or another error happened. HTTP 410 Gone: The - /// temporary upload link is expired or consumed. Example unsuccessful temporary upload link consumption - /// response: Temporary upload link has been recently consumed. + /// upload link consumption request: curl -X POST --header "Content-Type: + /// application/octet-stream" --data-binary @local_file.txt A successful temporary upload link consumption + /// request returns the content hash of the uploaded data in JSON format. Example successful temporary upload + /// link consumption response: {"content-hash": "599d71033d700ac892a0e48fa61b125d2f5994"} An unsuccessful + /// temporary upload link consumption request returns any of the following status codes: HTTP 400 Bad Request: + /// Content-Type is not one of application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: + /// The temporary upload link does not exist or is currently unavailable, the upload failed, or another error + /// happened. HTTP 410 Gone: The temporary upload link is expired or consumed. Example unsuccessful temporary + /// upload link consumption response: Temporary upload link has been recently consumed. /// /// - scope: files.content.write /// @@ -631,16 +630,15 @@ public class DBXFilesRoutes: NSObject { /// maximum temporary upload link duration is 4 hours. Upon consumption or expiration, a new link will have to /// be generated. Multiple links may exist for a specific upload path at any given time. The POST request on /// the temporary upload link must have its Content-Type set to "application/octet-stream". Example temporary - /// upload link consumption request: curl -X POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND - /// --header "Content-Type: application/octet-stream" --data-binary @local_file.txt A successful temporary - /// upload link consumption request returns the content hash of the uploaded data in JSON format. Example - /// successful temporary upload link consumption response: {"content-hash": - /// "599d71033d700ac892a0e48fa61b125d2f5994"} An unsuccessful temporary upload link consumption request returns - /// any of the following status codes: HTTP 400 Bad Request: Content-Type is not one of - /// application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: The temporary upload link - /// does not exist or is currently unavailable, the upload failed, or another error happened. HTTP 410 Gone: The - /// temporary upload link is expired or consumed. Example unsuccessful temporary upload link consumption - /// response: Temporary upload link has been recently consumed. + /// upload link consumption request: curl -X POST --header "Content-Type: + /// application/octet-stream" --data-binary @local_file.txt A successful temporary upload link consumption + /// request returns the content hash of the uploaded data in JSON format. Example successful temporary upload + /// link consumption response: {"content-hash": "599d71033d700ac892a0e48fa61b125d2f5994"} An unsuccessful + /// temporary upload link consumption request returns any of the following status codes: HTTP 400 Bad Request: + /// Content-Type is not one of application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: + /// The temporary upload link does not exist or is currently unavailable, the upload failed, or another error + /// happened. HTTP 410 Gone: The temporary upload link is expired or consumed. Example unsuccessful temporary + /// upload link consumption response: Temporary upload link has been recently consumed. /// /// - scope: files.content.write /// @@ -783,6 +781,9 @@ public class DBXFilesRoutes: NSObject { /// - 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). @@ -798,6 +799,7 @@ public class DBXFilesRoutes: NSObject { mode: DBXFilesThumbnailMode, quality: DBXFilesThumbnailQuality, excludeMediaInfo: NSNumber?, + preserveTransparency: NSNumber, overwrite: Bool, destination: URL ) -> DBXFilesGetThumbnailDownloadRequestFileV2 { @@ -808,6 +810,7 @@ public class DBXFilesRoutes: NSObject { mode: mode.swift, quality: quality.swift, excludeMediaInfo: excludeMediaInfo?.boolValue, + preserveTransparency: preserveTransparency.boolValue, overwrite: overwrite, destination: destination ) @@ -845,6 +848,9 @@ public class DBXFilesRoutes: NSObject { /// - 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. @@ -855,7 +861,8 @@ public class DBXFilesRoutes: NSObject { size: DBXFilesThumbnailSize, mode: DBXFilesThumbnailMode, quality: DBXFilesThumbnailQuality, - excludeMediaInfo: NSNumber? + excludeMediaInfo: NSNumber?, + preserveTransparency: NSNumber ) -> DBXFilesGetThumbnailDownloadRequestMemoryV2 { let swift = swift.getThumbnailV2( resource: resource.swift, @@ -863,7 +870,8 @@ public class DBXFilesRoutes: NSObject { size: size.swift, mode: mode.swift, quality: quality.swift, - excludeMediaInfo: excludeMediaInfo?.boolValue + excludeMediaInfo: excludeMediaInfo?.boolValue, + preserveTransparency: preserveTransparency.boolValue ) return DBXFilesGetThumbnailDownloadRequestMemoryV2(swift: swift) } @@ -1682,7 +1690,8 @@ public class DBXFilesRoutes: NSObject { /// - scope: files.content.write /// /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an Data object. /// @@ -1739,7 +1748,8 @@ public class DBXFilesRoutes: NSObject { /// - scope: files.content.write /// /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an URL object. /// @@ -1796,7 +1806,8 @@ public class DBXFilesRoutes: NSObject { /// - scope: files.content.write /// /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an InputStream object. /// @@ -1857,7 +1868,8 @@ public class DBXFilesRoutes: NSObject { /// - parameter close: If true, the current session will be closed, at which point you won't be able to call /// uploadSessionAppendV2 anymore with the current session. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an Data object. /// @@ -1899,7 +1911,8 @@ public class DBXFilesRoutes: NSObject { /// - parameter close: If true, the current session will be closed, at which point you won't be able to call /// uploadSessionAppendV2 anymore with the current session. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an URL object. /// @@ -1941,7 +1954,8 @@ public class DBXFilesRoutes: NSObject { /// - parameter close: If true, the current session will be closed, at which point you won't be able to call /// uploadSessionAppendV2 anymore with the current session. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an InputStream object. /// @@ -1986,9 +2000,9 @@ public class DBXFilesRoutes: NSObject { /// - scope: files.content.write /// /// - parameter entries: Append information for each file in the batch. - /// - parameter contentHash: 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 + /// - parameter contentHash: 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. /// - parameter input: The file to upload, as an Data object. /// @@ -2029,9 +2043,9 @@ public class DBXFilesRoutes: NSObject { /// - scope: files.content.write /// /// - parameter entries: Append information for each file in the batch. - /// - parameter contentHash: 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 + /// - parameter contentHash: 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. /// - parameter input: The file to upload, as an URL object. /// @@ -2072,9 +2086,9 @@ public class DBXFilesRoutes: NSObject { /// - scope: files.content.write /// /// - parameter entries: Append information for each file in the batch. - /// - parameter contentHash: 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 + /// - parameter contentHash: 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. /// - parameter input: The file to upload, as an InputStream object. /// @@ -2119,7 +2133,8 @@ public class DBXFilesRoutes: NSObject { /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter commit: Contains the path and other optional modifiers for the commit. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an Data object. /// @@ -2158,7 +2173,8 @@ public class DBXFilesRoutes: NSObject { /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter commit: Contains the path and other optional modifiers for the commit. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an URL object. /// @@ -2197,7 +2213,8 @@ public class DBXFilesRoutes: NSObject { /// - parameter cursor: Contains the upload session ID and the offset. /// - parameter commit: Contains the path and other optional modifiers for the commit. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an InputStream object. /// @@ -2298,7 +2315,8 @@ public class DBXFilesRoutes: NSObject { /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in /// UploadSessionType. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an Data object. /// @@ -2371,7 +2389,8 @@ public class DBXFilesRoutes: NSObject { /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in /// UploadSessionType. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an URL object. /// @@ -2444,7 +2463,8 @@ public class DBXFilesRoutes: NSObject { /// - parameter sessionType: Type of upload session you want to start. If not specified, default is sequential in /// UploadSessionType. /// - parameter contentHash: 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 + /// 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. /// - parameter input: The file to upload, as an InputStream object. /// diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRiviera.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRiviera.swift index ec275b1f..05a84259 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRiviera.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRiviera.swift @@ -14,20 +14,20 @@ import SwiftyDropbox /// may be empty when absent from the source file. @objc public class DBXRivieraApiExifGpsMetadata: NSObject { - /// Latitude / longitude in decimal degrees (positive = N/E, negative = S/W). + /// Latitude in decimal degrees (positive = north, negative = south). @objc public var latitude: NSNumber { swift.latitude as NSNumber } - /// (no description) + /// Longitude in decimal degrees (positive = east, negative = west). @objc public var longitude: NSNumber { swift.longitude as NSNumber } /// Altitude in meters, as reported by the source (string to preserve the original representation, which may /// include a reference direction). @objc public var altitude: String { swift.altitude } - /// Timestamp / datestamp of the GPS fix, in the EXIF-provided format. + /// Time of the GPS fix, in the EXIF-provided format. @objc public var timestamp_: String { swift.timestamp_ } - /// (no description) + /// Date of the GPS fix, in the EXIF-provided format. @objc public var datestamp: String { swift.datestamp } @@ -52,56 +52,56 @@ public class DBXRivieraApiExifGpsMetadata: NSObject { public override var description: String { swift.description } } -/// Image EXIF metadata. Mirrors the useful subset of the internal `riviera.ExifMetadata` message. Fields are -/// best-effort and may be empty. +/// Image EXIF metadata. Fields are populated on a best-effort basis and may be empty when absent from the source +/// file. @objc public class DBXRivieraApiExifMetadata: NSObject { - /// (no description) + /// Width of the image, in pixels. @objc public var imageWidth: NSNumber { swift.imageWidth as NSNumber } - /// (no description) + /// Height of the image, in pixels. @objc public var imageHeight: NSNumber { swift.imageHeight as NSNumber } - /// (no description) + /// Manufacturer of the device that captured the image, e.g. "Apple". @objc public var cameraMake: String { swift.cameraMake } - /// (no description) + /// Model of the device that captured the image, e.g. "iPhone 15 Pro". @objc public var cameraModel: String { swift.cameraModel } - /// (no description) + /// Model of the lens the image was captured with, when the source records it. @objc public var lensModel: String { swift.lensModel } /// Capture time in the EXIF-provided format (local time of the camera). @objc public var dateTimeOriginal: String { swift.dateTimeOriginal } - /// Timezone offset for `date_time_original`, e.g. "+09:00". + /// Timezone offset for dateTimeOriginal in ApiExifMetadata, e.g. "+09:00". @objc public var offsetTimeOriginal: String { swift.offsetTimeOriginal } /// EXIF orientation value (1-8). See the EXIF spec; 1 is the normal upright orientation. @objc public var orientation: NSNumber { swift.orientation as NSNumber } - /// fraction in string form, e.g. "1/250" + /// Exposure time the image was captured with, as a fractional-second string, e.g. "1/250". @objc public var exposureTime: String { swift.exposureTime } - /// (no description) + /// Aperture the image was captured at, as reported by the EXIF aperture tag. @objc public var apertureValue: NSNumber { swift.apertureValue as NSNumber } - /// (no description) + /// ISO sensitivity the image was captured at. @objc public var isoSpeed: NSNumber { swift.isoSpeed as NSNumber } - /// e.g. "26.0 mm" + /// Focal length the image was captured at, including the unit, e.g. "26.0 mm". @objc public var focalLength: String { swift.focalLength } - /// (no description) + /// Total pixel count of the image, in megapixels. @objc public var megapixels: NSNumber { swift.megapixels as NSNumber } - /// (no description) + /// Creator credited in the EXIF artist tag. @objc public var artist: String { swift.artist } - /// (no description) + /// Copyright notice from the EXIF copyright tag. @objc public var copyright: String { swift.copyright } - /// (no description) + /// Location tags from the image, when the source recorded a location. @objc public var gpsMetadata: DBXRivieraApiExifGpsMetadata? { guard let swift = swift.gpsMetadata else { return nil } return DBXRivieraApiExifGpsMetadata(swift: swift) @@ -156,20 +156,51 @@ public class DBXRivieraApiExifMetadata: NSObject { public override var description: String { swift.description } } -/// Audio/video container and per-stream metadata. Mirrors the useful subset of the internal `riviera.MediaMetadata` -/// message. +/// A single extracted scene-change keyframe. +@objc +public class DBXRivieraApiKeyframe: NSObject { + /// Presentation timestamp of the keyframe, in seconds from the start of the video. + @objc + public var timestamp_: NSNumber { swift.timestamp_ as NSNumber } + /// Scene-change score that triggered this keyframe, in the range [0.0, 1.0]. Higher values indicate a more + /// pronounced scene change relative to the preceding frame. The first keyframe of a video is always + /// reported as 1.0: the start of a video is a scene boundary by definition, so that score is not a measured + /// frame-to-frame comparison. + @objc + public var sceneScore: NSNumber { swift.sceneScore as NSNumber } + /// The extracted frame as a base64-encoded JPEG image. Empty when the request set `include_images = false`. + @objc + public var imageBase64: String { swift.imageBase64 } + + @objc + public init(timestamp_: NSNumber, sceneScore: NSNumber, imageBase64: String) { + self.swift = Riviera.ApiKeyframe(timestamp_: timestamp_.doubleValue, sceneScore: sceneScore.doubleValue, imageBase64: imageBase64) + } + + let swift: Riviera.ApiKeyframe + + public init(swift: Riviera.ApiKeyframe) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Audio/video container and per-stream metadata. Fields are populated on a best-effort basis and may be empty when +/// absent from the source file. @objc public class DBXRivieraApiMediaMetadata: NSObject { - /// (no description) + /// Overall bitrate of the container, in bits per second. @objc public var bitrateBps: NSNumber { swift.bitrateBps as NSNumber } - /// (no description) + /// Duration of the media, in seconds. @objc public var durationS: NSNumber { swift.durationS as NSNumber } /// Container-level creation time, when present. @objc public var creationTime: String { swift.creationTime } - /// (no description) + /// The audio and video streams the container holds, in container order. @objc public var streams: [DBXRivieraApiMediaStream]? { swift.streams?.map { DBXRivieraApiMediaStream(swift: $0) } } @@ -196,43 +227,45 @@ public class DBXRivieraApiMediaMetadata: NSObject { /// A single audio or video stream within a media file. @objc public class DBXRivieraApiMediaStream: NSObject { - /// (no description) + /// Zero-based index of the stream within the container. @objc public var index: NSNumber { swift.index as NSNumber } - /// "audio", "video", etc. + /// Kind of media the stream carries, e.g. "audio" or "video". @objc public var codecType: String { swift.codecType } - /// (no description) + /// Name of the codec the stream is encoded with, e.g. "h264" or "aac". @objc public var codecName: String { swift.codecName } - /// (no description) + /// Bitrate of this stream, in bits per second. @objc public var bitrateBps: NSNumber { swift.bitrateBps as NSNumber } - /// (no description) + /// Duration of this stream, in seconds. @objc public var durationS: NSNumber { swift.durationS as NSNumber } - /// Video-specific fields (zero / empty for audio streams). + /// Width of the video frame, in pixels. Zero for audio streams. @objc public var width: NSNumber { swift.width as NSNumber } - /// (no description) + /// Height of the video frame, in pixels. Zero for audio streams. @objc public var height: NSNumber { swift.height as NSNumber } - /// (no description) + /// Frame rate of the stream, in frames per second. Zero for audio streams. @objc public var framesPerSecond: NSNumber { swift.framesPerSecond as NSNumber } - /// (no description) + /// Rotation to apply on playback, in degrees, as recorded in the stream metadata. Zero for audio streams and + /// for video that needs no rotation. @objc public var rotation: NSNumber { swift.rotation as NSNumber } - /// e.g. "16:9" + /// Aspect ratio the video should be displayed at, as a "width:height" string, e.g. "16:9". Empty for audio + /// streams. @objc public var displayAspectRatio: String { swift.displayAspectRatio } - /// Audio-specific fields (zero / empty for video streams). + /// Number of audio channels in the stream. Zero for video streams. @objc public var channels: NSNumber { swift.channels as NSNumber } - /// (no description) + /// Layout of the audio channels, e.g. "stereo". Empty for video streams. @objc public var channelLayout: String { swift.channelLayout } - /// (no description) + /// Sample rate of the audio stream, in samples per second. Zero for video streams. @objc public var sampleRateS: NSNumber { swift.sampleRateS as NSNumber } /// ISO 639 language code for the stream, when present. @@ -284,44 +317,45 @@ public class DBXRivieraApiMediaStream: NSObject { public override var description: String { swift.description } } -/// MS Office document metadata. Mirrors the internal `riviera.OfficeMetadata` message. Some fields apply only to -/// specific document types (e.g. `slides` for PowerPoint, `words`/`pages` for Word). +/// MS Office document metadata. Some fields apply only to specific document types (e.g. slides in ApiOfficeMetadata +/// for PowerPoint, words in ApiOfficeMetadata and pages in ApiOfficeMetadata for Word). @objc public class DBXRivieraApiOfficeMetadata: NSObject { - /// (no description) + /// Which kind of Office document this metadata was extracted from. @objc public var fileType: DBXRivieraOfficeFileType { DBXRivieraOfficeFileType(swift: swift.fileType) } - /// (no description) + /// Author recorded in the document properties. @objc public var creator: String { swift.creator } - /// (no description) + /// Company recorded in the document properties. @objc public var company: String { swift.company } - /// (no description) + /// Title recorded in the document properties. @objc public var title: String { swift.title } - /// (no description) + /// Subject recorded in the document properties. @objc public var subject: String { swift.subject } - /// (no description) + /// Keywords recorded in the document properties, in the document's own formatting (typically a single comma- or + /// space-separated string). @objc public var keywords: String { swift.keywords } - /// (no description) + /// Description recorded in the document properties. @objc public var description_: String { swift.description_ } - /// (no description) + /// Total editing time recorded in the document properties, in minutes. @objc public var totalEditTimeMinutes: NSNumber { swift.totalEditTimeMinutes as NSNumber } - /// Word only. + /// Page count recorded in the document properties. Word documents only; zero for PowerPoint and Excel. @objc public var pages: NSNumber { swift.pages as NSNumber } - /// (no description) + /// Word count recorded in the document properties. Word documents only; zero for PowerPoint and Excel. @objc public var words: NSNumber { swift.words as NSNumber } - /// PowerPoint only. + /// Slide count recorded in the document properties. PowerPoint documents only; zero for Word and Excel. @objc public var slides: NSNumber { swift.slides as NSNumber } - /// (no description) + /// Revision number recorded in the document properties. @objc public var revisionNumber: String { swift.revisionNumber } @@ -369,13 +403,13 @@ public class DBXRivieraApiOfficeMetadata: NSObject { /// PDF document metadata. @objc public class DBXRivieraApiPdfMetadata: NSObject { - /// (no description) + /// Number of pages in the document. @objc public var pages: NSNumber { swift.pages as NSNumber } - /// Width / height of the first page, in PDF points. + /// Width of the first page, in PDF points. @objc public var width: NSNumber { swift.width as NSNumber } - /// (no description) + /// Height of the first page, in PDF points. @objc public var height: NSNumber { swift.height as NSNumber } @@ -394,13 +428,14 @@ public class DBXRivieraApiPdfMetadata: NSObject { public override var description: String { swift.description } } -/// Structured transcript for APIv2 +/// A transcript, split into segments. @objc public class DBXRivieraApiStructuredTranscript: NSObject { - /// (no description) + /// The segments of the transcript, in playback order. @objc public var segments: [DBXRivieraApiTranscriptSegment]? { swift.segments?.map { DBXRivieraApiTranscriptSegment(swift: $0) } } - /// (no description) + /// The language of the transcript, as an ISO 639-1 code (e.g. "en"). This is the language detected in the + /// audio, or the one supplied in audioLanguage in GetTranscriptArgs. @objc public var transcriptLocale: String { swift.transcriptLocale } @@ -419,16 +454,16 @@ public class DBXRivieraApiStructuredTranscript: NSObject { public override var description: String { swift.description } } -/// Transcript segment for APIv2 +/// A contiguous span of transcribed speech. The span covered by a segment depends on the requested TimestampLevel. @objc public class DBXRivieraApiTranscriptSegment: NSObject { - /// (no description) + /// The transcribed text of this segment. @objc public var text: String { swift.text } - /// (no description) + /// Offset of the start of this segment, in seconds from the beginning of the media. @objc public var startTime: NSNumber { swift.startTime as NSNumber } - /// (no description) + /// Offset of the end of this segment, in seconds from the beginning of the media. @objc public var endTime: NSNumber { swift.endTime as NSNumber } @@ -447,7 +482,7 @@ public class DBXRivieraApiTranscriptSegment: NSObject { public override var description: String { swift.description } } -/// Reason a transcript job failed. Returned in the `failed` variant of `GetTranscriptAsyncCheckResult`. This is a +/// Reason a transcript job failed. Returned in the failed in GetTranscriptAsyncCheckResult variant. This is a /// semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a failed /// job is still a normal successful poll response). Callers should branch on the variant. @objc @@ -570,7 +605,7 @@ public class DBXRivieraContentApiV2ErrorUserError: DBXRivieraContentApiV2Error { } } -/// An unspecified error. +/// The audio to transcribe is longer than the supported maximum. @objc public class DBXRivieraContentApiV2ErrorMediaDurationError: DBXRivieraContentApiV2Error { @objc @@ -584,7 +619,7 @@ public class DBXRivieraContentApiV2ErrorMediaDurationError: DBXRivieraContentApi } } -/// An unspecified error. +/// The file has no audio track, or no audio content could be detected in it. @objc public class DBXRivieraContentApiV2ErrorNoAudioError: DBXRivieraContentApiV2Error { @objc @@ -594,7 +629,7 @@ public class DBXRivieraContentApiV2ErrorNoAudioError: DBXRivieraContentApiV2Erro } } -/// An unspecified error. +/// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. @objc public class DBXRivieraContentApiV2ErrorLinkDownloadDisabledError: DBXRivieraContentApiV2Error { @objc @@ -604,7 +639,8 @@ public class DBXRivieraContentApiV2ErrorLinkDownloadDisabledError: DBXRivieraCon } } -/// An unspecified error. +/// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, +/// so such links cannot be transcribed. @objc public class DBXRivieraContentApiV2ErrorSharedLinkPasswordProtected: DBXRivieraContentApiV2Error { @objc @@ -614,7 +650,7 @@ public class DBXRivieraContentApiV2ErrorSharedLinkPasswordProtected: DBXRivieraC } } -/// An unspecified error. +/// A resource limit was exceeded while producing the result. @objc public class DBXRivieraContentApiV2ErrorLimitExceededError: DBXRivieraContentApiV2Error { @objc @@ -703,7 +739,7 @@ public class DBXRivieraFileIdOrUrl: NSObject { } } -/// A Dropbox-issued file id (format: "id:") for a file the authenticated user has access to. +/// A Dropbox-issued file ID for a file the authenticated user has access to, e.g. "id:a4ayc_80_OEAAAAAAAAAYa". @objc public class DBXRivieraFileIdOrUrlFileId: DBXRivieraFileIdOrUrl { @objc @@ -717,13 +753,13 @@ public class DBXRivieraFileIdOrUrlFileId: DBXRivieraFileIdOrUrl { } } -/// Either a Dropbox shared link (www.dropbox.com) or an external HTTP or HTTPS URL pointing to a supported -/// file. - Dropbox shared links are resolved internally using the caller's authenticated identity and -/// the link's visibility / download settings. They therefore require an authenticated user context -/// (anonymous `url` requests against Dropbox links are rejected with an `access_error`). Links -/// protected by a password are rejected with `shared_link_password_protected`; links with downloads -/// disabled are rejected with `link_download_disabled_error`. - External URLs are fetched through the -/// backend's egress proxy and must point at a supported file extension. +/// Either a Dropbox shared link (www.dropbox.com) or an internet-accessible URL pointing to a supported file. - +/// Dropbox shared links are resolved internally using the caller's authenticated identity and the +/// link's visibility / download settings. They therefore require an authenticated user context; +/// requests made with app auth alone are rejected. Password-protected links and links with downloads +/// disabled are rejected as well. - Other URLs are fetched by Dropbox's servers, so they must be +/// reachable from the public internet -- not only from the calling application's network -- and must +/// point at a supported file extension. @objc public class DBXRivieraFileIdOrUrlUrl: DBXRivieraFileIdOrUrl { @objc @@ -761,13 +797,177 @@ public class DBXRivieraFileIdOrUrlOther: DBXRivieraFileIdOrUrl { } } -/// Arguments for the asynchronous `get_markdown_async` route. Exactly one of `file_id`, `path`, or `url` must be -/// supplied via `file_id_or_url` to identify the document to convert to markdown. +/// Arguments for the asynchronous `get_keyframes_async` route. Exactly one of `file_id`, `path`, or `url` must be +/// supplied via `file_id_or_url` to identify the video whose scene-change keyframes should be extracted. +@objc +public class DBXRivieraGetKeyframesArgs: NSObject { + /// Identifier of the video file to extract keyframes from. Callers must set exactly one of the `FileIdOrUrl` + /// variants. Keyframe extraction is supported for video files only; see the route description for the + /// supported formats. Requests against unsupported formats return `unsupported_format_error`. + @objc + public var fileIdOrUrl: DBXRivieraFileIdOrUrl? { guard let swift = swift.fileIdOrUrl else { return nil } + return DBXRivieraFileIdOrUrl(swift: swift) + } + + /// Sensitivity of scene-change detection. A keyframe is emitted whenever the frame-to-frame scene score crosses + /// this threshold, so a LOWER value yields MORE keyframes. Valid range is (0.0, 1.0]. When omitted (0.0) + /// the service uses a default of 0.3, which is a good starting point for most videos. + @objc + public var sceneChangeThreshold: NSNumber { swift.sceneChangeThreshold as NSNumber } + /// When true, each returned keyframe includes the JPEG image bytes, base64-encoded, in + /// `ApiKeyframe.image_base64`. When false, the response contains only per-keyframe metadata (timestamp and + /// scene score) and `image_base64` is left empty -- useful when you only need the scene boundaries and want + /// a small response. NOTE: because the field defaults to false in proto3, callers who want images must set + /// this explicitly to true. + @objc + public var includeImages: NSNumber { swift.includeImages as NSNumber } + + @objc + public init(fileIdOrUrl: DBXRivieraFileIdOrUrl?, sceneChangeThreshold: NSNumber, includeImages: NSNumber) { + self.swift = Riviera.GetKeyframesArgs( + fileIdOrUrl: fileIdOrUrl?.swift, + sceneChangeThreshold: sceneChangeThreshold.doubleValue, + includeImages: includeImages.boolValue + ) + } + + let swift: Riviera.GetKeyframesArgs + + public init(swift: Riviera.GetKeyframesArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Result type for EventBus async check - must end in "CheckResult" +@objc +public class DBXRivieraGetKeyframesAsyncCheckResult: NSObject { + let swift: Riviera.GetKeyframesAsyncCheckResult + + public init(swift: Riviera.GetKeyframesAsyncCheckResult) { + self.swift = swift + } + + public static func factory(swift: Riviera.GetKeyframesAsyncCheckResult) -> DBXRivieraGetKeyframesAsyncCheckResult { + switch swift { + case .inProgress: + return DBXRivieraGetKeyframesAsyncCheckResultInProgress() + case .complete(let swiftArg): + let arg = DBXRivieraGetKeyframesResult(swift: swiftArg) + return DBXRivieraGetKeyframesAsyncCheckResultComplete(arg) + case .failed(let swiftArg): + let arg = DBXRivieraKeyframesExtractionApiV2Error(swift: swiftArg) + return DBXRivieraGetKeyframesAsyncCheckResultFailed(arg) + case .other: + return DBXRivieraGetKeyframesAsyncCheckResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXRivieraGetKeyframesAsyncCheckResultInProgress? { + self as? DBXRivieraGetKeyframesAsyncCheckResultInProgress + } + + @objc + public var asComplete: DBXRivieraGetKeyframesAsyncCheckResultComplete? { + self as? DBXRivieraGetKeyframesAsyncCheckResultComplete + } + + @objc + public var asFailed: DBXRivieraGetKeyframesAsyncCheckResultFailed? { + self as? DBXRivieraGetKeyframesAsyncCheckResultFailed + } + + @objc + public var asOther: DBXRivieraGetKeyframesAsyncCheckResultOther? { + self as? DBXRivieraGetKeyframesAsyncCheckResultOther + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetKeyframesAsyncCheckResultInProgress: DBXRivieraGetKeyframesAsyncCheckResult { + @objc + public init() { + let swift = Riviera.GetKeyframesAsyncCheckResult.inProgress + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetKeyframesAsyncCheckResultComplete: DBXRivieraGetKeyframesAsyncCheckResult { + @objc + public var complete: DBXRivieraGetKeyframesResult + + @objc + public init(_ arg: DBXRivieraGetKeyframesResult) { + self.complete = arg + let swift = Riviera.GetKeyframesAsyncCheckResult.complete(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetKeyframesAsyncCheckResultFailed: DBXRivieraGetKeyframesAsyncCheckResult { + @objc + public var failed: DBXRivieraKeyframesExtractionApiV2Error + + @objc + public init(_ arg: DBXRivieraKeyframesExtractionApiV2Error) { + self.failed = arg + let swift = Riviera.GetKeyframesAsyncCheckResult.failed(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetKeyframesAsyncCheckResultOther: DBXRivieraGetKeyframesAsyncCheckResult { + @objc + public init() { + let swift = Riviera.GetKeyframesAsyncCheckResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetKeyframesResult struct +@objc +public class DBXRivieraGetKeyframesResult: NSObject { + /// The extracted keyframes, ordered by `timestamp`. May be empty when no scene changes are detected in the + /// source. + @objc + public var frames: [DBXRivieraApiKeyframe]? { swift.frames?.map { DBXRivieraApiKeyframe(swift: $0) } } + + @objc + public init(frames: [DBXRivieraApiKeyframe]?) { + self.swift = Riviera.GetKeyframesResult(frames: frames?.map(\.swift)) + } + + let swift: Riviera.GetKeyframesResult + + public init(swift: Riviera.GetKeyframesResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for the asynchronous getMarkdownAsync route. Exactly one of fileId in FileIdOrUrl, path in +/// FileIdOrUrl, or url in FileIdOrUrl must be supplied via fileIdOrUrl in GetMarkdownArgs to identify the document +/// to convert to markdown. @objc public class DBXRivieraGetMarkdownArgs: NSObject { - /// Identifier of the document to convert. Callers must set exactly one of the `FileIdOrUrl` variants. The + /// Identifier of the document to convert. Callers must set exactly one of the FileIdOrUrl variants. The /// referenced file must be a document in a supported format (see the route description for the list); - /// requests against unsupported formats return `unsupported_format_error`. + /// requests against unsupported formats fail with userError in MarkdownConversionApiV2Error. @objc public var fileIdOrUrl: DBXRivieraFileIdOrUrl? { guard let swift = swift.fileIdOrUrl else { return nil } return DBXRivieraFileIdOrUrl(swift: swift) @@ -796,7 +996,7 @@ public class DBXRivieraGetMarkdownArgs: NSObject { public override var description: String { swift.description } } -/// Result type for EventBus async check +/// Status of a markdown conversion job started by getMarkdownAsync, as returned by getMarkdownAsyncCheck. @objc public class DBXRivieraGetMarkdownAsyncCheckResult: NSObject { let swift: Riviera.GetMarkdownAsyncCheckResult @@ -844,7 +1044,7 @@ public class DBXRivieraGetMarkdownAsyncCheckResult: NSObject { } } -/// An unspecified error. +/// The job has not finished yet. Poll again. @objc public class DBXRivieraGetMarkdownAsyncCheckResultInProgress: DBXRivieraGetMarkdownAsyncCheckResult { @objc @@ -854,7 +1054,7 @@ public class DBXRivieraGetMarkdownAsyncCheckResultInProgress: DBXRivieraGetMarkd } } -/// An unspecified error. +/// The job finished successfully. @objc public class DBXRivieraGetMarkdownAsyncCheckResultComplete: DBXRivieraGetMarkdownAsyncCheckResult { @objc @@ -868,7 +1068,7 @@ public class DBXRivieraGetMarkdownAsyncCheckResultComplete: DBXRivieraGetMarkdow } } -/// An unspecified error. +/// The job finished unsuccessfully. @objc public class DBXRivieraGetMarkdownAsyncCheckResultFailed: DBXRivieraGetMarkdownAsyncCheckResult { @objc @@ -895,7 +1095,7 @@ public class DBXRivieraGetMarkdownAsyncCheckResultOther: DBXRivieraGetMarkdownAs /// Objective-C compatible GetMarkdownResult struct @objc public class DBXRivieraGetMarkdownResult: NSObject { - /// The converted markdown content + /// The markdown the source document was converted to. @objc public var markdown: String { swift.markdown } @@ -914,15 +1114,16 @@ public class DBXRivieraGetMarkdownResult: NSObject { public override var description: String { swift.description } } -/// Arguments for the asynchronous `get_metadata_async` route. Exactly one of `file_id`, `path`, or `url` must be -/// supplied via `file_id_or_url` to identify the file whose metadata should be extracted. +/// Arguments for the asynchronous getMetadataAsync route. Exactly one of fileId in FileIdOrUrl, path in +/// FileIdOrUrl, or url in FileIdOrUrl must be supplied via fileIdOrUrl in GetMetadataArgs to identify the file +/// whose metadata should be extracted. @objc public class DBXRivieraGetMetadataArgs: NSObject { - /// Identifier of the file to extract metadata from. Callers must set exactly one of the `FileIdOrUrl` variants. + /// Identifier of the file to extract metadata from. Callers must set exactly one of the FileIdOrUrl variants. /// The kind of metadata returned is determined by the file type: image files return EXIF metadata, /// audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents (docx, pptx, /// xlsx) return Office metadata. See the route description for the supported formats. Requests against - /// unsupported formats return `unsupported_format_error`. + /// unsupported formats fail with userError in MetadataExtractionApiV2Error. @objc public var fileIdOrUrl: DBXRivieraFileIdOrUrl? { guard let swift = swift.fileIdOrUrl else { return nil } return DBXRivieraFileIdOrUrl(swift: swift) @@ -943,7 +1144,7 @@ public class DBXRivieraGetMetadataArgs: NSObject { public override var description: String { swift.description } } -/// Result type for EventBus async check - must end in "CheckResult" +/// Status of a metadata extraction job started by getMetadataAsync, as returned by getMetadataAsyncCheck. @objc public class DBXRivieraGetMetadataAsyncCheckResult: NSObject { let swift: Riviera.GetMetadataAsyncCheckResult @@ -991,7 +1192,7 @@ public class DBXRivieraGetMetadataAsyncCheckResult: NSObject { } } -/// An unspecified error. +/// The job has not finished yet. Poll again. @objc public class DBXRivieraGetMetadataAsyncCheckResultInProgress: DBXRivieraGetMetadataAsyncCheckResult { @objc @@ -1001,7 +1202,7 @@ public class DBXRivieraGetMetadataAsyncCheckResultInProgress: DBXRivieraGetMetad } } -/// An unspecified error. +/// The job finished successfully. @objc public class DBXRivieraGetMetadataAsyncCheckResultComplete: DBXRivieraGetMetadataAsyncCheckResult { @objc @@ -1015,7 +1216,7 @@ public class DBXRivieraGetMetadataAsyncCheckResultComplete: DBXRivieraGetMetadat } } -/// An unspecified error. +/// The job finished unsuccessfully. @objc public class DBXRivieraGetMetadataAsyncCheckResultFailed: DBXRivieraGetMetadataAsyncCheckResult { @objc @@ -1042,8 +1243,8 @@ public class DBXRivieraGetMetadataAsyncCheckResultOther: DBXRivieraGetMetadataAs /// Objective-C compatible GetMetadataResult struct @objc public class DBXRivieraGetMetadataResult: NSObject { - /// The kind of metadata that was extracted for the requested file. Callers should read the matching field of - /// the `metadata` oneof. + /// The kind of metadata that was extracted for the requested file. Callers should read the matching variant of + /// metadata in GetMetadataResult. @objc public var metadataType: DBXRivieraMetadataType { DBXRivieraMetadataType(swift: swift.metadataType) } /// (no description) @@ -1067,47 +1268,30 @@ public class DBXRivieraGetMetadataResult: NSObject { public override var description: String { swift.description } } -/// Arguments for the asynchronous `get_transcript_async` route. Exactly one of `file_id`, `path`, or `url` must be -/// supplied via `file_id_or_url` to identify the audio or video asset to transcribe. +/// Arguments for the asynchronous `get_ocr_async` route. Exactly one of `file_id`, `path`, or `url` must be +/// supplied via `file_id_or_url` to identify the image or PDF whose text should be extracted via OCR (optical +/// character recognition). @objc -public class DBXRivieraGetTranscriptArgs: NSObject { - /// Identifier of the media asset to transcribe. Callers must set exactly one of the `FileIdOrUrl` variants. The - /// referenced asset must be an audio or video file in a supported format (see the route description for the - /// list); requests against files with no audio track return a `no_audio_error`. +public class DBXRivieraGetOcrArgs: NSObject { + /// Identifier of the file to run OCR on. Callers must set exactly one of the `FileIdOrUrl` variants. OCR is + /// supported for image files and PDFs, including scanned / non-text PDFs; see the route description for the + /// supported formats. Requests against unsupported formats return `unsupported_format_error`. NOTE: for the + /// `url` variant, only Dropbox shared links (www.dropbox.com) are supported. External (non-Dropbox) URLs + /// are not supported and return `unsupported_format_error`; import the file into Dropbox and reference it + /// by `file_id` or `path` instead. @objc public var fileIdOrUrl: DBXRivieraFileIdOrUrl? { guard let swift = swift.fileIdOrUrl else { return nil } return DBXRivieraFileIdOrUrl(swift: swift) } - /// Granularity of the time offsets returned for each transcript segment. Defaults to `SENTENCE` when the field - /// is omitted. - SENTENCE: one segment per spoken sentence (recommended). - WORD: one segment per word, - /// useful for fine-grained alignment such as captioning or highlight-as-you-listen experiences. - @objc - public var timestampLevel: DBXRivieraTimestampLevel { DBXRivieraTimestampLevel(swift: swift.timestampLevel) } - /// Comma-delimited list of non-lexical filler words to preserve in the transcript output, e.g. `"uh, ah, uhm"`. - /// By default these fillers are stripped. Unrecognized tokens are ignored. Leave empty to use the default - /// filtering behavior. - @objc - public var includedSpecialWords: String { swift.includedSpecialWords } - /// Optional ISO 639-1 two-letter language code hinting the spoken language of the source audio (e.g. "en", - /// "ja"). When empty, the service auto-detects the language; supplying a hint improves accuracy and latency - /// for short or ambiguous clips. Unsupported languages fall back to auto-detection. - @objc - public var audioLanguage: String { swift.audioLanguage } - @objc - public init(fileIdOrUrl: DBXRivieraFileIdOrUrl?, timestampLevel: DBXRivieraTimestampLevel, includedSpecialWords: String, audioLanguage: String) { - self.swift = Riviera.GetTranscriptArgs( - fileIdOrUrl: fileIdOrUrl?.swift, - timestampLevel: timestampLevel.swift, - includedSpecialWords: includedSpecialWords, - audioLanguage: audioLanguage - ) + public init(fileIdOrUrl: DBXRivieraFileIdOrUrl?) { + self.swift = Riviera.GetOcrArgs(fileIdOrUrl: fileIdOrUrl?.swift) } - let swift: Riviera.GetTranscriptArgs + let swift: Riviera.GetOcrArgs - public init(swift: Riviera.GetTranscriptArgs) { + public init(swift: Riviera.GetOcrArgs) { self.swift = swift } @@ -1117,25 +1301,25 @@ public class DBXRivieraGetTranscriptArgs: NSObject { /// Result type for EventBus async check - must end in "CheckResult" @objc -public class DBXRivieraGetTranscriptAsyncCheckResult: NSObject { - let swift: Riviera.GetTranscriptAsyncCheckResult +public class DBXRivieraGetOcrAsyncCheckResult: NSObject { + let swift: Riviera.GetOcrAsyncCheckResult - public init(swift: Riviera.GetTranscriptAsyncCheckResult) { + public init(swift: Riviera.GetOcrAsyncCheckResult) { self.swift = swift } - public static func factory(swift: Riviera.GetTranscriptAsyncCheckResult) -> DBXRivieraGetTranscriptAsyncCheckResult { + public static func factory(swift: Riviera.GetOcrAsyncCheckResult) -> DBXRivieraGetOcrAsyncCheckResult { switch swift { case .inProgress: - return DBXRivieraGetTranscriptAsyncCheckResultInProgress() + return DBXRivieraGetOcrAsyncCheckResultInProgress() case .complete(let swiftArg): - let arg = DBXRivieraGetTranscriptResult(swift: swiftArg) - return DBXRivieraGetTranscriptAsyncCheckResultComplete(arg) + let arg = DBXRivieraGetOcrResult(swift: swiftArg) + return DBXRivieraGetOcrAsyncCheckResultComplete(arg) case .failed(let swiftArg): - let arg = DBXRivieraContentApiV2Error(swift: swiftArg) - return DBXRivieraGetTranscriptAsyncCheckResultFailed(arg) + let arg = DBXRivieraOcrExtractionApiV2Error(swift: swiftArg) + return DBXRivieraGetOcrAsyncCheckResultFailed(arg) case .other: - return DBXRivieraGetTranscriptAsyncCheckResultOther() + return DBXRivieraGetOcrAsyncCheckResultOther() } } @@ -1143,92 +1327,129 @@ public class DBXRivieraGetTranscriptAsyncCheckResult: NSObject { public override var description: String { swift.description } @objc - public var asInProgress: DBXRivieraGetTranscriptAsyncCheckResultInProgress? { - self as? DBXRivieraGetTranscriptAsyncCheckResultInProgress + public var asInProgress: DBXRivieraGetOcrAsyncCheckResultInProgress? { + self as? DBXRivieraGetOcrAsyncCheckResultInProgress } @objc - public var asComplete: DBXRivieraGetTranscriptAsyncCheckResultComplete? { - self as? DBXRivieraGetTranscriptAsyncCheckResultComplete + public var asComplete: DBXRivieraGetOcrAsyncCheckResultComplete? { + self as? DBXRivieraGetOcrAsyncCheckResultComplete } @objc - public var asFailed: DBXRivieraGetTranscriptAsyncCheckResultFailed? { - self as? DBXRivieraGetTranscriptAsyncCheckResultFailed + public var asFailed: DBXRivieraGetOcrAsyncCheckResultFailed? { + self as? DBXRivieraGetOcrAsyncCheckResultFailed } @objc - public var asOther: DBXRivieraGetTranscriptAsyncCheckResultOther? { - self as? DBXRivieraGetTranscriptAsyncCheckResultOther + public var asOther: DBXRivieraGetOcrAsyncCheckResultOther? { + self as? DBXRivieraGetOcrAsyncCheckResultOther } } /// An unspecified error. @objc -public class DBXRivieraGetTranscriptAsyncCheckResultInProgress: DBXRivieraGetTranscriptAsyncCheckResult { +public class DBXRivieraGetOcrAsyncCheckResultInProgress: DBXRivieraGetOcrAsyncCheckResult { @objc public init() { - let swift = Riviera.GetTranscriptAsyncCheckResult.inProgress + let swift = Riviera.GetOcrAsyncCheckResult.inProgress super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraGetTranscriptAsyncCheckResultComplete: DBXRivieraGetTranscriptAsyncCheckResult { +public class DBXRivieraGetOcrAsyncCheckResultComplete: DBXRivieraGetOcrAsyncCheckResult { @objc - public var complete: DBXRivieraGetTranscriptResult + public var complete: DBXRivieraGetOcrResult @objc - public init(_ arg: DBXRivieraGetTranscriptResult) { + public init(_ arg: DBXRivieraGetOcrResult) { self.complete = arg - let swift = Riviera.GetTranscriptAsyncCheckResult.complete(arg.swift) + let swift = Riviera.GetOcrAsyncCheckResult.complete(arg.swift) super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraGetTranscriptAsyncCheckResultFailed: DBXRivieraGetTranscriptAsyncCheckResult { +public class DBXRivieraGetOcrAsyncCheckResultFailed: DBXRivieraGetOcrAsyncCheckResult { @objc - public var failed: DBXRivieraContentApiV2Error + public var failed: DBXRivieraOcrExtractionApiV2Error @objc - public init(_ arg: DBXRivieraContentApiV2Error) { + public init(_ arg: DBXRivieraOcrExtractionApiV2Error) { self.failed = arg - let swift = Riviera.GetTranscriptAsyncCheckResult.failed(arg.swift) + let swift = Riviera.GetOcrAsyncCheckResult.failed(arg.swift) super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraGetTranscriptAsyncCheckResultOther: DBXRivieraGetTranscriptAsyncCheckResult { +public class DBXRivieraGetOcrAsyncCheckResultOther: DBXRivieraGetOcrAsyncCheckResult { @objc public init() { - let swift = Riviera.GetTranscriptAsyncCheckResult.other + let swift = Riviera.GetOcrAsyncCheckResult.other super.init(swift: swift) } } -/// Objective-C compatible GetTranscriptResult struct +/// Objective-C compatible GetOcrResult struct @objc -public class DBXRivieraGetTranscriptResult: NSObject { - /// The structured transcript produced for the requested media asset, with per-segment text, start/end offsets - /// (in seconds from the beginning of the media), and the detected or caller-supplied locale. +public class DBXRivieraGetOcrResult: NSObject { + /// The plain-text content extracted from the file via OCR. Words within a line are separated by a single space, + /// lines are newline-separated in reading order, and for multi-page PDFs pages are separated by a blank + /// line in page order. May be empty when no text is detected in the source. @objc - public var structuredTranscript: DBXRivieraApiStructuredTranscript? { guard let swift = swift.structuredTranscript else { return nil } - return DBXRivieraApiStructuredTranscript(swift: swift) + public var text: String { swift.text } + /// The same content as hOCR: HTML that carries the position of every recognized word. Each page is a + /// `
` holding `

` elements with one `` per word, and each element carries + /// `data-x`, `data-y`, `data-width`, and `data-height` attributes in pixels relative to the upright page + /// (whose dimensions are on the `

`). Use this when you need word coordinates -- to highlight + /// matches over a page image, for example; use `text` when you just need the words. + @objc + public var hocr: String { swift.hocr } + + @objc + public init(text: String, hocr: String) { + self.swift = Riviera.GetOcrResult(text: text, hocr: hocr) + } + + let swift: Riviera.GetOcrResult + + public init(swift: Riviera.GetOcrResult) { + self.swift = swift } @objc - public init(structuredTranscript: DBXRivieraApiStructuredTranscript?) { - self.swift = Riviera.GetTranscriptResult(structuredTranscript: structuredTranscript?.swift) + public override var description: String { swift.description } +} + +/// Arguments for the asynchronous `get_text_async` route. Exactly one of `file_id`, `path`, or `url` must be +/// supplied via `file_id_or_url` to identify the document whose plain-text content should be extracted. +@objc +public class DBXRivieraGetTextArgs: NSObject { + /// Identifier of the document to extract text from. Callers must set exactly one of the `FileIdOrUrl` variants. + /// Text extraction is supported for common document formats (Word, PowerPoint, Excel, PDF, RTF, and Dropbox + /// document types); see the route description for the supported formats. Requests against unsupported + /// formats return `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared links + /// (www.dropbox.com) are supported. External (non-Dropbox) URLs are not supported and return + /// `unsupported_format_error`; import the file into Dropbox and reference it by `file_id` or `path` + /// instead. + @objc + public var fileIdOrUrl: DBXRivieraFileIdOrUrl? { guard let swift = swift.fileIdOrUrl else { return nil } + return DBXRivieraFileIdOrUrl(swift: swift) } - let swift: Riviera.GetTranscriptResult + @objc + public init(fileIdOrUrl: DBXRivieraFileIdOrUrl?) { + self.swift = Riviera.GetTextArgs(fileIdOrUrl: fileIdOrUrl?.swift) + } - public init(swift: Riviera.GetTranscriptResult) { + let swift: Riviera.GetTextArgs + + public init(swift: Riviera.GetTextArgs) { self.swift = swift } @@ -1236,14 +1457,506 @@ public class DBXRivieraGetTranscriptResult: NSObject { public override var description: String { swift.description } } -/// Reason a markdown conversion job failed. Returned in the `failed` variant of `GetMarkdownAsyncCheckResult`. This -/// is a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a -/// failed job is still a normal successful poll response). Callers should branch on the variant. +/// Result type for EventBus async check - must end in "CheckResult" @objc -public class DBXRivieraMarkdownConversionApiV2Error: NSObject { - let swift: Riviera.MarkdownConversionApiV2Error +public class DBXRivieraGetTextAsyncCheckResult: NSObject { + let swift: Riviera.GetTextAsyncCheckResult - public init(swift: Riviera.MarkdownConversionApiV2Error) { + public init(swift: Riviera.GetTextAsyncCheckResult) { + self.swift = swift + } + + public static func factory(swift: Riviera.GetTextAsyncCheckResult) -> DBXRivieraGetTextAsyncCheckResult { + switch swift { + case .inProgress: + return DBXRivieraGetTextAsyncCheckResultInProgress() + case .complete(let swiftArg): + let arg = DBXRivieraGetTextResult(swift: swiftArg) + return DBXRivieraGetTextAsyncCheckResultComplete(arg) + case .failed(let swiftArg): + let arg = DBXRivieraTextExtractionApiV2Error(swift: swiftArg) + return DBXRivieraGetTextAsyncCheckResultFailed(arg) + case .other: + return DBXRivieraGetTextAsyncCheckResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXRivieraGetTextAsyncCheckResultInProgress? { + self as? DBXRivieraGetTextAsyncCheckResultInProgress + } + + @objc + public var asComplete: DBXRivieraGetTextAsyncCheckResultComplete? { + self as? DBXRivieraGetTextAsyncCheckResultComplete + } + + @objc + public var asFailed: DBXRivieraGetTextAsyncCheckResultFailed? { + self as? DBXRivieraGetTextAsyncCheckResultFailed + } + + @objc + public var asOther: DBXRivieraGetTextAsyncCheckResultOther? { + self as? DBXRivieraGetTextAsyncCheckResultOther + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetTextAsyncCheckResultInProgress: DBXRivieraGetTextAsyncCheckResult { + @objc + public init() { + let swift = Riviera.GetTextAsyncCheckResult.inProgress + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetTextAsyncCheckResultComplete: DBXRivieraGetTextAsyncCheckResult { + @objc + public var complete: DBXRivieraGetTextResult + + @objc + public init(_ arg: DBXRivieraGetTextResult) { + self.complete = arg + let swift = Riviera.GetTextAsyncCheckResult.complete(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetTextAsyncCheckResultFailed: DBXRivieraGetTextAsyncCheckResult { + @objc + public var failed: DBXRivieraTextExtractionApiV2Error + + @objc + public init(_ arg: DBXRivieraTextExtractionApiV2Error) { + self.failed = arg + let swift = Riviera.GetTextAsyncCheckResult.failed(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetTextAsyncCheckResultOther: DBXRivieraGetTextAsyncCheckResult { + @objc + public init() { + let swift = Riviera.GetTextAsyncCheckResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetTextResult struct +@objc +public class DBXRivieraGetTextResult: NSObject { + /// The plain-text content extracted from the document. For multi-page documents the text is concatenated in + /// document order. May be empty when no text is detected in the source. + @objc + public var text: String { swift.text } + + @objc + public init(text: String) { + self.swift = Riviera.GetTextResult(text: text) + } + + let swift: Riviera.GetTextResult + + public init(swift: Riviera.GetTextResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Arguments for the asynchronous getTranscriptAsync route. Exactly one of fileId in FileIdOrUrl, path in +/// FileIdOrUrl, or url in FileIdOrUrl must be supplied via fileIdOrUrl in GetTranscriptArgs to identify the audio +/// or video asset to transcribe. +@objc +public class DBXRivieraGetTranscriptArgs: NSObject { + /// Identifier of the media asset to transcribe. Callers must set exactly one of the FileIdOrUrl variants. The + /// referenced asset must be an audio or video file in a supported format (see the route description for the + /// list); requests against files with no audio track fail with noAudioError in ContentApiV2Error. + @objc + public var fileIdOrUrl: DBXRivieraFileIdOrUrl? { guard let swift = swift.fileIdOrUrl else { return nil } + return DBXRivieraFileIdOrUrl(swift: swift) + } + + /// Granularity of the time offsets returned for each transcript segment. Defaults to sentence in TimestampLevel + /// when the field is omitted. + @objc + public var timestampLevel: DBXRivieraTimestampLevel { DBXRivieraTimestampLevel(swift: swift.timestampLevel) } + /// Comma-delimited list of non-lexical filler words to preserve in the transcript output, e.g. `"uh, ah, uhm"`. + /// By default these fillers are stripped. Unrecognized tokens are ignored. Leave empty to use the default + /// filtering behavior. + @objc + public var includedSpecialWords: String { swift.includedSpecialWords } + /// Hint for the spoken language of the source audio, as an ISO 639-1 code (e.g. "en", "ja"). When empty, the + /// service auto-detects the language; supplying a hint improves accuracy and latency for short or ambiguous + /// clips. Languages the service does not support fall back to auto-detection. + @objc + public var audioLanguage: String { swift.audioLanguage } + + @objc + public init(fileIdOrUrl: DBXRivieraFileIdOrUrl?, timestampLevel: DBXRivieraTimestampLevel, includedSpecialWords: String, audioLanguage: String) { + self.swift = Riviera.GetTranscriptArgs( + fileIdOrUrl: fileIdOrUrl?.swift, + timestampLevel: timestampLevel.swift, + includedSpecialWords: includedSpecialWords, + audioLanguage: audioLanguage + ) + } + + let swift: Riviera.GetTranscriptArgs + + public init(swift: Riviera.GetTranscriptArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Status of a transcript job started by getTranscriptAsync, as returned by getTranscriptAsyncCheck. +@objc +public class DBXRivieraGetTranscriptAsyncCheckResult: NSObject { + let swift: Riviera.GetTranscriptAsyncCheckResult + + public init(swift: Riviera.GetTranscriptAsyncCheckResult) { + self.swift = swift + } + + public static func factory(swift: Riviera.GetTranscriptAsyncCheckResult) -> DBXRivieraGetTranscriptAsyncCheckResult { + switch swift { + case .inProgress: + return DBXRivieraGetTranscriptAsyncCheckResultInProgress() + case .complete(let swiftArg): + let arg = DBXRivieraGetTranscriptResult(swift: swiftArg) + return DBXRivieraGetTranscriptAsyncCheckResultComplete(arg) + case .failed(let swiftArg): + let arg = DBXRivieraContentApiV2Error(swift: swiftArg) + return DBXRivieraGetTranscriptAsyncCheckResultFailed(arg) + case .other: + return DBXRivieraGetTranscriptAsyncCheckResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXRivieraGetTranscriptAsyncCheckResultInProgress? { + self as? DBXRivieraGetTranscriptAsyncCheckResultInProgress + } + + @objc + public var asComplete: DBXRivieraGetTranscriptAsyncCheckResultComplete? { + self as? DBXRivieraGetTranscriptAsyncCheckResultComplete + } + + @objc + public var asFailed: DBXRivieraGetTranscriptAsyncCheckResultFailed? { + self as? DBXRivieraGetTranscriptAsyncCheckResultFailed + } + + @objc + public var asOther: DBXRivieraGetTranscriptAsyncCheckResultOther? { + self as? DBXRivieraGetTranscriptAsyncCheckResultOther + } +} + +/// The job has not finished yet. Poll again. +@objc +public class DBXRivieraGetTranscriptAsyncCheckResultInProgress: DBXRivieraGetTranscriptAsyncCheckResult { + @objc + public init() { + let swift = Riviera.GetTranscriptAsyncCheckResult.inProgress + super.init(swift: swift) + } +} + +/// The job finished successfully. +@objc +public class DBXRivieraGetTranscriptAsyncCheckResultComplete: DBXRivieraGetTranscriptAsyncCheckResult { + @objc + public var complete: DBXRivieraGetTranscriptResult + + @objc + public init(_ arg: DBXRivieraGetTranscriptResult) { + self.complete = arg + let swift = Riviera.GetTranscriptAsyncCheckResult.complete(arg.swift) + super.init(swift: swift) + } +} + +/// The job finished unsuccessfully. +@objc +public class DBXRivieraGetTranscriptAsyncCheckResultFailed: DBXRivieraGetTranscriptAsyncCheckResult { + @objc + public var failed: DBXRivieraContentApiV2Error + + @objc + public init(_ arg: DBXRivieraContentApiV2Error) { + self.failed = arg + let swift = Riviera.GetTranscriptAsyncCheckResult.failed(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetTranscriptAsyncCheckResultOther: DBXRivieraGetTranscriptAsyncCheckResult { + @objc + public init() { + let swift = Riviera.GetTranscriptAsyncCheckResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetTranscriptResult struct +@objc +public class DBXRivieraGetTranscriptResult: NSObject { + /// The transcript produced for the requested media asset. + @objc + public var structuredTranscript: DBXRivieraApiStructuredTranscript? { guard let swift = swift.structuredTranscript else { return nil } + return DBXRivieraApiStructuredTranscript(swift: swift) + } + + @objc + public init(structuredTranscript: DBXRivieraApiStructuredTranscript?) { + self.swift = Riviera.GetTranscriptResult(structuredTranscript: structuredTranscript?.swift) + } + + let swift: Riviera.GetTranscriptResult + + public init(swift: Riviera.GetTranscriptResult) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Reason a keyframe extraction job failed. Returned in the `failed` variant of `GetKeyframesAsyncCheckResult`. +/// This is a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a +/// failed job is still a normal successful poll response). Callers should branch on the variant. +@objc +public class DBXRivieraKeyframesExtractionApiV2Error: NSObject { + let swift: Riviera.KeyframesExtractionApiV2Error + + public init(swift: Riviera.KeyframesExtractionApiV2Error) { + self.swift = swift + } + + public static func factory(swift: Riviera.KeyframesExtractionApiV2Error) -> DBXRivieraKeyframesExtractionApiV2Error { + switch swift { + case .serverError(let swiftArg): + let arg = swiftArg + return DBXRivieraKeyframesExtractionApiV2ErrorServerError(arg) + case .userError(let swiftArg): + let arg = swiftArg + return DBXRivieraKeyframesExtractionApiV2ErrorUserError(arg) + case .unsupportedFormatError: + return DBXRivieraKeyframesExtractionApiV2ErrorUnsupportedFormatError() + case .linkDownloadDisabledError: + return DBXRivieraKeyframesExtractionApiV2ErrorLinkDownloadDisabledError() + case .sharedLinkPasswordProtected: + return DBXRivieraKeyframesExtractionApiV2ErrorSharedLinkPasswordProtected() + case .limitExceededError: + return DBXRivieraKeyframesExtractionApiV2ErrorLimitExceededError() + case .conversionFailureError: + return DBXRivieraKeyframesExtractionApiV2ErrorConversionFailureError() + case .notFoundError: + return DBXRivieraKeyframesExtractionApiV2ErrorNotFoundError() + case .isAFolderError: + return DBXRivieraKeyframesExtractionApiV2ErrorIsAFolderError() + case .other: + return DBXRivieraKeyframesExtractionApiV2ErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asServerError: DBXRivieraKeyframesExtractionApiV2ErrorServerError? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorServerError + } + + @objc + public var asUserError: DBXRivieraKeyframesExtractionApiV2ErrorUserError? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorUserError + } + + @objc + public var asUnsupportedFormatError: DBXRivieraKeyframesExtractionApiV2ErrorUnsupportedFormatError? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorUnsupportedFormatError + } + + @objc + public var asLinkDownloadDisabledError: DBXRivieraKeyframesExtractionApiV2ErrorLinkDownloadDisabledError? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorLinkDownloadDisabledError + } + + @objc + public var asSharedLinkPasswordProtected: DBXRivieraKeyframesExtractionApiV2ErrorSharedLinkPasswordProtected? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorSharedLinkPasswordProtected + } + + @objc + public var asLimitExceededError: DBXRivieraKeyframesExtractionApiV2ErrorLimitExceededError? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorLimitExceededError + } + + @objc + public var asConversionFailureError: DBXRivieraKeyframesExtractionApiV2ErrorConversionFailureError? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorConversionFailureError + } + + @objc + public var asNotFoundError: DBXRivieraKeyframesExtractionApiV2ErrorNotFoundError? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorNotFoundError + } + + @objc + public var asIsAFolderError: DBXRivieraKeyframesExtractionApiV2ErrorIsAFolderError? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorIsAFolderError + } + + @objc + public var asOther: DBXRivieraKeyframesExtractionApiV2ErrorOther? { + self as? DBXRivieraKeyframesExtractionApiV2ErrorOther + } +} + +/// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying +/// with backoff may succeed. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorServerError: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public var serverError: String + + @objc + public init(_ arg: String) { + self.serverError = arg + let swift = Riviera.KeyframesExtractionApiV2Error.serverError(arg) + super.init(swift: swift) + } +} + +/// The request could not be processed as supplied (a problem with the caller's input). The string is a +/// human-readable message; retrying the same request will not help. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorUserError: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public var userError: String + + @objc + public init(_ arg: String) { + self.userError = arg + let swift = Riviera.KeyframesExtractionApiV2Error.userError(arg) + super.init(swift: swift) + } +} + +/// The source file is not in a format this route supports. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorUnsupportedFormatError: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.KeyframesExtractionApiV2Error.unsupportedFormatError + super.init(swift: swift) + } +} + +/// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorLinkDownloadDisabledError: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.KeyframesExtractionApiV2Error.linkDownloadDisabledError + super.init(swift: swift) + } +} + +/// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, +/// so such links cannot be processed. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorSharedLinkPasswordProtected: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.KeyframesExtractionApiV2Error.sharedLinkPasswordProtected + super.init(swift: swift) + } +} + +/// The request exceeded a service limit -- for example the source video is too large, or the extraction +/// produced more keyframes / more total image data than the response can carry. Lower the resolution, +/// raise `scene_change_threshold`, or set `include_images = false`. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorLimitExceededError: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.KeyframesExtractionApiV2Error.limitExceededError + super.init(swift: swift) + } +} + +/// The source file was readable but could not be processed, for example because it is corrupt. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorConversionFailureError: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.KeyframesExtractionApiV2Error.conversionFailureError + super.init(swift: swift) + } +} + +/// The referenced file does not exist or is not accessible. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorNotFoundError: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.KeyframesExtractionApiV2Error.notFoundError + super.init(swift: swift) + } +} + +/// The target is a folder, not a file. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorIsAFolderError: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.KeyframesExtractionApiV2Error.isAFolderError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraKeyframesExtractionApiV2ErrorOther: DBXRivieraKeyframesExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.KeyframesExtractionApiV2Error.other + super.init(swift: swift) + } +} + +/// Reason a markdown conversion job failed. Returned in the failed in GetMarkdownAsyncCheckResult variant. This is +/// a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a failed +/// job is still a normal successful poll response). Callers should branch on the variant. +@objc +public class DBXRivieraMarkdownConversionApiV2Error: NSObject { + let swift: Riviera.MarkdownConversionApiV2Error + + public init(swift: Riviera.MarkdownConversionApiV2Error) { self.swift = swift } @@ -1251,26 +1964,252 @@ public class DBXRivieraMarkdownConversionApiV2Error: NSObject { switch swift { case .serverError(let swiftArg): let arg = swiftArg - return DBXRivieraMarkdownConversionApiV2ErrorServerError(arg) + return DBXRivieraMarkdownConversionApiV2ErrorServerError(arg) + case .userError(let swiftArg): + let arg = swiftArg + return DBXRivieraMarkdownConversionApiV2ErrorUserError(arg) + case .unsupportedFormatError: + return DBXRivieraMarkdownConversionApiV2ErrorUnsupportedFormatError() + case .linkDownloadDisabledError: + return DBXRivieraMarkdownConversionApiV2ErrorLinkDownloadDisabledError() + case .sharedLinkPasswordProtected: + return DBXRivieraMarkdownConversionApiV2ErrorSharedLinkPasswordProtected() + case .limitExceededError: + return DBXRivieraMarkdownConversionApiV2ErrorLimitExceededError() + case .conversionFailureError: + return DBXRivieraMarkdownConversionApiV2ErrorConversionFailureError() + case .notFoundError: + return DBXRivieraMarkdownConversionApiV2ErrorNotFoundError() + case .isAFolderError: + return DBXRivieraMarkdownConversionApiV2ErrorIsAFolderError() + case .other: + return DBXRivieraMarkdownConversionApiV2ErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asServerError: DBXRivieraMarkdownConversionApiV2ErrorServerError? { + self as? DBXRivieraMarkdownConversionApiV2ErrorServerError + } + + @objc + public var asUserError: DBXRivieraMarkdownConversionApiV2ErrorUserError? { + self as? DBXRivieraMarkdownConversionApiV2ErrorUserError + } + + @objc + public var asUnsupportedFormatError: DBXRivieraMarkdownConversionApiV2ErrorUnsupportedFormatError? { + self as? DBXRivieraMarkdownConversionApiV2ErrorUnsupportedFormatError + } + + @objc + public var asLinkDownloadDisabledError: DBXRivieraMarkdownConversionApiV2ErrorLinkDownloadDisabledError? { + self as? DBXRivieraMarkdownConversionApiV2ErrorLinkDownloadDisabledError + } + + @objc + public var asSharedLinkPasswordProtected: DBXRivieraMarkdownConversionApiV2ErrorSharedLinkPasswordProtected? { + self as? DBXRivieraMarkdownConversionApiV2ErrorSharedLinkPasswordProtected + } + + @objc + public var asLimitExceededError: DBXRivieraMarkdownConversionApiV2ErrorLimitExceededError? { + self as? DBXRivieraMarkdownConversionApiV2ErrorLimitExceededError + } + + @objc + public var asConversionFailureError: DBXRivieraMarkdownConversionApiV2ErrorConversionFailureError? { + self as? DBXRivieraMarkdownConversionApiV2ErrorConversionFailureError + } + + @objc + public var asNotFoundError: DBXRivieraMarkdownConversionApiV2ErrorNotFoundError? { + self as? DBXRivieraMarkdownConversionApiV2ErrorNotFoundError + } + + @objc + public var asIsAFolderError: DBXRivieraMarkdownConversionApiV2ErrorIsAFolderError? { + self as? DBXRivieraMarkdownConversionApiV2ErrorIsAFolderError + } + + @objc + public var asOther: DBXRivieraMarkdownConversionApiV2ErrorOther? { + self as? DBXRivieraMarkdownConversionApiV2ErrorOther + } +} + +/// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying +/// with backoff may succeed. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorServerError: DBXRivieraMarkdownConversionApiV2Error { + @objc + public var serverError: String + + @objc + public init(_ arg: String) { + self.serverError = arg + let swift = Riviera.MarkdownConversionApiV2Error.serverError(arg) + super.init(swift: swift) + } +} + +/// The request could not be processed as supplied (a problem with the caller's input) -- for example an +/// unsupported file format or a file over the size limit. The string is a human-readable message; +/// retrying the same request will not help. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorUserError: DBXRivieraMarkdownConversionApiV2Error { + @objc + public var userError: String + + @objc + public init(_ arg: String) { + self.userError = arg + let swift = Riviera.MarkdownConversionApiV2Error.userError(arg) + super.init(swift: swift) + } +} + +/// The source file is not in a format this route can convert. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorUnsupportedFormatError: DBXRivieraMarkdownConversionApiV2Error { + @objc + public init() { + let swift = Riviera.MarkdownConversionApiV2Error.unsupportedFormatError + super.init(swift: swift) + } +} + +/// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorLinkDownloadDisabledError: DBXRivieraMarkdownConversionApiV2Error { + @objc + public init() { + let swift = Riviera.MarkdownConversionApiV2Error.linkDownloadDisabledError + super.init(swift: swift) + } +} + +/// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, +/// so such links cannot be converted. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorSharedLinkPasswordProtected: DBXRivieraMarkdownConversionApiV2Error { + @objc + public init() { + let swift = Riviera.MarkdownConversionApiV2Error.sharedLinkPasswordProtected + super.init(swift: swift) + } +} + +/// A resource limit was exceeded while producing the result. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorLimitExceededError: DBXRivieraMarkdownConversionApiV2Error { + @objc + public init() { + let swift = Riviera.MarkdownConversionApiV2Error.limitExceededError + super.init(swift: swift) + } +} + +/// The source file was readable but could not be converted, for example because it is corrupt. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorConversionFailureError: DBXRivieraMarkdownConversionApiV2Error { + @objc + public init() { + let swift = Riviera.MarkdownConversionApiV2Error.conversionFailureError + super.init(swift: swift) + } +} + +/// The referenced file does not exist or is not accessible. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorNotFoundError: DBXRivieraMarkdownConversionApiV2Error { + @objc + public init() { + let swift = Riviera.MarkdownConversionApiV2Error.notFoundError + super.init(swift: swift) + } +} + +/// The target is a folder, not a file. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorIsAFolderError: DBXRivieraMarkdownConversionApiV2Error { + @objc + public init() { + let swift = Riviera.MarkdownConversionApiV2Error.isAFolderError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraMarkdownConversionApiV2ErrorOther: DBXRivieraMarkdownConversionApiV2Error { + @objc + public init() { + let swift = Riviera.MarkdownConversionApiV2Error.other + super.init(swift: swift) + } +} + +/// Objective-C compatible MediaDurationError struct +@objc +public class DBXRivieraMediaDurationError: NSObject { + /// The maximum supported duration, in seconds, of the audio to transcribe. + @objc + public var limit: NSNumber { swift.limit as NSNumber } + + @objc + public init(limit: NSNumber) { + self.swift = Riviera.MediaDurationError(limit: limit.int32Value) + } + + let swift: Riviera.MediaDurationError + + public init(swift: Riviera.MediaDurationError) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Reason a metadata extraction job failed. Returned in the failed in GetMetadataAsyncCheckResult variant. This is +/// a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a failed +/// job is still a normal successful poll response). Callers should branch on the variant. +@objc +public class DBXRivieraMetadataExtractionApiV2Error: NSObject { + let swift: Riviera.MetadataExtractionApiV2Error + + public init(swift: Riviera.MetadataExtractionApiV2Error) { + self.swift = swift + } + + public static func factory(swift: Riviera.MetadataExtractionApiV2Error) -> DBXRivieraMetadataExtractionApiV2Error { + switch swift { + case .serverError(let swiftArg): + let arg = swiftArg + return DBXRivieraMetadataExtractionApiV2ErrorServerError(arg) case .userError(let swiftArg): let arg = swiftArg - return DBXRivieraMarkdownConversionApiV2ErrorUserError(arg) + return DBXRivieraMetadataExtractionApiV2ErrorUserError(arg) case .unsupportedFormatError: - return DBXRivieraMarkdownConversionApiV2ErrorUnsupportedFormatError() + return DBXRivieraMetadataExtractionApiV2ErrorUnsupportedFormatError() case .linkDownloadDisabledError: - return DBXRivieraMarkdownConversionApiV2ErrorLinkDownloadDisabledError() + return DBXRivieraMetadataExtractionApiV2ErrorLinkDownloadDisabledError() case .sharedLinkPasswordProtected: - return DBXRivieraMarkdownConversionApiV2ErrorSharedLinkPasswordProtected() + return DBXRivieraMetadataExtractionApiV2ErrorSharedLinkPasswordProtected() case .limitExceededError: - return DBXRivieraMarkdownConversionApiV2ErrorLimitExceededError() + return DBXRivieraMetadataExtractionApiV2ErrorLimitExceededError() case .conversionFailureError: - return DBXRivieraMarkdownConversionApiV2ErrorConversionFailureError() + return DBXRivieraMetadataExtractionApiV2ErrorConversionFailureError() case .notFoundError: - return DBXRivieraMarkdownConversionApiV2ErrorNotFoundError() + return DBXRivieraMetadataExtractionApiV2ErrorNotFoundError() case .isAFolderError: - return DBXRivieraMarkdownConversionApiV2ErrorIsAFolderError() + return DBXRivieraMetadataExtractionApiV2ErrorIsAFolderError() case .other: - return DBXRivieraMarkdownConversionApiV2ErrorOther() + return DBXRivieraMetadataExtractionApiV2ErrorOther() } } @@ -1278,223 +2217,328 @@ public class DBXRivieraMarkdownConversionApiV2Error: NSObject { public override var description: String { swift.description } @objc - public var asServerError: DBXRivieraMarkdownConversionApiV2ErrorServerError? { - self as? DBXRivieraMarkdownConversionApiV2ErrorServerError + public var asServerError: DBXRivieraMetadataExtractionApiV2ErrorServerError? { + self as? DBXRivieraMetadataExtractionApiV2ErrorServerError } @objc - public var asUserError: DBXRivieraMarkdownConversionApiV2ErrorUserError? { - self as? DBXRivieraMarkdownConversionApiV2ErrorUserError + public var asUserError: DBXRivieraMetadataExtractionApiV2ErrorUserError? { + self as? DBXRivieraMetadataExtractionApiV2ErrorUserError } @objc - public var asUnsupportedFormatError: DBXRivieraMarkdownConversionApiV2ErrorUnsupportedFormatError? { - self as? DBXRivieraMarkdownConversionApiV2ErrorUnsupportedFormatError + public var asUnsupportedFormatError: DBXRivieraMetadataExtractionApiV2ErrorUnsupportedFormatError? { + self as? DBXRivieraMetadataExtractionApiV2ErrorUnsupportedFormatError } @objc - public var asLinkDownloadDisabledError: DBXRivieraMarkdownConversionApiV2ErrorLinkDownloadDisabledError? { - self as? DBXRivieraMarkdownConversionApiV2ErrorLinkDownloadDisabledError + public var asLinkDownloadDisabledError: DBXRivieraMetadataExtractionApiV2ErrorLinkDownloadDisabledError? { + self as? DBXRivieraMetadataExtractionApiV2ErrorLinkDownloadDisabledError } @objc - public var asSharedLinkPasswordProtected: DBXRivieraMarkdownConversionApiV2ErrorSharedLinkPasswordProtected? { - self as? DBXRivieraMarkdownConversionApiV2ErrorSharedLinkPasswordProtected + public var asSharedLinkPasswordProtected: DBXRivieraMetadataExtractionApiV2ErrorSharedLinkPasswordProtected? { + self as? DBXRivieraMetadataExtractionApiV2ErrorSharedLinkPasswordProtected } @objc - public var asLimitExceededError: DBXRivieraMarkdownConversionApiV2ErrorLimitExceededError? { - self as? DBXRivieraMarkdownConversionApiV2ErrorLimitExceededError + public var asLimitExceededError: DBXRivieraMetadataExtractionApiV2ErrorLimitExceededError? { + self as? DBXRivieraMetadataExtractionApiV2ErrorLimitExceededError } @objc - public var asConversionFailureError: DBXRivieraMarkdownConversionApiV2ErrorConversionFailureError? { - self as? DBXRivieraMarkdownConversionApiV2ErrorConversionFailureError + public var asConversionFailureError: DBXRivieraMetadataExtractionApiV2ErrorConversionFailureError? { + self as? DBXRivieraMetadataExtractionApiV2ErrorConversionFailureError } @objc - public var asNotFoundError: DBXRivieraMarkdownConversionApiV2ErrorNotFoundError? { - self as? DBXRivieraMarkdownConversionApiV2ErrorNotFoundError + public var asNotFoundError: DBXRivieraMetadataExtractionApiV2ErrorNotFoundError? { + self as? DBXRivieraMetadataExtractionApiV2ErrorNotFoundError } @objc - public var asIsAFolderError: DBXRivieraMarkdownConversionApiV2ErrorIsAFolderError? { - self as? DBXRivieraMarkdownConversionApiV2ErrorIsAFolderError + public var asIsAFolderError: DBXRivieraMetadataExtractionApiV2ErrorIsAFolderError? { + self as? DBXRivieraMetadataExtractionApiV2ErrorIsAFolderError } @objc - public var asOther: DBXRivieraMarkdownConversionApiV2ErrorOther? { - self as? DBXRivieraMarkdownConversionApiV2ErrorOther + public var asOther: DBXRivieraMetadataExtractionApiV2ErrorOther? { + self as? DBXRivieraMetadataExtractionApiV2ErrorOther } } /// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying /// with backoff may succeed. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorServerError: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorServerError: DBXRivieraMetadataExtractionApiV2Error { @objc public var serverError: String @objc public init(_ arg: String) { self.serverError = arg - let swift = Riviera.MarkdownConversionApiV2Error.serverError(arg) + let swift = Riviera.MetadataExtractionApiV2Error.serverError(arg) super.init(swift: swift) } } -/// The request could not be processed as supplied (a problem with the caller's input). The string is a +/// The request could not be processed as supplied (a problem with the caller's input) -- for example an +/// unsupported file format or a file over the size limit for its metadata kind. The string is a /// human-readable message; retrying the same request will not help. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorUserError: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorUserError: DBXRivieraMetadataExtractionApiV2Error { @objc public var userError: String @objc public init(_ arg: String) { self.userError = arg - let swift = Riviera.MarkdownConversionApiV2Error.userError(arg) + let swift = Riviera.MetadataExtractionApiV2Error.userError(arg) super.init(swift: swift) } } -/// An unspecified error. +/// The source file is not in a format this route can extract metadata from. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorUnsupportedFormatError: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorUnsupportedFormatError: DBXRivieraMetadataExtractionApiV2Error { @objc public init() { - let swift = Riviera.MarkdownConversionApiV2Error.unsupportedFormatError + let swift = Riviera.MetadataExtractionApiV2Error.unsupportedFormatError super.init(swift: swift) } } -/// An unspecified error. +/// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorLinkDownloadDisabledError: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorLinkDownloadDisabledError: DBXRivieraMetadataExtractionApiV2Error { @objc public init() { - let swift = Riviera.MarkdownConversionApiV2Error.linkDownloadDisabledError + let swift = Riviera.MetadataExtractionApiV2Error.linkDownloadDisabledError super.init(swift: swift) } } -/// An unspecified error. +/// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, +/// so metadata cannot be extracted from such links. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorSharedLinkPasswordProtected: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorSharedLinkPasswordProtected: DBXRivieraMetadataExtractionApiV2Error { @objc public init() { - let swift = Riviera.MarkdownConversionApiV2Error.sharedLinkPasswordProtected + let swift = Riviera.MetadataExtractionApiV2Error.sharedLinkPasswordProtected super.init(swift: swift) } } -/// An unspecified error. +/// A resource limit was exceeded while producing the result. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorLimitExceededError: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorLimitExceededError: DBXRivieraMetadataExtractionApiV2Error { @objc public init() { - let swift = Riviera.MarkdownConversionApiV2Error.limitExceededError + let swift = Riviera.MetadataExtractionApiV2Error.limitExceededError super.init(swift: swift) } } -/// An unspecified error. +/// The source file was readable but its metadata could not be extracted, for example because the file is +/// corrupt. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorConversionFailureError: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorConversionFailureError: DBXRivieraMetadataExtractionApiV2Error { @objc public init() { - let swift = Riviera.MarkdownConversionApiV2Error.conversionFailureError + let swift = Riviera.MetadataExtractionApiV2Error.conversionFailureError super.init(swift: swift) } } /// The referenced file does not exist or is not accessible. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorNotFoundError: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorNotFoundError: DBXRivieraMetadataExtractionApiV2Error { @objc public init() { - let swift = Riviera.MarkdownConversionApiV2Error.notFoundError + let swift = Riviera.MetadataExtractionApiV2Error.notFoundError super.init(swift: swift) } } /// The target is a folder, not a file. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorIsAFolderError: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorIsAFolderError: DBXRivieraMetadataExtractionApiV2Error { @objc public init() { - let swift = Riviera.MarkdownConversionApiV2Error.isAFolderError + let swift = Riviera.MetadataExtractionApiV2Error.isAFolderError super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraMarkdownConversionApiV2ErrorOther: DBXRivieraMarkdownConversionApiV2Error { +public class DBXRivieraMetadataExtractionApiV2ErrorOther: DBXRivieraMetadataExtractionApiV2Error { @objc public init() { - let swift = Riviera.MarkdownConversionApiV2Error.other + let swift = Riviera.MetadataExtractionApiV2Error.other super.init(swift: swift) } } -/// Objective-C compatible MediaDurationError struct +/// Which metadata variant is populated in a GetMetadataResult, derived from the file type. @objc -public class DBXRivieraMediaDurationError: NSObject { - /// (no description) +public class DBXRivieraMetadataType: NSObject { + let swift: Riviera.MetadataType + + public init(swift: Riviera.MetadataType) { + self.swift = swift + } + + public static func factory(swift: Riviera.MetadataType) -> DBXRivieraMetadataType { + switch swift { + case .metadataTypeUnknown: + return DBXRivieraMetadataTypeMetadataTypeUnknown() + case .metadataTypeExif: + return DBXRivieraMetadataTypeMetadataTypeExif() + case .metadataTypeMedia: + return DBXRivieraMetadataTypeMetadataTypeMedia() + case .metadataTypePdf: + return DBXRivieraMetadataTypeMetadataTypePdf() + case .metadataTypeOffice: + return DBXRivieraMetadataTypeMetadataTypeOffice() + case .other: + return DBXRivieraMetadataTypeOther() + } + } + @objc - public var limit: NSNumber { swift.limit as NSNumber } + public override var description: String { swift.description } @objc - public init(limit: NSNumber) { - self.swift = Riviera.MediaDurationError(limit: limit.int32Value) + public var asMetadataTypeUnknown: DBXRivieraMetadataTypeMetadataTypeUnknown? { + self as? DBXRivieraMetadataTypeMetadataTypeUnknown } - let swift: Riviera.MediaDurationError + @objc + public var asMetadataTypeExif: DBXRivieraMetadataTypeMetadataTypeExif? { + self as? DBXRivieraMetadataTypeMetadataTypeExif + } - public init(swift: Riviera.MediaDurationError) { - self.swift = swift + @objc + public var asMetadataTypeMedia: DBXRivieraMetadataTypeMetadataTypeMedia? { + self as? DBXRivieraMetadataTypeMetadataTypeMedia } @objc - public override var description: String { swift.description } + public var asMetadataTypePdf: DBXRivieraMetadataTypeMetadataTypePdf? { + self as? DBXRivieraMetadataTypeMetadataTypePdf + } + + @objc + public var asMetadataTypeOffice: DBXRivieraMetadataTypeMetadataTypeOffice? { + self as? DBXRivieraMetadataTypeMetadataTypeOffice + } + + @objc + public var asOther: DBXRivieraMetadataTypeOther? { + self as? DBXRivieraMetadataTypeOther + } } -/// Reason a metadata extraction job failed. Returned in the `failed` variant of `GetMetadataAsyncCheckResult`. This -/// is a semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a -/// failed job is still a normal successful poll response). Callers should branch on the variant. +/// No metadata kind applies to the file, so no variant of metadata in GetMetadataResult is populated. Riviera +/// only produces metadata for the formats listed on getMetadataAsync; a request for any other file +/// normally fails with userError in MetadataExtractionApiV2Error rather than completing with this +/// value. An app that does receive it should treat the file as having no extractable metadata; retrying +/// will not change the outcome. @objc -public class DBXRivieraMetadataExtractionApiV2Error: NSObject { - let swift: Riviera.MetadataExtractionApiV2Error +public class DBXRivieraMetadataTypeMetadataTypeUnknown: DBXRivieraMetadataType { + @objc + public init() { + let swift = Riviera.MetadataType.metadataTypeUnknown + super.init(swift: swift) + } +} - public init(swift: Riviera.MetadataExtractionApiV2Error) { +/// exif in MetadataUnion is populated. +@objc +public class DBXRivieraMetadataTypeMetadataTypeExif: DBXRivieraMetadataType { + @objc + public init() { + let swift = Riviera.MetadataType.metadataTypeExif + super.init(swift: swift) + } +} + +/// media in MetadataUnion is populated. +@objc +public class DBXRivieraMetadataTypeMetadataTypeMedia: DBXRivieraMetadataType { + @objc + public init() { + let swift = Riviera.MetadataType.metadataTypeMedia + super.init(swift: swift) + } +} + +/// pdf in MetadataUnion is populated. +@objc +public class DBXRivieraMetadataTypeMetadataTypePdf: DBXRivieraMetadataType { + @objc + public init() { + let swift = Riviera.MetadataType.metadataTypePdf + super.init(swift: swift) + } +} + +/// office in MetadataUnion is populated. +@objc +public class DBXRivieraMetadataTypeMetadataTypeOffice: DBXRivieraMetadataType { + @objc + public init() { + let swift = Riviera.MetadataType.metadataTypeOffice + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraMetadataTypeOther: DBXRivieraMetadataType { + @objc + public init() { + let swift = Riviera.MetadataType.other + super.init(swift: swift) + } +} + +/// Reason an OCR extraction job failed. Returned in the `failed` variant of `GetOcrAsyncCheckResult`. This is a +/// semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a failed +/// job is still a normal successful poll response). Callers should branch on the variant. +@objc +public class DBXRivieraOcrExtractionApiV2Error: NSObject { + let swift: Riviera.OcrExtractionApiV2Error + + public init(swift: Riviera.OcrExtractionApiV2Error) { self.swift = swift } - public static func factory(swift: Riviera.MetadataExtractionApiV2Error) -> DBXRivieraMetadataExtractionApiV2Error { + public static func factory(swift: Riviera.OcrExtractionApiV2Error) -> DBXRivieraOcrExtractionApiV2Error { switch swift { case .serverError(let swiftArg): let arg = swiftArg - return DBXRivieraMetadataExtractionApiV2ErrorServerError(arg) + return DBXRivieraOcrExtractionApiV2ErrorServerError(arg) case .userError(let swiftArg): let arg = swiftArg - return DBXRivieraMetadataExtractionApiV2ErrorUserError(arg) + return DBXRivieraOcrExtractionApiV2ErrorUserError(arg) case .unsupportedFormatError: - return DBXRivieraMetadataExtractionApiV2ErrorUnsupportedFormatError() + return DBXRivieraOcrExtractionApiV2ErrorUnsupportedFormatError() case .linkDownloadDisabledError: - return DBXRivieraMetadataExtractionApiV2ErrorLinkDownloadDisabledError() + return DBXRivieraOcrExtractionApiV2ErrorLinkDownloadDisabledError() case .sharedLinkPasswordProtected: - return DBXRivieraMetadataExtractionApiV2ErrorSharedLinkPasswordProtected() + return DBXRivieraOcrExtractionApiV2ErrorSharedLinkPasswordProtected() case .limitExceededError: - return DBXRivieraMetadataExtractionApiV2ErrorLimitExceededError() + return DBXRivieraOcrExtractionApiV2ErrorLimitExceededError() case .conversionFailureError: - return DBXRivieraMetadataExtractionApiV2ErrorConversionFailureError() + return DBXRivieraOcrExtractionApiV2ErrorConversionFailureError() case .notFoundError: - return DBXRivieraMetadataExtractionApiV2ErrorNotFoundError() + return DBXRivieraOcrExtractionApiV2ErrorNotFoundError() case .isAFolderError: - return DBXRivieraMetadataExtractionApiV2ErrorIsAFolderError() + return DBXRivieraOcrExtractionApiV2ErrorIsAFolderError() case .other: - return DBXRivieraMetadataExtractionApiV2ErrorOther() + return DBXRivieraOcrExtractionApiV2ErrorOther() } } @@ -1502,67 +2546,67 @@ public class DBXRivieraMetadataExtractionApiV2Error: NSObject { public override var description: String { swift.description } @objc - public var asServerError: DBXRivieraMetadataExtractionApiV2ErrorServerError? { - self as? DBXRivieraMetadataExtractionApiV2ErrorServerError + public var asServerError: DBXRivieraOcrExtractionApiV2ErrorServerError? { + self as? DBXRivieraOcrExtractionApiV2ErrorServerError } @objc - public var asUserError: DBXRivieraMetadataExtractionApiV2ErrorUserError? { - self as? DBXRivieraMetadataExtractionApiV2ErrorUserError + public var asUserError: DBXRivieraOcrExtractionApiV2ErrorUserError? { + self as? DBXRivieraOcrExtractionApiV2ErrorUserError } @objc - public var asUnsupportedFormatError: DBXRivieraMetadataExtractionApiV2ErrorUnsupportedFormatError? { - self as? DBXRivieraMetadataExtractionApiV2ErrorUnsupportedFormatError + public var asUnsupportedFormatError: DBXRivieraOcrExtractionApiV2ErrorUnsupportedFormatError? { + self as? DBXRivieraOcrExtractionApiV2ErrorUnsupportedFormatError } @objc - public var asLinkDownloadDisabledError: DBXRivieraMetadataExtractionApiV2ErrorLinkDownloadDisabledError? { - self as? DBXRivieraMetadataExtractionApiV2ErrorLinkDownloadDisabledError + public var asLinkDownloadDisabledError: DBXRivieraOcrExtractionApiV2ErrorLinkDownloadDisabledError? { + self as? DBXRivieraOcrExtractionApiV2ErrorLinkDownloadDisabledError } @objc - public var asSharedLinkPasswordProtected: DBXRivieraMetadataExtractionApiV2ErrorSharedLinkPasswordProtected? { - self as? DBXRivieraMetadataExtractionApiV2ErrorSharedLinkPasswordProtected + public var asSharedLinkPasswordProtected: DBXRivieraOcrExtractionApiV2ErrorSharedLinkPasswordProtected? { + self as? DBXRivieraOcrExtractionApiV2ErrorSharedLinkPasswordProtected } @objc - public var asLimitExceededError: DBXRivieraMetadataExtractionApiV2ErrorLimitExceededError? { - self as? DBXRivieraMetadataExtractionApiV2ErrorLimitExceededError + public var asLimitExceededError: DBXRivieraOcrExtractionApiV2ErrorLimitExceededError? { + self as? DBXRivieraOcrExtractionApiV2ErrorLimitExceededError } @objc - public var asConversionFailureError: DBXRivieraMetadataExtractionApiV2ErrorConversionFailureError? { - self as? DBXRivieraMetadataExtractionApiV2ErrorConversionFailureError + public var asConversionFailureError: DBXRivieraOcrExtractionApiV2ErrorConversionFailureError? { + self as? DBXRivieraOcrExtractionApiV2ErrorConversionFailureError } @objc - public var asNotFoundError: DBXRivieraMetadataExtractionApiV2ErrorNotFoundError? { - self as? DBXRivieraMetadataExtractionApiV2ErrorNotFoundError + public var asNotFoundError: DBXRivieraOcrExtractionApiV2ErrorNotFoundError? { + self as? DBXRivieraOcrExtractionApiV2ErrorNotFoundError } @objc - public var asIsAFolderError: DBXRivieraMetadataExtractionApiV2ErrorIsAFolderError? { - self as? DBXRivieraMetadataExtractionApiV2ErrorIsAFolderError + public var asIsAFolderError: DBXRivieraOcrExtractionApiV2ErrorIsAFolderError? { + self as? DBXRivieraOcrExtractionApiV2ErrorIsAFolderError } @objc - public var asOther: DBXRivieraMetadataExtractionApiV2ErrorOther? { - self as? DBXRivieraMetadataExtractionApiV2ErrorOther + public var asOther: DBXRivieraOcrExtractionApiV2ErrorOther? { + self as? DBXRivieraOcrExtractionApiV2ErrorOther } } /// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying /// with backoff may succeed. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorServerError: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorServerError: DBXRivieraOcrExtractionApiV2Error { @objc public var serverError: String @objc public init(_ arg: String) { self.serverError = arg - let swift = Riviera.MetadataExtractionApiV2Error.serverError(arg) + let swift = Riviera.OcrExtractionApiV2Error.serverError(arg) super.init(swift: swift) } } @@ -1570,121 +2614,120 @@ public class DBXRivieraMetadataExtractionApiV2ErrorServerError: DBXRivieraMetada /// The request could not be processed as supplied (a problem with the caller's input). The string is a /// human-readable message; retrying the same request will not help. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorUserError: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorUserError: DBXRivieraOcrExtractionApiV2Error { @objc public var userError: String @objc public init(_ arg: String) { self.userError = arg - let swift = Riviera.MetadataExtractionApiV2Error.userError(arg) + let swift = Riviera.OcrExtractionApiV2Error.userError(arg) super.init(swift: swift) } } -/// An unspecified error. +/// The source file is not in a format this route supports. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorUnsupportedFormatError: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorUnsupportedFormatError: DBXRivieraOcrExtractionApiV2Error { @objc public init() { - let swift = Riviera.MetadataExtractionApiV2Error.unsupportedFormatError + let swift = Riviera.OcrExtractionApiV2Error.unsupportedFormatError super.init(swift: swift) } } -/// An unspecified error. +/// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorLinkDownloadDisabledError: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorLinkDownloadDisabledError: DBXRivieraOcrExtractionApiV2Error { @objc public init() { - let swift = Riviera.MetadataExtractionApiV2Error.linkDownloadDisabledError + let swift = Riviera.OcrExtractionApiV2Error.linkDownloadDisabledError super.init(swift: swift) } } -/// An unspecified error. +/// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, +/// so such links cannot be processed. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorSharedLinkPasswordProtected: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorSharedLinkPasswordProtected: DBXRivieraOcrExtractionApiV2Error { @objc public init() { - let swift = Riviera.MetadataExtractionApiV2Error.sharedLinkPasswordProtected + let swift = Riviera.OcrExtractionApiV2Error.sharedLinkPasswordProtected super.init(swift: swift) } } -/// An unspecified error. +/// A resource limit was exceeded while producing the result. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorLimitExceededError: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorLimitExceededError: DBXRivieraOcrExtractionApiV2Error { @objc public init() { - let swift = Riviera.MetadataExtractionApiV2Error.limitExceededError + let swift = Riviera.OcrExtractionApiV2Error.limitExceededError super.init(swift: swift) } } -/// An unspecified error. +/// The source file was readable but could not be processed, for example because it is corrupt. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorConversionFailureError: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorConversionFailureError: DBXRivieraOcrExtractionApiV2Error { @objc public init() { - let swift = Riviera.MetadataExtractionApiV2Error.conversionFailureError + let swift = Riviera.OcrExtractionApiV2Error.conversionFailureError super.init(swift: swift) } } /// The referenced file does not exist or is not accessible. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorNotFoundError: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorNotFoundError: DBXRivieraOcrExtractionApiV2Error { @objc public init() { - let swift = Riviera.MetadataExtractionApiV2Error.notFoundError + let swift = Riviera.OcrExtractionApiV2Error.notFoundError super.init(swift: swift) } } /// The target is a folder, not a file. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorIsAFolderError: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorIsAFolderError: DBXRivieraOcrExtractionApiV2Error { @objc public init() { - let swift = Riviera.MetadataExtractionApiV2Error.isAFolderError + let swift = Riviera.OcrExtractionApiV2Error.isAFolderError super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraMetadataExtractionApiV2ErrorOther: DBXRivieraMetadataExtractionApiV2Error { +public class DBXRivieraOcrExtractionApiV2ErrorOther: DBXRivieraOcrExtractionApiV2Error { @objc public init() { - let swift = Riviera.MetadataExtractionApiV2Error.other + let swift = Riviera.OcrExtractionApiV2Error.other super.init(swift: swift) } } -/// Which metadata variant is populated in a `GetMetadataResult`, derived from the file type. +/// The kind of MS Office document that produced an ApiOfficeMetadata result. @objc -public class DBXRivieraMetadataType: NSObject { - let swift: Riviera.MetadataType +public class DBXRivieraOfficeFileType: NSObject { + let swift: Riviera.OfficeFileType - public init(swift: Riviera.MetadataType) { + public init(swift: Riviera.OfficeFileType) { self.swift = swift } - public static func factory(swift: Riviera.MetadataType) -> DBXRivieraMetadataType { + public static func factory(swift: Riviera.OfficeFileType) -> DBXRivieraOfficeFileType { switch swift { - case .metadataTypeUnknown: - return DBXRivieraMetadataTypeMetadataTypeUnknown() - case .metadataTypeExif: - return DBXRivieraMetadataTypeMetadataTypeExif() - case .metadataTypeMedia: - return DBXRivieraMetadataTypeMetadataTypeMedia() - case .metadataTypePdf: - return DBXRivieraMetadataTypeMetadataTypePdf() - case .metadataTypeOffice: - return DBXRivieraMetadataTypeMetadataTypeOffice() + case .officeFiletypeUnknown: + return DBXRivieraOfficeFileTypeOfficeFiletypeUnknown() + case .officeFiletypeWord: + return DBXRivieraOfficeFileTypeOfficeFiletypeWord() + case .officeFiletypePowerpoint: + return DBXRivieraOfficeFileTypeOfficeFiletypePowerpoint() + case .officeFiletypeExcel: + return DBXRivieraOfficeFileTypeOfficeFiletypeExcel() case .other: - return DBXRivieraMetadataTypeOther() + return DBXRivieraOfficeFileTypeOther() } } @@ -1692,117 +2735,116 @@ public class DBXRivieraMetadataType: NSObject { public override var description: String { swift.description } @objc - public var asMetadataTypeUnknown: DBXRivieraMetadataTypeMetadataTypeUnknown? { - self as? DBXRivieraMetadataTypeMetadataTypeUnknown - } - - @objc - public var asMetadataTypeExif: DBXRivieraMetadataTypeMetadataTypeExif? { - self as? DBXRivieraMetadataTypeMetadataTypeExif - } - - @objc - public var asMetadataTypeMedia: DBXRivieraMetadataTypeMetadataTypeMedia? { - self as? DBXRivieraMetadataTypeMetadataTypeMedia + public var asOfficeFiletypeUnknown: DBXRivieraOfficeFileTypeOfficeFiletypeUnknown? { + self as? DBXRivieraOfficeFileTypeOfficeFiletypeUnknown } @objc - public var asMetadataTypePdf: DBXRivieraMetadataTypeMetadataTypePdf? { - self as? DBXRivieraMetadataTypeMetadataTypePdf + public var asOfficeFiletypeWord: DBXRivieraOfficeFileTypeOfficeFiletypeWord? { + self as? DBXRivieraOfficeFileTypeOfficeFiletypeWord } @objc - public var asMetadataTypeOffice: DBXRivieraMetadataTypeMetadataTypeOffice? { - self as? DBXRivieraMetadataTypeMetadataTypeOffice + public var asOfficeFiletypePowerpoint: DBXRivieraOfficeFileTypeOfficeFiletypePowerpoint? { + self as? DBXRivieraOfficeFileTypeOfficeFiletypePowerpoint } @objc - public var asOther: DBXRivieraMetadataTypeOther? { - self as? DBXRivieraMetadataTypeOther + public var asOfficeFiletypeExcel: DBXRivieraOfficeFileTypeOfficeFiletypeExcel? { + self as? DBXRivieraOfficeFileTypeOfficeFiletypeExcel } -} -/// An unspecified error. -@objc -public class DBXRivieraMetadataTypeMetadataTypeUnknown: DBXRivieraMetadataType { @objc - public init() { - let swift = Riviera.MetadataType.metadataTypeUnknown - super.init(swift: swift) + public var asOther: DBXRivieraOfficeFileTypeOther? { + self as? DBXRivieraOfficeFileTypeOther } } /// An unspecified error. @objc -public class DBXRivieraMetadataTypeMetadataTypeExif: DBXRivieraMetadataType { +public class DBXRivieraOfficeFileTypeOfficeFiletypeUnknown: DBXRivieraOfficeFileType { @objc public init() { - let swift = Riviera.MetadataType.metadataTypeExif + let swift = Riviera.OfficeFileType.officeFiletypeUnknown super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraMetadataTypeMetadataTypeMedia: DBXRivieraMetadataType { +public class DBXRivieraOfficeFileTypeOfficeFiletypeWord: DBXRivieraOfficeFileType { @objc public init() { - let swift = Riviera.MetadataType.metadataTypeMedia + let swift = Riviera.OfficeFileType.officeFiletypeWord super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraMetadataTypeMetadataTypePdf: DBXRivieraMetadataType { +public class DBXRivieraOfficeFileTypeOfficeFiletypePowerpoint: DBXRivieraOfficeFileType { @objc public init() { - let swift = Riviera.MetadataType.metadataTypePdf + let swift = Riviera.OfficeFileType.officeFiletypePowerpoint super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraMetadataTypeMetadataTypeOffice: DBXRivieraMetadataType { +public class DBXRivieraOfficeFileTypeOfficeFiletypeExcel: DBXRivieraOfficeFileType { @objc public init() { - let swift = Riviera.MetadataType.metadataTypeOffice + let swift = Riviera.OfficeFileType.officeFiletypeExcel super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraMetadataTypeOther: DBXRivieraMetadataType { +public class DBXRivieraOfficeFileTypeOther: DBXRivieraOfficeFileType { @objc public init() { - let swift = Riviera.MetadataType.other + let swift = Riviera.OfficeFileType.other super.init(swift: swift) } } -/// The kind of MS Office document that produced an `ApiOfficeMetadata` result. +/// Reason a text extraction job failed. Returned in the `failed` variant of `GetTextAsyncCheckResult`. This is a +/// semantic error union: the HTTP status of the poll request itself is unaffected (a poll that surfaces a failed +/// job is still a normal successful poll response). Callers should branch on the variant. @objc -public class DBXRivieraOfficeFileType: NSObject { - let swift: Riviera.OfficeFileType +public class DBXRivieraTextExtractionApiV2Error: NSObject { + let swift: Riviera.TextExtractionApiV2Error - public init(swift: Riviera.OfficeFileType) { + public init(swift: Riviera.TextExtractionApiV2Error) { self.swift = swift } - public static func factory(swift: Riviera.OfficeFileType) -> DBXRivieraOfficeFileType { + public static func factory(swift: Riviera.TextExtractionApiV2Error) -> DBXRivieraTextExtractionApiV2Error { switch swift { - case .officeFiletypeUnknown: - return DBXRivieraOfficeFileTypeOfficeFiletypeUnknown() - case .officeFiletypeWord: - return DBXRivieraOfficeFileTypeOfficeFiletypeWord() - case .officeFiletypePowerpoint: - return DBXRivieraOfficeFileTypeOfficeFiletypePowerpoint() - case .officeFiletypeExcel: - return DBXRivieraOfficeFileTypeOfficeFiletypeExcel() + case .serverError(let swiftArg): + let arg = swiftArg + return DBXRivieraTextExtractionApiV2ErrorServerError(arg) + case .userError(let swiftArg): + let arg = swiftArg + return DBXRivieraTextExtractionApiV2ErrorUserError(arg) + case .unsupportedFormatError: + return DBXRivieraTextExtractionApiV2ErrorUnsupportedFormatError() + case .linkDownloadDisabledError: + return DBXRivieraTextExtractionApiV2ErrorLinkDownloadDisabledError() + case .sharedLinkPasswordProtected: + return DBXRivieraTextExtractionApiV2ErrorSharedLinkPasswordProtected() + case .limitExceededError: + return DBXRivieraTextExtractionApiV2ErrorLimitExceededError() + case .conversionFailureError: + return DBXRivieraTextExtractionApiV2ErrorConversionFailureError() + case .notFoundError: + return DBXRivieraTextExtractionApiV2ErrorNotFoundError() + case .isAFolderError: + return DBXRivieraTextExtractionApiV2ErrorIsAFolderError() case .other: - return DBXRivieraOfficeFileTypeOther() + return DBXRivieraTextExtractionApiV2ErrorOther() } } @@ -1810,82 +2852,168 @@ public class DBXRivieraOfficeFileType: NSObject { public override var description: String { swift.description } @objc - public var asOfficeFiletypeUnknown: DBXRivieraOfficeFileTypeOfficeFiletypeUnknown? { - self as? DBXRivieraOfficeFileTypeOfficeFiletypeUnknown + public var asServerError: DBXRivieraTextExtractionApiV2ErrorServerError? { + self as? DBXRivieraTextExtractionApiV2ErrorServerError } @objc - public var asOfficeFiletypeWord: DBXRivieraOfficeFileTypeOfficeFiletypeWord? { - self as? DBXRivieraOfficeFileTypeOfficeFiletypeWord + public var asUserError: DBXRivieraTextExtractionApiV2ErrorUserError? { + self as? DBXRivieraTextExtractionApiV2ErrorUserError } @objc - public var asOfficeFiletypePowerpoint: DBXRivieraOfficeFileTypeOfficeFiletypePowerpoint? { - self as? DBXRivieraOfficeFileTypeOfficeFiletypePowerpoint + public var asUnsupportedFormatError: DBXRivieraTextExtractionApiV2ErrorUnsupportedFormatError? { + self as? DBXRivieraTextExtractionApiV2ErrorUnsupportedFormatError } @objc - public var asOfficeFiletypeExcel: DBXRivieraOfficeFileTypeOfficeFiletypeExcel? { - self as? DBXRivieraOfficeFileTypeOfficeFiletypeExcel + public var asLinkDownloadDisabledError: DBXRivieraTextExtractionApiV2ErrorLinkDownloadDisabledError? { + self as? DBXRivieraTextExtractionApiV2ErrorLinkDownloadDisabledError } @objc - public var asOther: DBXRivieraOfficeFileTypeOther? { - self as? DBXRivieraOfficeFileTypeOther + public var asSharedLinkPasswordProtected: DBXRivieraTextExtractionApiV2ErrorSharedLinkPasswordProtected? { + self as? DBXRivieraTextExtractionApiV2ErrorSharedLinkPasswordProtected + } + + @objc + public var asLimitExceededError: DBXRivieraTextExtractionApiV2ErrorLimitExceededError? { + self as? DBXRivieraTextExtractionApiV2ErrorLimitExceededError + } + + @objc + public var asConversionFailureError: DBXRivieraTextExtractionApiV2ErrorConversionFailureError? { + self as? DBXRivieraTextExtractionApiV2ErrorConversionFailureError + } + + @objc + public var asNotFoundError: DBXRivieraTextExtractionApiV2ErrorNotFoundError? { + self as? DBXRivieraTextExtractionApiV2ErrorNotFoundError + } + + @objc + public var asIsAFolderError: DBXRivieraTextExtractionApiV2ErrorIsAFolderError? { + self as? DBXRivieraTextExtractionApiV2ErrorIsAFolderError + } + + @objc + public var asOther: DBXRivieraTextExtractionApiV2ErrorOther? { + self as? DBXRivieraTextExtractionApiV2ErrorOther } } -/// An unspecified error. +/// An unexpected, typically transient, server-side failure. The string is a human-readable message; retrying +/// with backoff may succeed. @objc -public class DBXRivieraOfficeFileTypeOfficeFiletypeUnknown: DBXRivieraOfficeFileType { +public class DBXRivieraTextExtractionApiV2ErrorServerError: DBXRivieraTextExtractionApiV2Error { + @objc + public var serverError: String + + @objc + public init(_ arg: String) { + self.serverError = arg + let swift = Riviera.TextExtractionApiV2Error.serverError(arg) + super.init(swift: swift) + } +} + +/// The request could not be processed as supplied (a problem with the caller's input). The string is a +/// human-readable message; retrying the same request will not help. +@objc +public class DBXRivieraTextExtractionApiV2ErrorUserError: DBXRivieraTextExtractionApiV2Error { + @objc + public var userError: String + + @objc + public init(_ arg: String) { + self.userError = arg + let swift = Riviera.TextExtractionApiV2Error.userError(arg) + super.init(swift: swift) + } +} + +/// The source file is not in a format this route supports. +@objc +public class DBXRivieraTextExtractionApiV2ErrorUnsupportedFormatError: DBXRivieraTextExtractionApiV2Error { @objc public init() { - let swift = Riviera.OfficeFileType.officeFiletypeUnknown + let swift = Riviera.TextExtractionApiV2Error.unsupportedFormatError super.init(swift: swift) } } -/// An unspecified error. +/// url in FileIdOrUrl referenced a Dropbox shared link whose owner has disabled downloads. @objc -public class DBXRivieraOfficeFileTypeOfficeFiletypeWord: DBXRivieraOfficeFileType { +public class DBXRivieraTextExtractionApiV2ErrorLinkDownloadDisabledError: DBXRivieraTextExtractionApiV2Error { @objc public init() { - let swift = Riviera.OfficeFileType.officeFiletypeWord + let swift = Riviera.TextExtractionApiV2Error.linkDownloadDisabledError super.init(swift: swift) } } -/// An unspecified error. +/// url in FileIdOrUrl referenced a password-protected Dropbox shared link. Riviera cannot supply the password, +/// so such links cannot be processed. @objc -public class DBXRivieraOfficeFileTypeOfficeFiletypePowerpoint: DBXRivieraOfficeFileType { +public class DBXRivieraTextExtractionApiV2ErrorSharedLinkPasswordProtected: DBXRivieraTextExtractionApiV2Error { @objc public init() { - let swift = Riviera.OfficeFileType.officeFiletypePowerpoint + let swift = Riviera.TextExtractionApiV2Error.sharedLinkPasswordProtected super.init(swift: swift) } } -/// An unspecified error. +/// A resource limit was exceeded while producing the result. @objc -public class DBXRivieraOfficeFileTypeOfficeFiletypeExcel: DBXRivieraOfficeFileType { +public class DBXRivieraTextExtractionApiV2ErrorLimitExceededError: DBXRivieraTextExtractionApiV2Error { @objc public init() { - let swift = Riviera.OfficeFileType.officeFiletypeExcel + let swift = Riviera.TextExtractionApiV2Error.limitExceededError + super.init(swift: swift) + } +} + +/// The source file was readable but could not be processed, for example because it is corrupt. +@objc +public class DBXRivieraTextExtractionApiV2ErrorConversionFailureError: DBXRivieraTextExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.TextExtractionApiV2Error.conversionFailureError + super.init(swift: swift) + } +} + +/// The referenced file does not exist or is not accessible. +@objc +public class DBXRivieraTextExtractionApiV2ErrorNotFoundError: DBXRivieraTextExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.TextExtractionApiV2Error.notFoundError + super.init(swift: swift) + } +} + +/// The target is a folder, not a file. +@objc +public class DBXRivieraTextExtractionApiV2ErrorIsAFolderError: DBXRivieraTextExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.TextExtractionApiV2Error.isAFolderError super.init(swift: swift) } } /// An unspecified error. @objc -public class DBXRivieraOfficeFileTypeOther: DBXRivieraOfficeFileType { +public class DBXRivieraTextExtractionApiV2ErrorOther: DBXRivieraTextExtractionApiV2Error { @objc public init() { - let swift = Riviera.OfficeFileType.other + let swift = Riviera.TextExtractionApiV2Error.other super.init(swift: swift) } } -/// Objective-C compatible TimestampLevel union +/// Granularity of the time offsets returned for each transcript segment. @objc public class DBXRivieraTimestampLevel: NSObject { let swift: Riviera.TimestampLevel @@ -1924,7 +3052,8 @@ public class DBXRivieraTimestampLevel: NSObject { } } -/// An unspecified error. +/// One segment per spoken sentence (recommended). This is the default when timestampLevel in GetTranscriptArgs +/// is omitted. @objc public class DBXRivieraTimestampLevelSentence: DBXRivieraTimestampLevel { @objc @@ -1934,7 +3063,8 @@ public class DBXRivieraTimestampLevelSentence: DBXRivieraTimestampLevel { } } -/// An unspecified error. +/// One segment per word, useful for fine-grained alignment such as captioning or highlight-as-you-listen +/// experiences. @objc public class DBXRivieraTimestampLevelWord: DBXRivieraTimestampLevel { @objc @@ -1954,7 +3084,7 @@ public class DBXRivieraTimestampLevelOther: DBXRivieraTimestampLevel { } } -/// Exactly one variant is populated, corresponding to `metadata_type`. +/// The extracted metadata. Exactly one variant is populated, corresponding to metadataType in GetMetadataResult. @objc public class DBXRivieraMetadataUnion: NSObject { let swift: Riviera.MetadataUnion @@ -2011,7 +3141,7 @@ public class DBXRivieraMetadataUnion: NSObject { } } -/// An unspecified error. +/// EXIF metadata, for image files. @objc public class DBXRivieraMetadataUnionExif: DBXRivieraMetadataUnion { @objc @@ -2025,7 +3155,7 @@ public class DBXRivieraMetadataUnionExif: DBXRivieraMetadataUnion { } } -/// An unspecified error. +/// Container and per-stream metadata, for audio and video files. @objc public class DBXRivieraMetadataUnionMedia: DBXRivieraMetadataUnion { @objc @@ -2039,7 +3169,7 @@ public class DBXRivieraMetadataUnionMedia: DBXRivieraMetadataUnion { } } -/// An unspecified error. +/// Document metadata, for PDFs. @objc public class DBXRivieraMetadataUnionPdf: DBXRivieraMetadataUnion { @objc @@ -2053,7 +3183,7 @@ public class DBXRivieraMetadataUnionPdf: DBXRivieraMetadataUnion { } } -/// An unspecified error. +/// Document metadata, for MS Office files. @objc public class DBXRivieraMetadataUnionOffice: DBXRivieraMetadataUnion { @objc diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraAppAuthRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraAppAuthRoutes.swift index d2c78481..988caba6 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraAppAuthRoutes.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraAppAuthRoutes.swift @@ -19,15 +19,92 @@ public class DBXRivieraAppAuthRoutes: NSObject { public let client: DBXDropboxTransportClient + /// Asynchronous scene-change keyframe extraction for video files. Detects scene changes in the source video and + /// returns one representative keyframe per detected scene, each tagged with its timestamp (seconds from the + /// start of the video) and scene-change score. Set `include_images = true` to also receive each frame as a + /// base64-encoded JPEG; when the field is omitted the response carries keyframe metadata only. Supported video + /// formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, + /// .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. Unsupported formats return an + /// `unsupported_format_error`. Limits: the source file must be at most 10 GB. To keep responses within service + /// limits the number of keyframes and the total image payload are bounded; requests that would exceed these + /// limits return a `limit_exceeded_error` -- raise `scene_change_threshold` or set `include_images = false` to + /// stay within bounds. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the video file to extract keyframes from. Callers must set exactly one of + /// the `FileIdOrUrl` variants. Keyframe extraction is supported for video files only; see the route description + /// for the supported formats. Requests against unsupported formats return `unsupported_format_error`. + /// - parameter sceneChangeThreshold: Sensitivity of scene-change detection. A keyframe is emitted whenever the + /// frame-to-frame scene score crosses this threshold, so a LOWER value yields MORE keyframes. Valid range is + /// (0.0, 1.0]. When omitted (0.0) the service uses a default of 0.3, which is a good starting point for most + /// videos. + /// - parameter includeImages: When true, each returned keyframe includes the JPEG image bytes, base64-encoded, in + /// `ApiKeyframe.image_base64`. When false, the response contains only per-keyframe metadata (timestamp and + /// scene score) and `image_base64` is left empty -- useful when you only need the scene boundaries and want a + /// small response. NOTE: because the field defaults to false in proto3, callers who want images must set this + /// explicitly to true. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getKeyframesAsync(fileIdOrUrl: DBXRivieraFileIdOrUrl?, sceneChangeThreshold: NSNumber, includeImages: NSNumber) -> DBXRivieraGetKeyframesAsyncRpcRequest { + let swift = swift.getKeyframesAsync( + fileIdOrUrl: fileIdOrUrl?.swift, + sceneChangeThreshold: sceneChangeThreshold.doubleValue, + includeImages: includeImages.boolValue + ) + return DBXRivieraGetKeyframesAsyncRpcRequest(swift: swift) + } + + /// Asynchronous scene-change keyframe extraction for video files. Detects scene changes in the source video and + /// returns one representative keyframe per detected scene, each tagged with its timestamp (seconds from the + /// start of the video) and scene-change score. Set `include_images = true` to also receive each frame as a + /// base64-encoded JPEG; when the field is omitted the response carries keyframe metadata only. Supported video + /// formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, + /// .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. Unsupported formats return an + /// `unsupported_format_error`. Limits: the source file must be at most 10 GB. To keep responses within service + /// limits the number of keyframes and the total image payload are bounded; requests that would exceed these + /// limits return a `limit_exceeded_error` -- raise `scene_change_threshold` or set `include_images = false` to + /// stay within bounds. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getKeyframesAsync() -> DBXRivieraGetKeyframesAsyncRpcRequest { + let swift = swift.getKeyframesAsync() + return DBXRivieraGetKeyframesAsyncRpcRequest(swift: swift) + } + + /// Returns the status or result of specified get_keyframes_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetKeyframesAsyncCheckResult` + /// object on success or a `Async.PollError` object on failure. + @objc + @discardableResult public func getKeyframesAsyncCheck(asyncJobId: String) -> DBXRivieraGetKeyframesAsyncCheckRpcRequest { + let swift = swift.getKeyframesAsyncCheck(asyncJobId: asyncJobId) + return DBXRivieraGetKeyframesAsyncCheckRpcRequest(swift: swift) + } + /// Asynchronous document-to-markdown conversion for supported file formats. Supported formats: .binder, .docx, - /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Unsupported formats return an - /// `unsupported_format_error`. Size limit: the source file must be at most 50 MB. Larger files are rejected. + /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Files in other formats fail with userError in + /// MarkdownConversionApiV2Error. Size limit: the source file must be at most 50 MB. Larger files fail with + /// userError in MarkdownConversionApiV2Error. The markdown is not returned by this route. Poll + /// getMarkdownAsyncCheck with the returned async job ID until it reports complete in + /// GetMarkdownAsyncCheckResult or failed in GetMarkdownAsyncCheckResult. /// /// - scope: files.content.read /// - /// - parameter fileIdOrUrl: Identifier of the document to convert. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The referenced file must be a document in a supported format (see the route - /// description for the list); requests against unsupported formats return `unsupported_format_error`. + /// - parameter fileIdOrUrl: Identifier of the document to convert. Callers must set exactly one of the FileIdOrUrl + /// variants. The referenced file must be a document in a supported format (see the route description for the + /// list); requests against unsupported formats fail with userError in MarkdownConversionApiV2Error. /// - parameter enableOcr: Enable OCR for PDF documents. Processing is slower when enabled. /// - parameter embedImages: When true, embed images as base64 data URIs in the markdown output. This can /// significantly increase output size. @@ -41,8 +118,11 @@ public class DBXRivieraAppAuthRoutes: NSObject { } /// Asynchronous document-to-markdown conversion for supported file formats. Supported formats: .binder, .docx, - /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Unsupported formats return an - /// `unsupported_format_error`. Size limit: the source file must be at most 50 MB. Larger files are rejected. + /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Files in other formats fail with userError in + /// MarkdownConversionApiV2Error. Size limit: the source file must be at most 50 MB. Larger files fail with + /// userError in MarkdownConversionApiV2Error. The markdown is not returned by this route. Poll + /// getMarkdownAsyncCheck with the returned async job ID until it reports complete in + /// GetMarkdownAsyncCheckResult or failed in GetMarkdownAsyncCheckResult. /// /// - scope: files.content.read /// @@ -76,15 +156,20 @@ public class DBXRivieraAppAuthRoutes: NSObject { /// Audio/video (media) formats: .aac, .aif, .aiff, .flac, .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma, .3gp, /// .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, /// .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. - PDF format: .pdf. - MS Office formats: .docx, .pptx, .xlsx. - /// Unsupported formats return an `unsupported_format_error`. + /// Files in other formats fail with userError in MetadataExtractionApiV2Error. Size limits depend on the kind + /// of metadata being extracted: at most 200 MB for image (EXIF) files, 100 GB for audio/video files, 500 MB for + /// PDFs, and 288 MB for MS Office files. Files over the limit for their kind fail with userError in + /// MetadataExtractionApiV2Error. The metadata is not returned by this route. Poll getMetadataAsyncCheck with + /// the returned async job ID until it reports complete in GetMetadataAsyncCheckResult or failed in + /// GetMetadataAsyncCheckResult. /// /// - scope: files.content.read /// /// - parameter fileIdOrUrl: Identifier of the file to extract metadata from. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The kind of metadata returned is determined by the file type: image files return - /// EXIF metadata, audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents - /// (docx, pptx, xlsx) return Office metadata. See the route description for the supported formats. Requests - /// against unsupported formats return `unsupported_format_error`. + /// FileIdOrUrl variants. The kind of metadata returned is determined by the file type: image files return EXIF + /// metadata, audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents (docx, + /// pptx, xlsx) return Office metadata. See the route description for the supported formats. Requests against + /// unsupported formats fail with userError in MetadataExtractionApiV2Error. /// /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success /// or a `Void` object on failure. @@ -101,7 +186,12 @@ public class DBXRivieraAppAuthRoutes: NSObject { /// Audio/video (media) formats: .aac, .aif, .aiff, .flac, .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma, .3gp, /// .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, /// .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. - PDF format: .pdf. - MS Office formats: .docx, .pptx, .xlsx. - /// Unsupported formats return an `unsupported_format_error`. + /// Files in other formats fail with userError in MetadataExtractionApiV2Error. Size limits depend on the kind + /// of metadata being extracted: at most 200 MB for image (EXIF) files, 100 GB for audio/video files, 500 MB for + /// PDFs, and 288 MB for MS Office files. Files over the limit for their kind fail with userError in + /// MetadataExtractionApiV2Error. The metadata is not returned by this route. Poll getMetadataAsyncCheck with + /// the returned async job ID until it reports complete in GetMetadataAsyncCheckResult or failed in + /// GetMetadataAsyncCheckResult. /// /// - scope: files.content.read /// @@ -128,27 +218,141 @@ public class DBXRivieraAppAuthRoutes: NSObject { return DBXRivieraGetMetadataAsyncCheckRpcRequest(swift: swift) } + /// Asynchronous OCR (optical character recognition) text extraction for images and PDFs, including scanned / + /// non-text PDFs. Supported formats: - Image formats: .bmp, .gif, .heic, .jpeg, .jpg, .png, .tif, .tiff, .webp. + /// - PDF format: .pdf. Unsupported formats return an `unsupported_format_error`. For the `url` variant only + /// Dropbox shared links are supported; external URLs return `unsupported_format_error`. Text-based PDFs already + /// carry a text layer, so OCR is not run against them and the result is empty; use `get_text_async` to read the + /// embedded text layer of such a PDF. The result carries the extracted words as plain text, plus the same + /// content as hOCR with per-word coordinates. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the file to run OCR on. Callers must set exactly one of the `FileIdOrUrl` + /// variants. OCR is supported for image files and PDFs, including scanned / non-text PDFs; see the route + /// description for the supported formats. Requests against unsupported formats return + /// `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared links (www.dropbox.com) are + /// supported. External (non-Dropbox) URLs are not supported and return `unsupported_format_error`; import the + /// file into Dropbox and reference it by `file_id` or `path` instead. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getOcrAsync(fileIdOrUrl: DBXRivieraFileIdOrUrl?) -> DBXRivieraGetOcrAsyncRpcRequest { + let swift = swift.getOcrAsync(fileIdOrUrl: fileIdOrUrl?.swift) + return DBXRivieraGetOcrAsyncRpcRequest(swift: swift) + } + + /// Asynchronous OCR (optical character recognition) text extraction for images and PDFs, including scanned / + /// non-text PDFs. Supported formats: - Image formats: .bmp, .gif, .heic, .jpeg, .jpg, .png, .tif, .tiff, .webp. + /// - PDF format: .pdf. Unsupported formats return an `unsupported_format_error`. For the `url` variant only + /// Dropbox shared links are supported; external URLs return `unsupported_format_error`. Text-based PDFs already + /// carry a text layer, so OCR is not run against them and the result is empty; use `get_text_async` to read the + /// embedded text layer of such a PDF. The result carries the extracted words as plain text, plus the same + /// content as hOCR with per-word coordinates. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getOcrAsync() -> DBXRivieraGetOcrAsyncRpcRequest { + let swift = swift.getOcrAsync() + return DBXRivieraGetOcrAsyncRpcRequest(swift: swift) + } + + /// Returns the status or result of specified get_ocr_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetOcrAsyncCheckResult` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func getOcrAsyncCheck(asyncJobId: String) -> DBXRivieraGetOcrAsyncCheckRpcRequest { + let swift = swift.getOcrAsyncCheck(asyncJobId: asyncJobId) + return DBXRivieraGetOcrAsyncCheckRpcRequest(swift: swift) + } + + /// Asynchronous plain-text extraction from documents. Supported formats include: - Word processing: .doc, .docx, + /// .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox + /// document types: .paper, .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant only Dropbox shared links + /// are supported; external URLs return `unsupported_format_error`. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the document to extract text from. Callers must set exactly one of the + /// `FileIdOrUrl` variants. Text extraction is supported for common document formats (Word, PowerPoint, Excel, + /// PDF, RTF, and Dropbox document types); see the route description for the supported formats. Requests against + /// unsupported formats return `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared + /// links (www.dropbox.com) are supported. External (non-Dropbox) URLs are not supported and return + /// `unsupported_format_error`; import the file into Dropbox and reference it by `file_id` or `path` instead. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getTextAsync(fileIdOrUrl: DBXRivieraFileIdOrUrl?) -> DBXRivieraGetTextAsyncRpcRequest { + let swift = swift.getTextAsync(fileIdOrUrl: fileIdOrUrl?.swift) + return DBXRivieraGetTextAsyncRpcRequest(swift: swift) + } + + /// Asynchronous plain-text extraction from documents. Supported formats include: - Word processing: .doc, .docx, + /// .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox + /// document types: .paper, .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant only Dropbox shared links + /// are supported; external URLs return `unsupported_format_error`. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getTextAsync() -> DBXRivieraGetTextAsyncRpcRequest { + let swift = swift.getTextAsync() + return DBXRivieraGetTextAsyncRpcRequest(swift: swift) + } + + /// Returns the status or result of specified get_text_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetTextAsyncCheckResult` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func getTextAsyncCheck(asyncJobId: String) -> DBXRivieraGetTextAsyncCheckRpcRequest { + let swift = swift.getTextAsyncCheck(asyncJobId: asyncJobId) + return DBXRivieraGetTextAsyncCheckRpcRequest(swift: swift) + } + /// Asynchronous transcript generation for audio and video files. Supported audio formats: .aac, .aif, .aiff, .flac, /// .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma. Supported video formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, /// .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, - /// .wmv. Unsupported formats return an `unsupported_format_error`. Size limits: the source file must be at most - /// 10 GB and its audio track at most 1 hour in duration. Files exceeding these limits are rejected. + /// .wmv. Files in other formats fail with userError in ContentApiV2Error. Size limits: the source file must be + /// at most 10 GB and its audio track at most 1 hour in duration. Files exceeding either limit fail with + /// userError in ContentApiV2Error. The transcript is not returned by this route. Poll getTranscriptAsyncCheck + /// with the returned async job ID until it reports complete in GetTranscriptAsyncCheckResult or failed in + /// GetTranscriptAsyncCheckResult. /// /// - scope: files.content.read /// /// - parameter fileIdOrUrl: Identifier of the media asset to transcribe. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The referenced asset must be an audio or video file in a supported format (see the - /// route description for the list); requests against files with no audio track return a `no_audio_error`. + /// FileIdOrUrl variants. The referenced asset must be an audio or video file in a supported format (see the + /// route description for the list); requests against files with no audio track fail with noAudioError in + /// ContentApiV2Error. /// - parameter timestampLevel: Granularity of the time offsets returned for each transcript segment. Defaults to - /// `SENTENCE` when the field is omitted. - SENTENCE: one segment per spoken sentence (recommended). - WORD: one - /// segment per word, useful for fine-grained alignment such as captioning or highlight-as-you-listen - /// experiences. + /// sentence in TimestampLevel when the field is omitted. /// - parameter includedSpecialWords: Comma-delimited list of non-lexical filler words to preserve in the transcript /// output, e.g. `"uh, ah, uhm"`. By default these fillers are stripped. Unrecognized tokens are ignored. Leave /// empty to use the default filtering behavior. - /// - parameter audioLanguage: Optional ISO 639-1 two-letter language code hinting the spoken language of the source - /// audio (e.g. "en", "ja"). When empty, the service auto-detects the language; supplying a hint improves - /// accuracy and latency for short or ambiguous clips. Unsupported languages fall back to auto-detection. + /// - parameter audioLanguage: Hint for the spoken language of the source audio, as an ISO 639-1 code (e.g. "en", + /// "ja"). When empty, the service auto-detects the language; supplying a hint improves accuracy and latency for + /// short or ambiguous clips. Languages the service does not support fall back to auto-detection. /// /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success /// or a `Void` object on failure. @@ -171,8 +375,11 @@ public class DBXRivieraAppAuthRoutes: NSObject { /// Asynchronous transcript generation for audio and video files. Supported audio formats: .aac, .aif, .aiff, .flac, /// .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma. Supported video formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, /// .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, - /// .wmv. Unsupported formats return an `unsupported_format_error`. Size limits: the source file must be at most - /// 10 GB and its audio track at most 1 hour in duration. Files exceeding these limits are rejected. + /// .wmv. Files in other formats fail with userError in ContentApiV2Error. Size limits: the source file must be + /// at most 10 GB and its audio track at most 1 hour in duration. Files exceeding either limit fail with + /// userError in ContentApiV2Error. The transcript is not returned by this route. Poll getTranscriptAsyncCheck + /// with the returned async job ID until it reports complete in GetTranscriptAsyncCheckResult or failed in + /// GetTranscriptAsyncCheckResult. /// /// - scope: files.content.read /// diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraRoutes.swift index 93a5c9d7..f223f3bf 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraRoutes.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraRoutes.swift @@ -19,15 +19,92 @@ public class DBXRivieraRoutes: NSObject { public let client: DBXDropboxTransportClient + /// Asynchronous scene-change keyframe extraction for video files. Detects scene changes in the source video and + /// returns one representative keyframe per detected scene, each tagged with its timestamp (seconds from the + /// start of the video) and scene-change score. Set `include_images = true` to also receive each frame as a + /// base64-encoded JPEG; when the field is omitted the response carries keyframe metadata only. Supported video + /// formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, + /// .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. Unsupported formats return an + /// `unsupported_format_error`. Limits: the source file must be at most 10 GB. To keep responses within service + /// limits the number of keyframes and the total image payload are bounded; requests that would exceed these + /// limits return a `limit_exceeded_error` -- raise `scene_change_threshold` or set `include_images = false` to + /// stay within bounds. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the video file to extract keyframes from. Callers must set exactly one of + /// the `FileIdOrUrl` variants. Keyframe extraction is supported for video files only; see the route description + /// for the supported formats. Requests against unsupported formats return `unsupported_format_error`. + /// - parameter sceneChangeThreshold: Sensitivity of scene-change detection. A keyframe is emitted whenever the + /// frame-to-frame scene score crosses this threshold, so a LOWER value yields MORE keyframes. Valid range is + /// (0.0, 1.0]. When omitted (0.0) the service uses a default of 0.3, which is a good starting point for most + /// videos. + /// - parameter includeImages: When true, each returned keyframe includes the JPEG image bytes, base64-encoded, in + /// `ApiKeyframe.image_base64`. When false, the response contains only per-keyframe metadata (timestamp and + /// scene score) and `image_base64` is left empty -- useful when you only need the scene boundaries and want a + /// small response. NOTE: because the field defaults to false in proto3, callers who want images must set this + /// explicitly to true. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getKeyframesAsync(fileIdOrUrl: DBXRivieraFileIdOrUrl?, sceneChangeThreshold: NSNumber, includeImages: NSNumber) -> DBXRivieraGetKeyframesAsyncRpcRequest { + let swift = swift.getKeyframesAsync( + fileIdOrUrl: fileIdOrUrl?.swift, + sceneChangeThreshold: sceneChangeThreshold.doubleValue, + includeImages: includeImages.boolValue + ) + return DBXRivieraGetKeyframesAsyncRpcRequest(swift: swift) + } + + /// Asynchronous scene-change keyframe extraction for video files. Detects scene changes in the source video and + /// returns one representative keyframe per detected scene, each tagged with its timestamp (seconds from the + /// start of the video) and scene-change score. Set `include_images = true` to also receive each frame as a + /// base64-encoded JPEG; when the field is omitted the response carries keyframe metadata only. Supported video + /// formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, + /// .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. Unsupported formats return an + /// `unsupported_format_error`. Limits: the source file must be at most 10 GB. To keep responses within service + /// limits the number of keyframes and the total image payload are bounded; requests that would exceed these + /// limits return a `limit_exceeded_error` -- raise `scene_change_threshold` or set `include_images = false` to + /// stay within bounds. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getKeyframesAsync() -> DBXRivieraGetKeyframesAsyncRpcRequest { + let swift = swift.getKeyframesAsync() + return DBXRivieraGetKeyframesAsyncRpcRequest(swift: swift) + } + + /// Returns the status or result of specified get_keyframes_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetKeyframesAsyncCheckResult` + /// object on success or a `Async.PollError` object on failure. + @objc + @discardableResult public func getKeyframesAsyncCheck(asyncJobId: String) -> DBXRivieraGetKeyframesAsyncCheckRpcRequest { + let swift = swift.getKeyframesAsyncCheck(asyncJobId: asyncJobId) + return DBXRivieraGetKeyframesAsyncCheckRpcRequest(swift: swift) + } + /// Asynchronous document-to-markdown conversion for supported file formats. Supported formats: .binder, .docx, - /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Unsupported formats return an - /// `unsupported_format_error`. Size limit: the source file must be at most 50 MB. Larger files are rejected. + /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Files in other formats fail with userError in + /// MarkdownConversionApiV2Error. Size limit: the source file must be at most 50 MB. Larger files fail with + /// userError in MarkdownConversionApiV2Error. The markdown is not returned by this route. Poll + /// getMarkdownAsyncCheck with the returned async job ID until it reports complete in + /// GetMarkdownAsyncCheckResult or failed in GetMarkdownAsyncCheckResult. /// /// - scope: files.content.read /// - /// - parameter fileIdOrUrl: Identifier of the document to convert. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The referenced file must be a document in a supported format (see the route - /// description for the list); requests against unsupported formats return `unsupported_format_error`. + /// - parameter fileIdOrUrl: Identifier of the document to convert. Callers must set exactly one of the FileIdOrUrl + /// variants. The referenced file must be a document in a supported format (see the route description for the + /// list); requests against unsupported formats fail with userError in MarkdownConversionApiV2Error. /// - parameter enableOcr: Enable OCR for PDF documents. Processing is slower when enabled. /// - parameter embedImages: When true, embed images as base64 data URIs in the markdown output. This can /// significantly increase output size. @@ -41,8 +118,11 @@ public class DBXRivieraRoutes: NSObject { } /// Asynchronous document-to-markdown conversion for supported file formats. Supported formats: .binder, .docx, - /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Unsupported formats return an - /// `unsupported_format_error`. Size limit: the source file must be at most 50 MB. Larger files are rejected. + /// .html, .paper, .papert, .pptx, .xlsx, .gsheet, .ods, .pdf. Files in other formats fail with userError in + /// MarkdownConversionApiV2Error. Size limit: the source file must be at most 50 MB. Larger files fail with + /// userError in MarkdownConversionApiV2Error. The markdown is not returned by this route. Poll + /// getMarkdownAsyncCheck with the returned async job ID until it reports complete in + /// GetMarkdownAsyncCheckResult or failed in GetMarkdownAsyncCheckResult. /// /// - scope: files.content.read /// @@ -76,15 +156,20 @@ public class DBXRivieraRoutes: NSObject { /// Audio/video (media) formats: .aac, .aif, .aiff, .flac, .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma, .3gp, /// .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, /// .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. - PDF format: .pdf. - MS Office formats: .docx, .pptx, .xlsx. - /// Unsupported formats return an `unsupported_format_error`. + /// Files in other formats fail with userError in MetadataExtractionApiV2Error. Size limits depend on the kind + /// of metadata being extracted: at most 200 MB for image (EXIF) files, 100 GB for audio/video files, 500 MB for + /// PDFs, and 288 MB for MS Office files. Files over the limit for their kind fail with userError in + /// MetadataExtractionApiV2Error. The metadata is not returned by this route. Poll getMetadataAsyncCheck with + /// the returned async job ID until it reports complete in GetMetadataAsyncCheckResult or failed in + /// GetMetadataAsyncCheckResult. /// /// - scope: files.content.read /// /// - parameter fileIdOrUrl: Identifier of the file to extract metadata from. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The kind of metadata returned is determined by the file type: image files return - /// EXIF metadata, audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents - /// (docx, pptx, xlsx) return Office metadata. See the route description for the supported formats. Requests - /// against unsupported formats return `unsupported_format_error`. + /// FileIdOrUrl variants. The kind of metadata returned is determined by the file type: image files return EXIF + /// metadata, audio/video files return media metadata, PDFs return PDF metadata, and MS Office documents (docx, + /// pptx, xlsx) return Office metadata. See the route description for the supported formats. Requests against + /// unsupported formats fail with userError in MetadataExtractionApiV2Error. /// /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success /// or a `Void` object on failure. @@ -101,7 +186,12 @@ public class DBXRivieraRoutes: NSObject { /// Audio/video (media) formats: .aac, .aif, .aiff, .flac, .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma, .3gp, /// .3gpp, .3gpp2, .asf, .avi, .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, /// .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. - PDF format: .pdf. - MS Office formats: .docx, .pptx, .xlsx. - /// Unsupported formats return an `unsupported_format_error`. + /// Files in other formats fail with userError in MetadataExtractionApiV2Error. Size limits depend on the kind + /// of metadata being extracted: at most 200 MB for image (EXIF) files, 100 GB for audio/video files, 500 MB for + /// PDFs, and 288 MB for MS Office files. Files over the limit for their kind fail with userError in + /// MetadataExtractionApiV2Error. The metadata is not returned by this route. Poll getMetadataAsyncCheck with + /// the returned async job ID until it reports complete in GetMetadataAsyncCheckResult or failed in + /// GetMetadataAsyncCheckResult. /// /// - scope: files.content.read /// @@ -128,27 +218,141 @@ public class DBXRivieraRoutes: NSObject { return DBXRivieraGetMetadataAsyncCheckRpcRequest(swift: swift) } + /// Asynchronous OCR (optical character recognition) text extraction for images and PDFs, including scanned / + /// non-text PDFs. Supported formats: - Image formats: .bmp, .gif, .heic, .jpeg, .jpg, .png, .tif, .tiff, .webp. + /// - PDF format: .pdf. Unsupported formats return an `unsupported_format_error`. For the `url` variant only + /// Dropbox shared links are supported; external URLs return `unsupported_format_error`. Text-based PDFs already + /// carry a text layer, so OCR is not run against them and the result is empty; use `get_text_async` to read the + /// embedded text layer of such a PDF. The result carries the extracted words as plain text, plus the same + /// content as hOCR with per-word coordinates. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the file to run OCR on. Callers must set exactly one of the `FileIdOrUrl` + /// variants. OCR is supported for image files and PDFs, including scanned / non-text PDFs; see the route + /// description for the supported formats. Requests against unsupported formats return + /// `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared links (www.dropbox.com) are + /// supported. External (non-Dropbox) URLs are not supported and return `unsupported_format_error`; import the + /// file into Dropbox and reference it by `file_id` or `path` instead. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getOcrAsync(fileIdOrUrl: DBXRivieraFileIdOrUrl?) -> DBXRivieraGetOcrAsyncRpcRequest { + let swift = swift.getOcrAsync(fileIdOrUrl: fileIdOrUrl?.swift) + return DBXRivieraGetOcrAsyncRpcRequest(swift: swift) + } + + /// Asynchronous OCR (optical character recognition) text extraction for images and PDFs, including scanned / + /// non-text PDFs. Supported formats: - Image formats: .bmp, .gif, .heic, .jpeg, .jpg, .png, .tif, .tiff, .webp. + /// - PDF format: .pdf. Unsupported formats return an `unsupported_format_error`. For the `url` variant only + /// Dropbox shared links are supported; external URLs return `unsupported_format_error`. Text-based PDFs already + /// carry a text layer, so OCR is not run against them and the result is empty; use `get_text_async` to read the + /// embedded text layer of such a PDF. The result carries the extracted words as plain text, plus the same + /// content as hOCR with per-word coordinates. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getOcrAsync() -> DBXRivieraGetOcrAsyncRpcRequest { + let swift = swift.getOcrAsync() + return DBXRivieraGetOcrAsyncRpcRequest(swift: swift) + } + + /// Returns the status or result of specified get_ocr_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetOcrAsyncCheckResult` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func getOcrAsyncCheck(asyncJobId: String) -> DBXRivieraGetOcrAsyncCheckRpcRequest { + let swift = swift.getOcrAsyncCheck(asyncJobId: asyncJobId) + return DBXRivieraGetOcrAsyncCheckRpcRequest(swift: swift) + } + + /// Asynchronous plain-text extraction from documents. Supported formats include: - Word processing: .doc, .docx, + /// .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox + /// document types: .paper, .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant only Dropbox shared links + /// are supported; external URLs return `unsupported_format_error`. + /// + /// - scope: files.content.read + /// + /// - parameter fileIdOrUrl: Identifier of the document to extract text from. Callers must set exactly one of the + /// `FileIdOrUrl` variants. Text extraction is supported for common document formats (Word, PowerPoint, Excel, + /// PDF, RTF, and Dropbox document types); see the route description for the supported formats. Requests against + /// unsupported formats return `unsupported_format_error`. NOTE: for the `url` variant, only Dropbox shared + /// links (www.dropbox.com) are supported. External (non-Dropbox) URLs are not supported and return + /// `unsupported_format_error`; import the file into Dropbox and reference it by `file_id` or `path` instead. + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getTextAsync(fileIdOrUrl: DBXRivieraFileIdOrUrl?) -> DBXRivieraGetTextAsyncRpcRequest { + let swift = swift.getTextAsync(fileIdOrUrl: fileIdOrUrl?.swift) + return DBXRivieraGetTextAsyncRpcRequest(swift: swift) + } + + /// Asynchronous plain-text extraction from documents. Supported formats include: - Word processing: .doc, .docx, + /// .docm, .rtf. - Presentations: .ppt, .pptx, .pptm. - Spreadsheets: .xls, .xlsx, .xlsm. - PDF: .pdf. - Dropbox + /// document types: .paper, .papert, .binder, .gdoc, .gsheet, .gslides. - Plain text / subtitles: .txt, .vtt. + /// Unsupported formats return an `unsupported_format_error`. For the `url` variant only Dropbox shared links + /// are supported; external URLs return `unsupported_format_error`. + /// + /// - scope: files.content.read + /// + /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success + /// or a `Void` object on failure. + @objc + @discardableResult public func getTextAsync() -> DBXRivieraGetTextAsyncRpcRequest { + let swift = swift.getTextAsync() + return DBXRivieraGetTextAsyncRpcRequest(swift: swift) + } + + /// Returns the status or result of specified get_text_async task. + /// + /// - scope: files.content.read + /// + /// - parameter asyncJobId: Id of the asynchronous job. This is the value of a response returned from the method + /// that launched the job. + /// + /// - returns: Through the response callback, the caller will receive a `Riviera.GetTextAsyncCheckResult` object on + /// success or a `Async.PollError` object on failure. + @objc + @discardableResult public func getTextAsyncCheck(asyncJobId: String) -> DBXRivieraGetTextAsyncCheckRpcRequest { + let swift = swift.getTextAsyncCheck(asyncJobId: asyncJobId) + return DBXRivieraGetTextAsyncCheckRpcRequest(swift: swift) + } + /// Asynchronous transcript generation for audio and video files. Supported audio formats: .aac, .aif, .aiff, .flac, /// .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma. Supported video formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, /// .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, - /// .wmv. Unsupported formats return an `unsupported_format_error`. Size limits: the source file must be at most - /// 10 GB and its audio track at most 1 hour in duration. Files exceeding these limits are rejected. + /// .wmv. Files in other formats fail with userError in ContentApiV2Error. Size limits: the source file must be + /// at most 10 GB and its audio track at most 1 hour in duration. Files exceeding either limit fail with + /// userError in ContentApiV2Error. The transcript is not returned by this route. Poll getTranscriptAsyncCheck + /// with the returned async job ID until it reports complete in GetTranscriptAsyncCheckResult or failed in + /// GetTranscriptAsyncCheckResult. /// /// - scope: files.content.read /// /// - parameter fileIdOrUrl: Identifier of the media asset to transcribe. Callers must set exactly one of the - /// `FileIdOrUrl` variants. The referenced asset must be an audio or video file in a supported format (see the - /// route description for the list); requests against files with no audio track return a `no_audio_error`. + /// FileIdOrUrl variants. The referenced asset must be an audio or video file in a supported format (see the + /// route description for the list); requests against files with no audio track fail with noAudioError in + /// ContentApiV2Error. /// - parameter timestampLevel: Granularity of the time offsets returned for each transcript segment. Defaults to - /// `SENTENCE` when the field is omitted. - SENTENCE: one segment per spoken sentence (recommended). - WORD: one - /// segment per word, useful for fine-grained alignment such as captioning or highlight-as-you-listen - /// experiences. + /// sentence in TimestampLevel when the field is omitted. /// - parameter includedSpecialWords: Comma-delimited list of non-lexical filler words to preserve in the transcript /// output, e.g. `"uh, ah, uhm"`. By default these fillers are stripped. Unrecognized tokens are ignored. Leave /// empty to use the default filtering behavior. - /// - parameter audioLanguage: Optional ISO 639-1 two-letter language code hinting the spoken language of the source - /// audio (e.g. "en", "ja"). When empty, the service auto-detects the language; supplying a hint improves - /// accuracy and latency for short or ambiguous clips. Unsupported languages fall back to auto-detection. + /// - parameter audioLanguage: Hint for the spoken language of the source audio, as an ISO 639-1 code (e.g. "en", + /// "ja"). When empty, the service auto-detects the language; supplying a hint improves accuracy and latency for + /// short or ambiguous clips. Languages the service does not support fall back to auto-detection. /// /// - returns: Through the response callback, the caller will receive a `Async.LaunchResultBase` object on success /// or a `Void` object on failure. @@ -171,8 +375,11 @@ public class DBXRivieraRoutes: NSObject { /// Asynchronous transcript generation for audio and video files. Supported audio formats: .aac, .aif, .aiff, .flac, /// .m4a, .m4r, .mp3, .oga, .ogg, .wav, .wma. Supported video formats: .3gp, .3gpp, .3gpp2, .asf, .avi, .dv, /// .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, .oggtheora, .ogv, .rm, .ts, .vob, .webm, - /// .wmv. Unsupported formats return an `unsupported_format_error`. Size limits: the source file must be at most - /// 10 GB and its audio track at most 1 hour in duration. Files exceeding these limits are rejected. + /// .wmv. Files in other formats fail with userError in ContentApiV2Error. Size limits: the source file must be + /// at most 10 GB and its audio track at most 1 hour in duration. Files exceeding either limit fail with + /// userError in ContentApiV2Error. The transcript is not returned by this route. Poll getTranscriptAsyncCheck + /// with the returned async job ID until it reports complete in GetTranscriptAsyncCheckResult or failed in + /// GetTranscriptAsyncCheckResult. /// /// - scope: files.content.read /// @@ -200,6 +407,129 @@ public class DBXRivieraRoutes: NSObject { } } +@objc +public class DBXRivieraGetKeyframesAsyncRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncLaunchResultBase?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncLaunchResultBase?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXAsyncLaunchResultBase? = nil + if let swift = result { + objc = DBXAsyncLaunchResultBase.factory(swift: swift) + } + completionHandler(objc, error?.objc) + } + return self + } + + @objc + public var clientPersistedString: String? { swift.clientPersistedString } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public var earliestBeginDate: Date? { swift.earliestBeginDate } + + @objc + public func persistingString(string: String?) -> Self { + swift.persistingString(string: string) + return self + } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public func settingEarliestBeginDate(date: Date?) -> Self { + swift.settingEarliestBeginDate(date: date) + return self + } + + @objc + public func cancel() { + swift.cancel() + } +} + +@objc +public class DBXRivieraGetKeyframesAsyncCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXRivieraGetKeyframesAsyncCheckResult?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXRivieraGetKeyframesAsyncCheckResult?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXAsyncPollError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXAsyncPollError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXRivieraGetKeyframesAsyncCheckResult? = nil + if let swift = result { + objc = DBXRivieraGetKeyframesAsyncCheckResult.factory(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public var clientPersistedString: String? { swift.clientPersistedString } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public var earliestBeginDate: Date? { swift.earliestBeginDate } + + @objc + public func persistingString(string: String?) -> Self { + swift.persistingString(string: string) + return self + } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public func settingEarliestBeginDate(date: Date?) -> Self { + swift.settingEarliestBeginDate(date: date) + return self + } + + @objc + public func cancel() { + swift.cancel() + } +} + @objc public class DBXRivieraGetMarkdownAsyncRpcRequest: NSObject, DBXRequest { var swift: RpcRequest @@ -446,6 +776,252 @@ public class DBXRivieraGetMetadataAsyncCheckRpcRequest: NSObject, DBXRequest { } } +@objc +public class DBXRivieraGetOcrAsyncRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncLaunchResultBase?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncLaunchResultBase?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXAsyncLaunchResultBase? = nil + if let swift = result { + objc = DBXAsyncLaunchResultBase.factory(swift: swift) + } + completionHandler(objc, error?.objc) + } + return self + } + + @objc + public var clientPersistedString: String? { swift.clientPersistedString } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public var earliestBeginDate: Date? { swift.earliestBeginDate } + + @objc + public func persistingString(string: String?) -> Self { + swift.persistingString(string: string) + return self + } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public func settingEarliestBeginDate(date: Date?) -> Self { + swift.settingEarliestBeginDate(date: date) + return self + } + + @objc + public func cancel() { + swift.cancel() + } +} + +@objc +public class DBXRivieraGetOcrAsyncCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXRivieraGetOcrAsyncCheckResult?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXRivieraGetOcrAsyncCheckResult?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXAsyncPollError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXAsyncPollError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXRivieraGetOcrAsyncCheckResult? = nil + if let swift = result { + objc = DBXRivieraGetOcrAsyncCheckResult.factory(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public var clientPersistedString: String? { swift.clientPersistedString } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public var earliestBeginDate: Date? { swift.earliestBeginDate } + + @objc + public func persistingString(string: String?) -> Self { + swift.persistingString(string: string) + return self + } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public func settingEarliestBeginDate(date: Date?) -> Self { + swift.settingEarliestBeginDate(date: date) + return self + } + + @objc + public func cancel() { + swift.cancel() + } +} + +@objc +public class DBXRivieraGetTextAsyncRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXAsyncLaunchResultBase?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXAsyncLaunchResultBase?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var objc: DBXAsyncLaunchResultBase? = nil + if let swift = result { + objc = DBXAsyncLaunchResultBase.factory(swift: swift) + } + completionHandler(objc, error?.objc) + } + return self + } + + @objc + public var clientPersistedString: String? { swift.clientPersistedString } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public var earliestBeginDate: Date? { swift.earliestBeginDate } + + @objc + public func persistingString(string: String?) -> Self { + swift.persistingString(string: string) + return self + } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public func settingEarliestBeginDate(date: Date?) -> Self { + swift.settingEarliestBeginDate(date: date) + return self + } + + @objc + public func cancel() { + swift.cancel() + } +} + +@objc +public class DBXRivieraGetTextAsyncCheckRpcRequest: NSObject, DBXRequest { + var swift: RpcRequest + + init(swift: RpcRequest) { + self.swift = swift + } + + @objc + @discardableResult public func response( + completionHandler: @escaping (DBXRivieraGetTextAsyncCheckResult?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + response(queue: nil, completionHandler: completionHandler) + } + + @objc + @discardableResult public func response( + queue: DispatchQueue?, + completionHandler: @escaping (DBXRivieraGetTextAsyncCheckResult?, DBXAsyncPollError?, DBXCallError?) -> Void + ) -> Self { + swift.response(queue: queue) { result, error in + var routeError: DBXAsyncPollError? + var callError: DBXCallError? + switch error { + case .routeError(let box, _, _, _): + routeError = DBXAsyncPollError(swift: box.unboxed) + callError = nil + default: + routeError = nil + callError = error?.objc + } + + var objc: DBXRivieraGetTextAsyncCheckResult? = nil + if let swift = result { + objc = DBXRivieraGetTextAsyncCheckResult.factory(swift: swift) + } + completionHandler(objc, routeError, callError) + } + return self + } + + @objc + public var clientPersistedString: String? { swift.clientPersistedString } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public var earliestBeginDate: Date? { swift.earliestBeginDate } + + @objc + public func persistingString(string: String?) -> Self { + swift.persistingString(string: string) + return self + } + + @available(iOS 13.0, macOS 10.13, *) + @objc + public func settingEarliestBeginDate(date: Date?) -> Self { + swift.settingEarliestBeginDate(date: date) + return self + } + + @objc + public func cancel() { + swift.cancel() + } +} + @objc public class DBXRivieraGetTranscriptAsyncRpcRequest: NSObject, DBXRequest { var swift: RpcRequest diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift index ad1423c7..493a3be3 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift @@ -12582,6 +12582,9 @@ public class DBXTeamLogEventDetails: NSObject { case .protectActionRemoveCollaboratorDetails(let swiftArg): let arg = DBXTeamLogProtectActionRemoveCollaboratorDetails(swift: swiftArg) return DBXTeamLogEventDetailsProtectActionRemoveCollaboratorDetails(arg) + case .protectActionRemoveDomainsDetails(let swiftArg): + let arg = DBXTeamLogProtectActionRemoveDomainsDetails(swift: swiftArg) + return DBXTeamLogEventDetailsProtectActionRemoveDomainsDetails(arg) case .protectActionRemoveLinkDetails(let swiftArg): let arg = DBXTeamLogProtectActionRemoveLinkDetails(swift: swiftArg) return DBXTeamLogEventDetailsProtectActionRemoveLinkDetails(arg) @@ -12591,6 +12594,21 @@ public class DBXTeamLogEventDetails: NSObject { case .protectInternalDomainsChangedDetails(let swiftArg): let arg = DBXTeamLogProtectInternalDomainsChangedDetails(swift: swiftArg) return DBXTeamLogEventDetailsProtectInternalDomainsChangedDetails(arg) + case .protectPolicyActivatedDetails(let swiftArg): + let arg = DBXTeamLogProtectPolicyActivatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsProtectPolicyActivatedDetails(arg) + case .protectPolicyDeactivatedDetails(let swiftArg): + let arg = DBXTeamLogProtectPolicyDeactivatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsProtectPolicyDeactivatedDetails(arg) + case .protectPolicyScheduledDetails(let swiftArg): + let arg = DBXTeamLogProtectPolicyScheduledDetails(swift: swiftArg) + return DBXTeamLogEventDetailsProtectPolicyScheduledDetails(arg) + case .protectPolicyUpdatedDetails(let swiftArg): + let arg = DBXTeamLogProtectPolicyUpdatedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsProtectPolicyUpdatedDetails(arg) + case .protectReportViewDetails(let swiftArg): + let arg = DBXTeamLogProtectReportViewDetails(swift: swiftArg) + return DBXTeamLogEventDetailsProtectReportViewDetails(arg) case .classificationCreateReportDetails(let swiftArg): let arg = DBXTeamLogClassificationCreateReportDetails(swift: swiftArg) return DBXTeamLogEventDetailsClassificationCreateReportDetails(arg) @@ -13437,6 +13455,12 @@ public class DBXTeamLogEventDetails: NSObject { case .teamExtensionsPolicyChangedDetails(let swiftArg): let arg = DBXTeamLogTeamExtensionsPolicyChangedDetails(swift: swiftArg) return DBXTeamLogEventDetailsTeamExtensionsPolicyChangedDetails(arg) + case .teamExternalSharingControlsActivationStateChangedDetails(let swiftArg): + let arg = DBXTeamLogTeamExternalSharingControlsActivationStateChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamExternalSharingControlsActivationStateChangedDetails(arg) + case .teamExternalSharingControlsRecipientListsChangedDetails(let swiftArg): + let arg = DBXTeamLogTeamExternalSharingControlsRecipientListsChangedDetails(swift: swiftArg) + return DBXTeamLogEventDetailsTeamExternalSharingControlsRecipientListsChangedDetails(arg) case .teamMemberStorageRequestPolicyChangedDetails(let swiftArg): let arg = DBXTeamLogTeamMemberStorageRequestPolicyChangedDetails(swift: swiftArg) return DBXTeamLogEventDetailsTeamMemberStorageRequestPolicyChangedDetails(arg) @@ -15035,6 +15059,11 @@ public class DBXTeamLogEventDetails: NSObject { return self as? DBXTeamLogEventDetailsProtectActionRemoveCollaboratorDetails } + @objc + public var asProtectActionRemoveDomainsDetails: DBXTeamLogEventDetailsProtectActionRemoveDomainsDetails? { + return self as? DBXTeamLogEventDetailsProtectActionRemoveDomainsDetails + } + @objc public var asProtectActionRemoveLinkDetails: DBXTeamLogEventDetailsProtectActionRemoveLinkDetails? { return self as? DBXTeamLogEventDetailsProtectActionRemoveLinkDetails @@ -15050,6 +15079,31 @@ public class DBXTeamLogEventDetails: NSObject { return self as? DBXTeamLogEventDetailsProtectInternalDomainsChangedDetails } + @objc + public var asProtectPolicyActivatedDetails: DBXTeamLogEventDetailsProtectPolicyActivatedDetails? { + return self as? DBXTeamLogEventDetailsProtectPolicyActivatedDetails + } + + @objc + public var asProtectPolicyDeactivatedDetails: DBXTeamLogEventDetailsProtectPolicyDeactivatedDetails? { + return self as? DBXTeamLogEventDetailsProtectPolicyDeactivatedDetails + } + + @objc + public var asProtectPolicyScheduledDetails: DBXTeamLogEventDetailsProtectPolicyScheduledDetails? { + return self as? DBXTeamLogEventDetailsProtectPolicyScheduledDetails + } + + @objc + public var asProtectPolicyUpdatedDetails: DBXTeamLogEventDetailsProtectPolicyUpdatedDetails? { + return self as? DBXTeamLogEventDetailsProtectPolicyUpdatedDetails + } + + @objc + public var asProtectReportViewDetails: DBXTeamLogEventDetailsProtectReportViewDetails? { + return self as? DBXTeamLogEventDetailsProtectReportViewDetails + } + @objc public var asClassificationCreateReportDetails: DBXTeamLogEventDetailsClassificationCreateReportDetails? { return self as? DBXTeamLogEventDetailsClassificationCreateReportDetails @@ -16460,6 +16514,16 @@ public class DBXTeamLogEventDetails: NSObject { return self as? DBXTeamLogEventDetailsTeamExtensionsPolicyChangedDetails } + @objc + public var asTeamExternalSharingControlsActivationStateChangedDetails: DBXTeamLogEventDetailsTeamExternalSharingControlsActivationStateChangedDetails? { + return self as? DBXTeamLogEventDetailsTeamExternalSharingControlsActivationStateChangedDetails + } + + @objc + public var asTeamExternalSharingControlsRecipientListsChangedDetails: DBXTeamLogEventDetailsTeamExternalSharingControlsRecipientListsChangedDetails? { + return self as? DBXTeamLogEventDetailsTeamExternalSharingControlsRecipientListsChangedDetails + } + @objc public var asTeamMemberStorageRequestPolicyChangedDetails: DBXTeamLogEventDetailsTeamMemberStorageRequestPolicyChangedDetails? { return self as? DBXTeamLogEventDetailsTeamMemberStorageRequestPolicyChangedDetails @@ -20714,6 +20778,20 @@ public class DBXTeamLogEventDetailsProtectActionRemoveCollaboratorDetails: DBXTe } } +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsProtectActionRemoveDomainsDetails: DBXTeamLogEventDetails { + @objc + public var protectActionRemoveDomainsDetails: DBXTeamLogProtectActionRemoveDomainsDetails + + @objc + public init(_ arg: DBXTeamLogProtectActionRemoveDomainsDetails) { + protectActionRemoveDomainsDetails = arg + let swift = TeamLog.EventDetails.protectActionRemoveDomainsDetails(arg.swift) + super.init(swift: swift) + } +} + /// An unspecified error. @objc public class DBXTeamLogEventDetailsProtectActionRemoveLinkDetails: DBXTeamLogEventDetails { @@ -20756,6 +20834,76 @@ public class DBXTeamLogEventDetailsProtectInternalDomainsChangedDetails: DBXTeam } } +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsProtectPolicyActivatedDetails: DBXTeamLogEventDetails { + @objc + public var protectPolicyActivatedDetails: DBXTeamLogProtectPolicyActivatedDetails + + @objc + public init(_ arg: DBXTeamLogProtectPolicyActivatedDetails) { + protectPolicyActivatedDetails = arg + let swift = TeamLog.EventDetails.protectPolicyActivatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsProtectPolicyDeactivatedDetails: DBXTeamLogEventDetails { + @objc + public var protectPolicyDeactivatedDetails: DBXTeamLogProtectPolicyDeactivatedDetails + + @objc + public init(_ arg: DBXTeamLogProtectPolicyDeactivatedDetails) { + protectPolicyDeactivatedDetails = arg + let swift = TeamLog.EventDetails.protectPolicyDeactivatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsProtectPolicyScheduledDetails: DBXTeamLogEventDetails { + @objc + public var protectPolicyScheduledDetails: DBXTeamLogProtectPolicyScheduledDetails + + @objc + public init(_ arg: DBXTeamLogProtectPolicyScheduledDetails) { + protectPolicyScheduledDetails = arg + let swift = TeamLog.EventDetails.protectPolicyScheduledDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsProtectPolicyUpdatedDetails: DBXTeamLogEventDetails { + @objc + public var protectPolicyUpdatedDetails: DBXTeamLogProtectPolicyUpdatedDetails + + @objc + public init(_ arg: DBXTeamLogProtectPolicyUpdatedDetails) { + protectPolicyUpdatedDetails = arg + let swift = TeamLog.EventDetails.protectPolicyUpdatedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsProtectReportViewDetails: DBXTeamLogEventDetails { + @objc + public var protectReportViewDetails: DBXTeamLogProtectReportViewDetails + + @objc + public init(_ arg: DBXTeamLogProtectReportViewDetails) { + protectReportViewDetails = arg + let swift = TeamLog.EventDetails.protectReportViewDetails(arg.swift) + super.init(swift: swift) + } +} + /// An unspecified error. @objc public class DBXTeamLogEventDetailsClassificationCreateReportDetails: DBXTeamLogEventDetails { @@ -24704,6 +24852,34 @@ public class DBXTeamLogEventDetailsTeamExtensionsPolicyChangedDetails: DBXTeamLo } } +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamExternalSharingControlsActivationStateChangedDetails: DBXTeamLogEventDetails { + @objc + public var teamExternalSharingControlsActivationStateChangedDetails: DBXTeamLogTeamExternalSharingControlsActivationStateChangedDetails + + @objc + public init(_ arg: DBXTeamLogTeamExternalSharingControlsActivationStateChangedDetails) { + teamExternalSharingControlsActivationStateChangedDetails = arg + let swift = TeamLog.EventDetails.teamExternalSharingControlsActivationStateChangedDetails(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogEventDetailsTeamExternalSharingControlsRecipientListsChangedDetails: DBXTeamLogEventDetails { + @objc + public var teamExternalSharingControlsRecipientListsChangedDetails: DBXTeamLogTeamExternalSharingControlsRecipientListsChangedDetails + + @objc + public init(_ arg: DBXTeamLogTeamExternalSharingControlsRecipientListsChangedDetails) { + teamExternalSharingControlsRecipientListsChangedDetails = arg + let swift = TeamLog.EventDetails.teamExternalSharingControlsRecipientListsChangedDetails(arg.swift) + super.init(swift: swift) + } +} + /// An unspecified error. @objc public class DBXTeamLogEventDetailsTeamMemberStorageRequestPolicyChangedDetails: DBXTeamLogEventDetails { @@ -26411,6 +26587,9 @@ public class DBXTeamLogEventType: NSObject { case .protectActionRemoveCollaborator(let swiftArg): let arg = DBXTeamLogProtectActionRemoveCollaboratorType(swift: swiftArg) return DBXTeamLogEventTypeProtectActionRemoveCollaborator(arg) + case .protectActionRemoveDomains(let swiftArg): + let arg = DBXTeamLogProtectActionRemoveDomainsType(swift: swiftArg) + return DBXTeamLogEventTypeProtectActionRemoveDomains(arg) case .protectActionRemoveLink(let swiftArg): let arg = DBXTeamLogProtectActionRemoveLinkType(swift: swiftArg) return DBXTeamLogEventTypeProtectActionRemoveLink(arg) @@ -26420,6 +26599,21 @@ public class DBXTeamLogEventType: NSObject { case .protectInternalDomainsChanged(let swiftArg): let arg = DBXTeamLogProtectInternalDomainsChangedType(swift: swiftArg) return DBXTeamLogEventTypeProtectInternalDomainsChanged(arg) + case .protectPolicyActivated(let swiftArg): + let arg = DBXTeamLogProtectPolicyActivatedType(swift: swiftArg) + return DBXTeamLogEventTypeProtectPolicyActivated(arg) + case .protectPolicyDeactivated(let swiftArg): + let arg = DBXTeamLogProtectPolicyDeactivatedType(swift: swiftArg) + return DBXTeamLogEventTypeProtectPolicyDeactivated(arg) + case .protectPolicyScheduled(let swiftArg): + let arg = DBXTeamLogProtectPolicyScheduledType(swift: swiftArg) + return DBXTeamLogEventTypeProtectPolicyScheduled(arg) + case .protectPolicyUpdated(let swiftArg): + let arg = DBXTeamLogProtectPolicyUpdatedType(swift: swiftArg) + return DBXTeamLogEventTypeProtectPolicyUpdated(arg) + case .protectReportView(let swiftArg): + let arg = DBXTeamLogProtectReportViewType(swift: swiftArg) + return DBXTeamLogEventTypeProtectReportView(arg) case .classificationCreateReport(let swiftArg): let arg = DBXTeamLogClassificationCreateReportType(swift: swiftArg) return DBXTeamLogEventTypeClassificationCreateReport(arg) @@ -27266,6 +27460,12 @@ public class DBXTeamLogEventType: NSObject { case .teamExtensionsPolicyChanged(let swiftArg): let arg = DBXTeamLogTeamExtensionsPolicyChangedType(swift: swiftArg) return DBXTeamLogEventTypeTeamExtensionsPolicyChanged(arg) + case .teamExternalSharingControlsActivationStateChanged(let swiftArg): + let arg = DBXTeamLogTeamExternalSharingControlsActivationStateChangedType(swift: swiftArg) + return DBXTeamLogEventTypeTeamExternalSharingControlsActivationStateChanged(arg) + case .teamExternalSharingControlsRecipientListsChanged(let swiftArg): + let arg = DBXTeamLogTeamExternalSharingControlsRecipientListsChangedType(swift: swiftArg) + return DBXTeamLogEventTypeTeamExternalSharingControlsRecipientListsChanged(arg) case .teamMemberStorageRequestPolicyChanged(let swiftArg): let arg = DBXTeamLogTeamMemberStorageRequestPolicyChangedType(swift: swiftArg) return DBXTeamLogEventTypeTeamMemberStorageRequestPolicyChanged(arg) @@ -28861,6 +29061,11 @@ public class DBXTeamLogEventType: NSObject { return self as? DBXTeamLogEventTypeProtectActionRemoveCollaborator } + @objc + public var asProtectActionRemoveDomains: DBXTeamLogEventTypeProtectActionRemoveDomains? { + return self as? DBXTeamLogEventTypeProtectActionRemoveDomains + } + @objc public var asProtectActionRemoveLink: DBXTeamLogEventTypeProtectActionRemoveLink? { return self as? DBXTeamLogEventTypeProtectActionRemoveLink @@ -28876,6 +29081,31 @@ public class DBXTeamLogEventType: NSObject { return self as? DBXTeamLogEventTypeProtectInternalDomainsChanged } + @objc + public var asProtectPolicyActivated: DBXTeamLogEventTypeProtectPolicyActivated? { + return self as? DBXTeamLogEventTypeProtectPolicyActivated + } + + @objc + public var asProtectPolicyDeactivated: DBXTeamLogEventTypeProtectPolicyDeactivated? { + return self as? DBXTeamLogEventTypeProtectPolicyDeactivated + } + + @objc + public var asProtectPolicyScheduled: DBXTeamLogEventTypeProtectPolicyScheduled? { + return self as? DBXTeamLogEventTypeProtectPolicyScheduled + } + + @objc + public var asProtectPolicyUpdated: DBXTeamLogEventTypeProtectPolicyUpdated? { + return self as? DBXTeamLogEventTypeProtectPolicyUpdated + } + + @objc + public var asProtectReportView: DBXTeamLogEventTypeProtectReportView? { + return self as? DBXTeamLogEventTypeProtectReportView + } + @objc public var asClassificationCreateReport: DBXTeamLogEventTypeClassificationCreateReport? { return self as? DBXTeamLogEventTypeClassificationCreateReport @@ -30286,6 +30516,16 @@ public class DBXTeamLogEventType: NSObject { return self as? DBXTeamLogEventTypeTeamExtensionsPolicyChanged } + @objc + public var asTeamExternalSharingControlsActivationStateChanged: DBXTeamLogEventTypeTeamExternalSharingControlsActivationStateChanged? { + return self as? DBXTeamLogEventTypeTeamExternalSharingControlsActivationStateChanged + } + + @objc + public var asTeamExternalSharingControlsRecipientListsChanged: DBXTeamLogEventTypeTeamExternalSharingControlsRecipientListsChanged? { + return self as? DBXTeamLogEventTypeTeamExternalSharingControlsRecipientListsChanged + } + @objc public var asTeamMemberStorageRequestPolicyChanged: DBXTeamLogEventTypeTeamMemberStorageRequestPolicyChanged? { return self as? DBXTeamLogEventTypeTeamMemberStorageRequestPolicyChanged @@ -34535,6 +34775,20 @@ public class DBXTeamLogEventTypeProtectActionRemoveCollaborator: DBXTeamLogEvent } } +/// (protect) Removed domains via Dropbox Protect +@objc +public class DBXTeamLogEventTypeProtectActionRemoveDomains: DBXTeamLogEventType { + @objc + public var protectActionRemoveDomains: DBXTeamLogProtectActionRemoveDomainsType + + @objc + public init(_ arg: DBXTeamLogProtectActionRemoveDomainsType) { + protectActionRemoveDomains = arg + let swift = TeamLog.EventType.protectActionRemoveDomains(arg.swift) + super.init(swift: swift) + } +} + /// (protect) Removed a link via Dropbox Protect @objc public class DBXTeamLogEventTypeProtectActionRemoveLink: DBXTeamLogEventType { @@ -34577,6 +34831,76 @@ public class DBXTeamLogEventTypeProtectInternalDomainsChanged: DBXTeamLogEventTy } } +/// (protect) Activated a Dropbox Protect policy +@objc +public class DBXTeamLogEventTypeProtectPolicyActivated: DBXTeamLogEventType { + @objc + public var protectPolicyActivated: DBXTeamLogProtectPolicyActivatedType + + @objc + public init(_ arg: DBXTeamLogProtectPolicyActivatedType) { + protectPolicyActivated = arg + let swift = TeamLog.EventType.protectPolicyActivated(arg.swift) + super.init(swift: swift) + } +} + +/// (protect) Deactivated a Dropbox Protect policy +@objc +public class DBXTeamLogEventTypeProtectPolicyDeactivated: DBXTeamLogEventType { + @objc + public var protectPolicyDeactivated: DBXTeamLogProtectPolicyDeactivatedType + + @objc + public init(_ arg: DBXTeamLogProtectPolicyDeactivatedType) { + protectPolicyDeactivated = arg + let swift = TeamLog.EventType.protectPolicyDeactivated(arg.swift) + super.init(swift: swift) + } +} + +/// (protect) Scheduled a Dropbox Protect policy +@objc +public class DBXTeamLogEventTypeProtectPolicyScheduled: DBXTeamLogEventType { + @objc + public var protectPolicyScheduled: DBXTeamLogProtectPolicyScheduledType + + @objc + public init(_ arg: DBXTeamLogProtectPolicyScheduledType) { + protectPolicyScheduled = arg + let swift = TeamLog.EventType.protectPolicyScheduled(arg.swift) + super.init(swift: swift) + } +} + +/// (protect) Updated a Dropbox Protect policy +@objc +public class DBXTeamLogEventTypeProtectPolicyUpdated: DBXTeamLogEventType { + @objc + public var protectPolicyUpdated: DBXTeamLogProtectPolicyUpdatedType + + @objc + public init(_ arg: DBXTeamLogProtectPolicyUpdatedType) { + protectPolicyUpdated = arg + let swift = TeamLog.EventType.protectPolicyUpdated(arg.swift) + super.init(swift: swift) + } +} + +/// (protect) Viewed a Dropbox Protect report +@objc +public class DBXTeamLogEventTypeProtectReportView: DBXTeamLogEventType { + @objc + public var protectReportView: DBXTeamLogProtectReportViewType + + @objc + public init(_ arg: DBXTeamLogProtectReportViewType) { + protectReportView = arg + let swift = TeamLog.EventType.protectReportView(arg.swift) + super.init(swift: swift) + } +} + /// (reports) Created Classification report @objc public class DBXTeamLogEventTypeClassificationCreateReport: DBXTeamLogEventType { @@ -38531,6 +38855,34 @@ public class DBXTeamLogEventTypeTeamExtensionsPolicyChanged: DBXTeamLogEventType } } +/// (team_policies) Changed external sharing controls activation state +@objc +public class DBXTeamLogEventTypeTeamExternalSharingControlsActivationStateChanged: DBXTeamLogEventType { + @objc + public var teamExternalSharingControlsActivationStateChanged: DBXTeamLogTeamExternalSharingControlsActivationStateChangedType + + @objc + public init(_ arg: DBXTeamLogTeamExternalSharingControlsActivationStateChangedType) { + teamExternalSharingControlsActivationStateChanged = arg + let swift = TeamLog.EventType.teamExternalSharingControlsActivationStateChanged(arg.swift) + super.init(swift: swift) + } +} + +/// (team_policies) Changed approved or blocked entries for external sharing controls +@objc +public class DBXTeamLogEventTypeTeamExternalSharingControlsRecipientListsChanged: DBXTeamLogEventType { + @objc + public var teamExternalSharingControlsRecipientListsChanged: DBXTeamLogTeamExternalSharingControlsRecipientListsChangedType + + @objc + public init(_ arg: DBXTeamLogTeamExternalSharingControlsRecipientListsChangedType) { + teamExternalSharingControlsRecipientListsChanged = arg + let swift = TeamLog.EventType.teamExternalSharingControlsRecipientListsChanged(arg.swift) + super.init(swift: swift) + } +} + /// (team_policies) Changed team member storage request policy for team @objc public class DBXTeamLogEventTypeTeamMemberStorageRequestPolicyChanged: DBXTeamLogEventType { @@ -39945,12 +40297,24 @@ public class DBXTeamLogEventTypeArg: NSObject { return DBXTeamLogEventTypeArgProtectActionExport() case .protectActionRemoveCollaborator: return DBXTeamLogEventTypeArgProtectActionRemoveCollaborator() + case .protectActionRemoveDomains: + return DBXTeamLogEventTypeArgProtectActionRemoveDomains() case .protectActionRemoveLink: return DBXTeamLogEventTypeArgProtectActionRemoveLink() case .protectActionStopSharing: return DBXTeamLogEventTypeArgProtectActionStopSharing() case .protectInternalDomainsChanged: return DBXTeamLogEventTypeArgProtectInternalDomainsChanged() + case .protectPolicyActivated: + return DBXTeamLogEventTypeArgProtectPolicyActivated() + case .protectPolicyDeactivated: + return DBXTeamLogEventTypeArgProtectPolicyDeactivated() + case .protectPolicyScheduled: + return DBXTeamLogEventTypeArgProtectPolicyScheduled() + case .protectPolicyUpdated: + return DBXTeamLogEventTypeArgProtectPolicyUpdated() + case .protectReportView: + return DBXTeamLogEventTypeArgProtectReportView() case .classificationCreateReport: return DBXTeamLogEventTypeArgClassificationCreateReport() case .classificationCreateReportFail: @@ -40515,6 +40879,10 @@ public class DBXTeamLogEventTypeArg: NSObject { return DBXTeamLogEventTypeArgTeamBrandingPolicyChanged() case .teamExtensionsPolicyChanged: return DBXTeamLogEventTypeArgTeamExtensionsPolicyChanged() + case .teamExternalSharingControlsActivationStateChanged: + return DBXTeamLogEventTypeArgTeamExternalSharingControlsActivationStateChanged() + case .teamExternalSharingControlsRecipientListsChanged: + return DBXTeamLogEventTypeArgTeamExternalSharingControlsRecipientListsChanged() case .teamMemberStorageRequestPolicyChanged: return DBXTeamLogEventTypeArgTeamMemberStorageRequestPolicyChanged() case .teamSelectiveSyncPolicyChanged: @@ -42051,6 +42419,11 @@ public class DBXTeamLogEventTypeArg: NSObject { return self as? DBXTeamLogEventTypeArgProtectActionRemoveCollaborator } + @objc + public var asProtectActionRemoveDomains: DBXTeamLogEventTypeArgProtectActionRemoveDomains? { + return self as? DBXTeamLogEventTypeArgProtectActionRemoveDomains + } + @objc public var asProtectActionRemoveLink: DBXTeamLogEventTypeArgProtectActionRemoveLink? { return self as? DBXTeamLogEventTypeArgProtectActionRemoveLink @@ -42066,6 +42439,31 @@ public class DBXTeamLogEventTypeArg: NSObject { return self as? DBXTeamLogEventTypeArgProtectInternalDomainsChanged } + @objc + public var asProtectPolicyActivated: DBXTeamLogEventTypeArgProtectPolicyActivated? { + return self as? DBXTeamLogEventTypeArgProtectPolicyActivated + } + + @objc + public var asProtectPolicyDeactivated: DBXTeamLogEventTypeArgProtectPolicyDeactivated? { + return self as? DBXTeamLogEventTypeArgProtectPolicyDeactivated + } + + @objc + public var asProtectPolicyScheduled: DBXTeamLogEventTypeArgProtectPolicyScheduled? { + return self as? DBXTeamLogEventTypeArgProtectPolicyScheduled + } + + @objc + public var asProtectPolicyUpdated: DBXTeamLogEventTypeArgProtectPolicyUpdated? { + return self as? DBXTeamLogEventTypeArgProtectPolicyUpdated + } + + @objc + public var asProtectReportView: DBXTeamLogEventTypeArgProtectReportView? { + return self as? DBXTeamLogEventTypeArgProtectReportView + } + @objc public var asClassificationCreateReport: DBXTeamLogEventTypeArgClassificationCreateReport? { return self as? DBXTeamLogEventTypeArgClassificationCreateReport @@ -43476,6 +43874,16 @@ public class DBXTeamLogEventTypeArg: NSObject { return self as? DBXTeamLogEventTypeArgTeamExtensionsPolicyChanged } + @objc + public var asTeamExternalSharingControlsActivationStateChanged: DBXTeamLogEventTypeArgTeamExternalSharingControlsActivationStateChanged? { + return self as? DBXTeamLogEventTypeArgTeamExternalSharingControlsActivationStateChanged + } + + @objc + public var asTeamExternalSharingControlsRecipientListsChanged: DBXTeamLogEventTypeArgTeamExternalSharingControlsRecipientListsChanged? { + return self as? DBXTeamLogEventTypeArgTeamExternalSharingControlsRecipientListsChanged + } + @objc public var asTeamMemberStorageRequestPolicyChanged: DBXTeamLogEventTypeArgTeamMemberStorageRequestPolicyChanged? { return self as? DBXTeamLogEventTypeArgTeamMemberStorageRequestPolicyChanged @@ -46597,6 +47005,16 @@ public class DBXTeamLogEventTypeArgProtectActionRemoveCollaborator: DBXTeamLogEv } } +/// (protect) Removed domains via Dropbox Protect +@objc +public class DBXTeamLogEventTypeArgProtectActionRemoveDomains: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.protectActionRemoveDomains + super.init(swift: swift) + } +} + /// (protect) Removed a link via Dropbox Protect @objc public class DBXTeamLogEventTypeArgProtectActionRemoveLink: DBXTeamLogEventTypeArg { @@ -46627,6 +47045,56 @@ public class DBXTeamLogEventTypeArgProtectInternalDomainsChanged: DBXTeamLogEven } } +/// (protect) Activated a Dropbox Protect policy +@objc +public class DBXTeamLogEventTypeArgProtectPolicyActivated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.protectPolicyActivated + super.init(swift: swift) + } +} + +/// (protect) Deactivated a Dropbox Protect policy +@objc +public class DBXTeamLogEventTypeArgProtectPolicyDeactivated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.protectPolicyDeactivated + super.init(swift: swift) + } +} + +/// (protect) Scheduled a Dropbox Protect policy +@objc +public class DBXTeamLogEventTypeArgProtectPolicyScheduled: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.protectPolicyScheduled + super.init(swift: swift) + } +} + +/// (protect) Updated a Dropbox Protect policy +@objc +public class DBXTeamLogEventTypeArgProtectPolicyUpdated: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.protectPolicyUpdated + super.init(swift: swift) + } +} + +/// (protect) Viewed a Dropbox Protect report +@objc +public class DBXTeamLogEventTypeArgProtectReportView: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.protectReportView + super.init(swift: swift) + } +} + /// (reports) Created Classification report @objc public class DBXTeamLogEventTypeArgClassificationCreateReport: DBXTeamLogEventTypeArg { @@ -49453,6 +49921,26 @@ public class DBXTeamLogEventTypeArgTeamExtensionsPolicyChanged: DBXTeamLogEventT } } +/// (team_policies) Changed external sharing controls activation state +@objc +public class DBXTeamLogEventTypeArgTeamExternalSharingControlsActivationStateChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamExternalSharingControlsActivationStateChanged + super.init(swift: swift) + } +} + +/// (team_policies) Changed approved or blocked entries for external sharing controls +@objc +public class DBXTeamLogEventTypeArgTeamExternalSharingControlsRecipientListsChanged: DBXTeamLogEventTypeArg { + @objc + public init() { + let swift = TeamLog.EventTypeArg.teamExternalSharingControlsRecipientListsChanged + super.init(swift: swift) + } +} + /// (team_policies) Changed team member storage request policy for team @objc public class DBXTeamLogEventTypeArgTeamMemberStorageRequestPolicyChanged: DBXTeamLogEventTypeArg { @@ -50754,6 +51242,92 @@ public class DBXTeamLogExternalDriveBackupStatusChangedType: NSObject { public override var description: String { swift.description } } +/// Objective-C compatible ExternalSharingControlsActivationState union +@objc +public class DBXTeamLogExternalSharingControlsActivationState: NSObject { + let swift: TeamLog.ExternalSharingControlsActivationState + + public init(swift: TeamLog.ExternalSharingControlsActivationState) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ExternalSharingControlsActivationState) -> DBXTeamLogExternalSharingControlsActivationState { + switch swift { + case .active: + return DBXTeamLogExternalSharingControlsActivationStateActive() + case .disabled: + return DBXTeamLogExternalSharingControlsActivationStateDisabled() + case .legacy: + return DBXTeamLogExternalSharingControlsActivationStateLegacy() + case .other: + return DBXTeamLogExternalSharingControlsActivationStateOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asActive: DBXTeamLogExternalSharingControlsActivationStateActive? { + return self as? DBXTeamLogExternalSharingControlsActivationStateActive + } + + @objc + public var asDisabled: DBXTeamLogExternalSharingControlsActivationStateDisabled? { + return self as? DBXTeamLogExternalSharingControlsActivationStateDisabled + } + + @objc + public var asLegacy: DBXTeamLogExternalSharingControlsActivationStateLegacy? { + return self as? DBXTeamLogExternalSharingControlsActivationStateLegacy + } + + @objc + public var asOther: DBXTeamLogExternalSharingControlsActivationStateOther? { + return self as? DBXTeamLogExternalSharingControlsActivationStateOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalSharingControlsActivationStateActive: DBXTeamLogExternalSharingControlsActivationState { + @objc + public init() { + let swift = TeamLog.ExternalSharingControlsActivationState.active + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalSharingControlsActivationStateDisabled: DBXTeamLogExternalSharingControlsActivationState { + @objc + public init() { + let swift = TeamLog.ExternalSharingControlsActivationState.disabled + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalSharingControlsActivationStateLegacy: DBXTeamLogExternalSharingControlsActivationState { + @objc + public init() { + let swift = TeamLog.ExternalSharingControlsActivationState.legacy + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogExternalSharingControlsActivationStateOther: DBXTeamLogExternalSharingControlsActivationState { + @objc + public init() { + let swift = TeamLog.ExternalSharingControlsActivationState.other + super.init(swift: swift) + } +} + /// Created External sharing report. @objc public class DBXTeamLogExternalSharingCreateReportDetails: NSObject { @@ -58564,10 +59138,13 @@ public class DBXTeamLogMediaHubProjectTeamAddDetails: NSObject { /// Replay project. @objc public var project: DBXTeamLogMediaHubProjectLogInfo? { guard let swift = swift.project else { return nil }; return DBXTeamLogMediaHubProjectLogInfo(swift: swift) } + /// The email address of the Replay project member targeted by the event. + @objc + public var invitee: String? { swift.invitee } @objc - public init(project: DBXTeamLogMediaHubProjectLogInfo?) { - self.swift = TeamLog.MediaHubProjectTeamAddDetails(project: project?.swift) + public init(project: DBXTeamLogMediaHubProjectLogInfo?, invitee: String?) { + self.swift = TeamLog.MediaHubProjectTeamAddDetails(project: project?.swift, invitee: invitee) } let swift: TeamLog.MediaHubProjectTeamAddDetails @@ -58610,10 +59187,13 @@ public class DBXTeamLogMediaHubProjectTeamDeleteDetails: NSObject { /// Replay project. @objc public var project: DBXTeamLogMediaHubProjectLogInfo? { guard let swift = swift.project else { return nil }; return DBXTeamLogMediaHubProjectLogInfo(swift: swift) } + /// The email address of the Replay project member targeted by the event. + @objc + public var invitee: String? { swift.invitee } @objc - public init(project: DBXTeamLogMediaHubProjectLogInfo?) { - self.swift = TeamLog.MediaHubProjectTeamDeleteDetails(project: project?.swift) + public init(project: DBXTeamLogMediaHubProjectLogInfo?, invitee: String?) { + self.swift = TeamLog.MediaHubProjectTeamDeleteDetails(project: project?.swift, invitee: invitee) } let swift: TeamLog.MediaHubProjectTeamDeleteDetails @@ -58662,10 +59242,13 @@ public class DBXTeamLogMediaHubProjectTeamRoleChangedDetails: NSObject { /// Replay project. @objc public var project: DBXTeamLogMediaHubProjectLogInfo? { guard let swift = swift.project else { return nil }; return DBXTeamLogMediaHubProjectLogInfo(swift: swift) } + /// The email address of the Replay project member targeted by the event. + @objc + public var invitee: String? { swift.invitee } @objc - public init(previousRole: DBXTeamLogMediaHubProjectRole, newRole: DBXTeamLogMediaHubProjectRole, project: DBXTeamLogMediaHubProjectLogInfo?) { - self.swift = TeamLog.MediaHubProjectTeamRoleChangedDetails(previousRole: previousRole.swift, newRole: newRole.swift, project: project?.swift) + public init(previousRole: DBXTeamLogMediaHubProjectRole, newRole: DBXTeamLogMediaHubProjectRole, project: DBXTeamLogMediaHubProjectLogInfo?, invitee: String?) { + self.swift = TeamLog.MediaHubProjectTeamRoleChangedDetails(previousRole: previousRole.swift, newRole: newRole.swift, project: project?.swift, invitee: invitee) } let swift: TeamLog.MediaHubProjectTeamRoleChangedDetails @@ -58717,6 +59300,8 @@ public class DBXTeamLogMediaHubSharedLinkAudience: NSObject { return DBXTeamLogMediaHubSharedLinkAudienceNoOne() case .public_: return DBXTeamLogMediaHubSharedLinkAudiencePublic_() + case .publicLoggedInOnly: + return DBXTeamLogMediaHubSharedLinkAudiencePublicLoggedInOnly() case .teamOnly: return DBXTeamLogMediaHubSharedLinkAudienceTeamOnly() case .other: @@ -58737,6 +59322,11 @@ public class DBXTeamLogMediaHubSharedLinkAudience: NSObject { return self as? DBXTeamLogMediaHubSharedLinkAudiencePublic_ } + @objc + public var asPublicLoggedInOnly: DBXTeamLogMediaHubSharedLinkAudiencePublicLoggedInOnly? { + return self as? DBXTeamLogMediaHubSharedLinkAudiencePublicLoggedInOnly + } + @objc public var asTeamOnly: DBXTeamLogMediaHubSharedLinkAudienceTeamOnly? { return self as? DBXTeamLogMediaHubSharedLinkAudienceTeamOnly @@ -58768,6 +59358,16 @@ public class DBXTeamLogMediaHubSharedLinkAudiencePublic_: DBXTeamLogMediaHubShar } } +/// An unspecified error. +@objc +public class DBXTeamLogMediaHubSharedLinkAudiencePublicLoggedInOnly: DBXTeamLogMediaHubSharedLinkAudience { + @objc + public init() { + let swift = TeamLog.MediaHubSharedLinkAudience.publicLoggedInOnly + super.init(swift: swift) + } +} + /// An unspecified error. @objc public class DBXTeamLogMediaHubSharedLinkAudienceTeamOnly: DBXTeamLogMediaHubSharedLinkAudience { @@ -66843,6 +67443,52 @@ public class DBXTeamLogProtectActionRemoveCollaboratorType: NSObject { public override var description: String { swift.description } } +/// Removed domains via Dropbox Protect. +@objc +public class DBXTeamLogProtectActionRemoveDomainsDetails: NSObject { + /// Action ID. + @objc + public var actionId: String { swift.actionId } + + @objc + public init(actionId: String) { + self.swift = TeamLog.ProtectActionRemoveDomainsDetails(actionId: actionId) + } + + let swift: TeamLog.ProtectActionRemoveDomainsDetails + + public init(swift: TeamLog.ProtectActionRemoveDomainsDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ProtectActionRemoveDomainsType struct +@objc +public class DBXTeamLogProtectActionRemoveDomainsType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ProtectActionRemoveDomainsType(description_: description_) + } + + let swift: TeamLog.ProtectActionRemoveDomainsType + + public init(swift: TeamLog.ProtectActionRemoveDomainsType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + /// Removed a link via Dropbox Protect. @objc public class DBXTeamLogProtectActionRemoveLinkDetails: NSObject { @@ -66984,150 +67630,67 @@ public class DBXTeamLogProtectInternalDomainsChangedType: NSObject { public override var description: String { swift.description } } -/// Quick action type. +/// Activated a Dropbox Protect policy. @objc -public class DBXTeamLogQuickActionType: NSObject { - let swift: TeamLog.QuickActionType - - public init(swift: TeamLog.QuickActionType) { - self.swift = swift - } - - public static func factory(swift: TeamLog.QuickActionType) -> DBXTeamLogQuickActionType { - switch swift { - case .deleteSharedLink: - return DBXTeamLogQuickActionTypeDeleteSharedLink() - case .resetPassword: - return DBXTeamLogQuickActionTypeResetPassword() - case .restoreFileOrFolder: - return DBXTeamLogQuickActionTypeRestoreFileOrFolder() - case .unlinkApp: - return DBXTeamLogQuickActionTypeUnlinkApp() - case .unlinkDevice: - return DBXTeamLogQuickActionTypeUnlinkDevice() - case .unlinkSession: - return DBXTeamLogQuickActionTypeUnlinkSession() - case .other: - return DBXTeamLogQuickActionTypeOther() - } - } - - @objc - public override var description: String { swift.description } - - @objc - public var asDeleteSharedLink: DBXTeamLogQuickActionTypeDeleteSharedLink? { - return self as? DBXTeamLogQuickActionTypeDeleteSharedLink - } - +public class DBXTeamLogProtectPolicyActivatedDetails: NSObject { + /// Policy ID. @objc - public var asResetPassword: DBXTeamLogQuickActionTypeResetPassword? { - return self as? DBXTeamLogQuickActionTypeResetPassword - } + public var policyId: String { swift.policyId } @objc - public var asRestoreFileOrFolder: DBXTeamLogQuickActionTypeRestoreFileOrFolder? { - return self as? DBXTeamLogQuickActionTypeRestoreFileOrFolder + public init(policyId: String) { + self.swift = TeamLog.ProtectPolicyActivatedDetails(policyId: policyId) } - @objc - public var asUnlinkApp: DBXTeamLogQuickActionTypeUnlinkApp? { - return self as? DBXTeamLogQuickActionTypeUnlinkApp - } + let swift: TeamLog.ProtectPolicyActivatedDetails - @objc - public var asUnlinkDevice: DBXTeamLogQuickActionTypeUnlinkDevice? { - return self as? DBXTeamLogQuickActionTypeUnlinkDevice + public init(swift: TeamLog.ProtectPolicyActivatedDetails) { + self.swift = swift } - @objc - public var asUnlinkSession: DBXTeamLogQuickActionTypeUnlinkSession? { - return self as? DBXTeamLogQuickActionTypeUnlinkSession - } @objc - public var asOther: DBXTeamLogQuickActionTypeOther? { - return self as? DBXTeamLogQuickActionTypeOther - } + public override var description: String { swift.description } } -/// An unspecified error. +/// Objective-C compatible ProtectPolicyActivatedType struct @objc -public class DBXTeamLogQuickActionTypeDeleteSharedLink: DBXTeamLogQuickActionType { +public class DBXTeamLogProtectPolicyActivatedType: NSObject { + /// (no description) @objc - public init() { - let swift = TeamLog.QuickActionType.deleteSharedLink - super.init(swift: swift) - } -} + public var description_: String { swift.description_ } -/// An unspecified error. -@objc -public class DBXTeamLogQuickActionTypeResetPassword: DBXTeamLogQuickActionType { @objc - public init() { - let swift = TeamLog.QuickActionType.resetPassword - super.init(swift: swift) + public init(description_: String) { + self.swift = TeamLog.ProtectPolicyActivatedType(description_: description_) } -} -/// An unspecified error. -@objc -public class DBXTeamLogQuickActionTypeRestoreFileOrFolder: DBXTeamLogQuickActionType { - @objc - public init() { - let swift = TeamLog.QuickActionType.restoreFileOrFolder - super.init(swift: swift) - } -} + let swift: TeamLog.ProtectPolicyActivatedType -/// An unspecified error. -@objc -public class DBXTeamLogQuickActionTypeUnlinkApp: DBXTeamLogQuickActionType { - @objc - public init() { - let swift = TeamLog.QuickActionType.unlinkApp - super.init(swift: swift) + public init(swift: TeamLog.ProtectPolicyActivatedType) { + self.swift = swift } -} -/// An unspecified error. -@objc -public class DBXTeamLogQuickActionTypeUnlinkDevice: DBXTeamLogQuickActionType { + @objc - public init() { - let swift = TeamLog.QuickActionType.unlinkDevice - super.init(swift: swift) - } + public override var description: String { swift.description } } -/// An unspecified error. +/// Deactivated a Dropbox Protect policy. @objc -public class DBXTeamLogQuickActionTypeUnlinkSession: DBXTeamLogQuickActionType { +public class DBXTeamLogProtectPolicyDeactivatedDetails: NSObject { + /// Policy ID. @objc - public init() { - let swift = TeamLog.QuickActionType.unlinkSession - super.init(swift: swift) - } -} + public var policyId: String { swift.policyId } -/// An unspecified error. -@objc -public class DBXTeamLogQuickActionTypeOther: DBXTeamLogQuickActionType { @objc - public init() { - let swift = TeamLog.QuickActionType.other - super.init(swift: swift) + public init(policyId: String) { + self.swift = TeamLog.ProtectPolicyDeactivatedDetails(policyId: policyId) } -} - -/// Created ransomware report. -@objc -public class DBXTeamLogRansomwareAlertCreateReportDetails: NSObject { - let swift: TeamLog.RansomwareAlertCreateReportDetails + let swift: TeamLog.ProtectPolicyDeactivatedDetails - public init(swift: TeamLog.RansomwareAlertCreateReportDetails) { + public init(swift: TeamLog.ProtectPolicyDeactivatedDetails) { self.swift = swift } @@ -67136,21 +67699,21 @@ public class DBXTeamLogRansomwareAlertCreateReportDetails: NSObject { public override var description: String { swift.description } } -/// Couldn't generate ransomware report. +/// Objective-C compatible ProtectPolicyDeactivatedType struct @objc -public class DBXTeamLogRansomwareAlertCreateReportFailedDetails: NSObject { - /// Failure reason. +public class DBXTeamLogProtectPolicyDeactivatedType: NSObject { + /// (no description) @objc - public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + public var description_: String { swift.description_ } @objc - public init(failureReason: DBXTeamTeamReportFailureReason) { - self.swift = TeamLog.RansomwareAlertCreateReportFailedDetails(failureReason: failureReason.swift) + public init(description_: String) { + self.swift = TeamLog.ProtectPolicyDeactivatedType(description_: description_) } - let swift: TeamLog.RansomwareAlertCreateReportFailedDetails + let swift: TeamLog.ProtectPolicyDeactivatedType - public init(swift: TeamLog.RansomwareAlertCreateReportFailedDetails) { + public init(swift: TeamLog.ProtectPolicyDeactivatedType) { self.swift = swift } @@ -67159,21 +67722,21 @@ public class DBXTeamLogRansomwareAlertCreateReportFailedDetails: NSObject { public override var description: String { swift.description } } -/// Objective-C compatible RansomwareAlertCreateReportFailedType struct +/// Scheduled a Dropbox Protect policy. @objc -public class DBXTeamLogRansomwareAlertCreateReportFailedType: NSObject { - /// (no description) +public class DBXTeamLogProtectPolicyScheduledDetails: NSObject { + /// Policy ID. @objc - public var description_: String { swift.description_ } + public var policyId: String { swift.policyId } @objc - public init(description_: String) { - self.swift = TeamLog.RansomwareAlertCreateReportFailedType(description_: description_) + public init(policyId: String) { + self.swift = TeamLog.ProtectPolicyScheduledDetails(policyId: policyId) } - let swift: TeamLog.RansomwareAlertCreateReportFailedType + let swift: TeamLog.ProtectPolicyScheduledDetails - public init(swift: TeamLog.RansomwareAlertCreateReportFailedType) { + public init(swift: TeamLog.ProtectPolicyScheduledDetails) { self.swift = swift } @@ -67182,21 +67745,21 @@ public class DBXTeamLogRansomwareAlertCreateReportFailedType: NSObject { public override var description: String { swift.description } } -/// Objective-C compatible RansomwareAlertCreateReportType struct +/// Objective-C compatible ProtectPolicyScheduledType struct @objc -public class DBXTeamLogRansomwareAlertCreateReportType: NSObject { +public class DBXTeamLogProtectPolicyScheduledType: NSObject { /// (no description) @objc public var description_: String { swift.description_ } @objc public init(description_: String) { - self.swift = TeamLog.RansomwareAlertCreateReportType(description_: description_) + self.swift = TeamLog.ProtectPolicyScheduledType(description_: description_) } - let swift: TeamLog.RansomwareAlertCreateReportType + let swift: TeamLog.ProtectPolicyScheduledType - public init(swift: TeamLog.RansomwareAlertCreateReportType) { + public init(swift: TeamLog.ProtectPolicyScheduledType) { self.swift = swift } @@ -67205,27 +67768,21 @@ public class DBXTeamLogRansomwareAlertCreateReportType: NSObject { public override var description: String { swift.description } } -/// Completed ransomware restore process. +/// Updated a Dropbox Protect policy. @objc -public class DBXTeamLogRansomwareRestoreProcessCompletedDetails: NSObject { - /// The status of the restore process. - @objc - public var status: String { swift.status } - /// Restored files count. - @objc - public var restoredFilesCount: NSNumber { swift.restoredFilesCount as NSNumber } - /// Restored files failed count. +public class DBXTeamLogProtectPolicyUpdatedDetails: NSObject { + /// Policy ID. @objc - public var restoredFilesFailedCount: NSNumber { swift.restoredFilesFailedCount as NSNumber } + public var policyId: String { swift.policyId } @objc - public init(status: String, restoredFilesCount: NSNumber, restoredFilesFailedCount: NSNumber) { - self.swift = TeamLog.RansomwareRestoreProcessCompletedDetails(status: status, restoredFilesCount: restoredFilesCount.int64Value, restoredFilesFailedCount: restoredFilesFailedCount.int64Value) + public init(policyId: String) { + self.swift = TeamLog.ProtectPolicyUpdatedDetails(policyId: policyId) } - let swift: TeamLog.RansomwareRestoreProcessCompletedDetails + let swift: TeamLog.ProtectPolicyUpdatedDetails - public init(swift: TeamLog.RansomwareRestoreProcessCompletedDetails) { + public init(swift: TeamLog.ProtectPolicyUpdatedDetails) { self.swift = swift } @@ -67234,21 +67791,21 @@ public class DBXTeamLogRansomwareRestoreProcessCompletedDetails: NSObject { public override var description: String { swift.description } } -/// Objective-C compatible RansomwareRestoreProcessCompletedType struct +/// Objective-C compatible ProtectPolicyUpdatedType struct @objc -public class DBXTeamLogRansomwareRestoreProcessCompletedType: NSObject { +public class DBXTeamLogProtectPolicyUpdatedType: NSObject { /// (no description) @objc public var description_: String { swift.description_ } @objc public init(description_: String) { - self.swift = TeamLog.RansomwareRestoreProcessCompletedType(description_: description_) + self.swift = TeamLog.ProtectPolicyUpdatedType(description_: description_) } - let swift: TeamLog.RansomwareRestoreProcessCompletedType + let swift: TeamLog.ProtectPolicyUpdatedType - public init(swift: TeamLog.RansomwareRestoreProcessCompletedType) { + public init(swift: TeamLog.ProtectPolicyUpdatedType) { self.swift = swift } @@ -67257,273 +67814,1791 @@ public class DBXTeamLogRansomwareRestoreProcessCompletedType: NSObject { public override var description: String { swift.description } } -/// Started ransomware restore process. +/// The category that a Dropbox Protect report belongs to @objc -public class DBXTeamLogRansomwareRestoreProcessStartedDetails: NSObject { - /// Ransomware filename extension. +public class DBXTeamLogProtectReportCategory: NSObject { + let swift: TeamLog.ProtectReportCategory + + public init(swift: TeamLog.ProtectReportCategory) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ProtectReportCategory) -> DBXTeamLogProtectReportCategory { + switch swift { + case .overview: + return DBXTeamLogProtectReportCategoryOverview() + case .staleAccess: + return DBXTeamLogProtectReportCategoryStaleAccess() + case .other: + return DBXTeamLogProtectReportCategoryOther() + } + } + @objc - public var extension_: String { swift.extension_ } + public override var description: String { swift.description } @objc - public init(extension_: String) { - self.swift = TeamLog.RansomwareRestoreProcessStartedDetails(extension_: extension_) + public var asOverview: DBXTeamLogProtectReportCategoryOverview? { + return self as? DBXTeamLogProtectReportCategoryOverview } - let swift: TeamLog.RansomwareRestoreProcessStartedDetails - - public init(swift: TeamLog.RansomwareRestoreProcessStartedDetails) { - self.swift = swift + @objc + public var asStaleAccess: DBXTeamLogProtectReportCategoryStaleAccess? { + return self as? DBXTeamLogProtectReportCategoryStaleAccess } + @objc + public var asOther: DBXTeamLogProtectReportCategoryOther? { + return self as? DBXTeamLogProtectReportCategoryOther + } +} +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportCategoryOverview: DBXTeamLogProtectReportCategory { @objc - public override var description: String { swift.description } + public init() { + let swift = TeamLog.ProtectReportCategory.overview + super.init(swift: swift) + } } -/// Objective-C compatible RansomwareRestoreProcessStartedType struct +/// An unspecified error. @objc -public class DBXTeamLogRansomwareRestoreProcessStartedType: NSObject { - /// (no description) +public class DBXTeamLogProtectReportCategoryStaleAccess: DBXTeamLogProtectReportCategory { @objc - public var description_: String { swift.description_ } + public init() { + let swift = TeamLog.ProtectReportCategory.staleAccess + super.init(swift: swift) + } +} +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportCategoryOther: DBXTeamLogProtectReportCategory { @objc - public init(description_: String) { - self.swift = TeamLog.RansomwareRestoreProcessStartedType(description_: description_) + public init() { + let swift = TeamLog.ProtectReportCategory.other + super.init(swift: swift) } +} - let swift: TeamLog.RansomwareRestoreProcessStartedType +/// The metric that a Dropbox Protect report corresponds to +@objc +public class DBXTeamLogProtectReportMetric: NSObject { + let swift: TeamLog.ProtectReportMetric - public init(swift: TeamLog.RansomwareRestoreProcessStartedType) { + public init(swift: TeamLog.ProtectReportMetric) { self.swift = swift } + public static func factory(swift: TeamLog.ProtectReportMetric) -> DBXTeamLogProtectReportMetric { + switch swift { + case .externalModifiedOver1Year: + return DBXTeamLogProtectReportMetricExternalModifiedOver1Year() + case .externalModifiedOver1YearCompany: + return DBXTeamLogProtectReportMetricExternalModifiedOver1YearCompany() + case .externalModifiedOver1YearOutside: + return DBXTeamLogProtectReportMetricExternalModifiedOver1YearOutside() + case .externalModifiedOver1YearPersonal: + return DBXTeamLogProtectReportMetricExternalModifiedOver1YearPersonal() + case .externalModifiedOver1YearPublic: + return DBXTeamLogProtectReportMetricExternalModifiedOver1YearPublic() + case .externalModifiedOver2Years: + return DBXTeamLogProtectReportMetricExternalModifiedOver2Years() + case .externalModifiedOver2YearsCompany: + return DBXTeamLogProtectReportMetricExternalModifiedOver2YearsCompany() + case .externalModifiedOver2YearsOutside: + return DBXTeamLogProtectReportMetricExternalModifiedOver2YearsOutside() + case .externalModifiedOver2YearsPersonal: + return DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPersonal() + case .externalModifiedOver2YearsPublic: + return DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPublic() + case .externalModifiedOver3Years: + return DBXTeamLogProtectReportMetricExternalModifiedOver3Years() + case .externalModifiedOver3YearsCompany: + return DBXTeamLogProtectReportMetricExternalModifiedOver3YearsCompany() + case .externalModifiedOver3YearsOutside: + return DBXTeamLogProtectReportMetricExternalModifiedOver3YearsOutside() + case .externalModifiedOver3YearsPersonal: + return DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPersonal() + case .externalModifiedOver3YearsPublic: + return DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPublic() + case .externalModifiedOver5Years: + return DBXTeamLogProtectReportMetricExternalModifiedOver5Years() + case .externalModifiedOver5YearsCompany: + return DBXTeamLogProtectReportMetricExternalModifiedOver5YearsCompany() + case .externalModifiedOver5YearsOutside: + return DBXTeamLogProtectReportMetricExternalModifiedOver5YearsOutside() + case .externalModifiedOver5YearsPersonal: + return DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPersonal() + case .externalModifiedOver5YearsPublic: + return DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPublic() + case .foldersCompany: + return DBXTeamLogProtectReportMetricFoldersCompany() + case .foldersInternal: + return DBXTeamLogProtectReportMetricFoldersInternal() + case .foldersOutside: + return DBXTeamLogProtectReportMetricFoldersOutside() + case .foldersPersonal: + return DBXTeamLogProtectReportMetricFoldersPersonal() + case .foldersPublic: + return DBXTeamLogProtectReportMetricFoldersPublic() + case .internalModifiedOver1Year: + return DBXTeamLogProtectReportMetricInternalModifiedOver1Year() + case .internalModifiedOver1YearCompany: + return DBXTeamLogProtectReportMetricInternalModifiedOver1YearCompany() + case .internalModifiedOver1YearOutside: + return DBXTeamLogProtectReportMetricInternalModifiedOver1YearOutside() + case .internalModifiedOver1YearPersonal: + return DBXTeamLogProtectReportMetricInternalModifiedOver1YearPersonal() + case .internalModifiedOver1YearPublic: + return DBXTeamLogProtectReportMetricInternalModifiedOver1YearPublic() + case .internalModifiedOver2Years: + return DBXTeamLogProtectReportMetricInternalModifiedOver2Years() + case .internalModifiedOver2YearsCompany: + return DBXTeamLogProtectReportMetricInternalModifiedOver2YearsCompany() + case .internalModifiedOver2YearsOutside: + return DBXTeamLogProtectReportMetricInternalModifiedOver2YearsOutside() + case .internalModifiedOver2YearsPersonal: + return DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPersonal() + case .internalModifiedOver2YearsPublic: + return DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPublic() + case .internalModifiedOver3Years: + return DBXTeamLogProtectReportMetricInternalModifiedOver3Years() + case .internalModifiedOver3YearsCompany: + return DBXTeamLogProtectReportMetricInternalModifiedOver3YearsCompany() + case .internalModifiedOver3YearsOutside: + return DBXTeamLogProtectReportMetricInternalModifiedOver3YearsOutside() + case .internalModifiedOver3YearsPersonal: + return DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPersonal() + case .internalModifiedOver3YearsPublic: + return DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPublic() + case .internalModifiedOver5Years: + return DBXTeamLogProtectReportMetricInternalModifiedOver5Years() + case .internalModifiedOver5YearsCompany: + return DBXTeamLogProtectReportMetricInternalModifiedOver5YearsCompany() + case .internalModifiedOver5YearsOutside: + return DBXTeamLogProtectReportMetricInternalModifiedOver5YearsOutside() + case .internalModifiedOver5YearsPersonal: + return DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPersonal() + case .internalModifiedOver5YearsPublic: + return DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPublic() + case .itemsAll: + return DBXTeamLogProtectReportMetricItemsAll() + case .itemsCompanyAccess: + return DBXTeamLogProtectReportMetricItemsCompanyAccess() + case .itemsInternallyOwned: + return DBXTeamLogProtectReportMetricItemsInternallyOwned() + case .itemsModifiedOver1Year: + return DBXTeamLogProtectReportMetricItemsModifiedOver1Year() + case .itemsModifiedOver3Years: + return DBXTeamLogProtectReportMetricItemsModifiedOver3Years() + case .itemsOutsideAccess: + return DBXTeamLogProtectReportMetricItemsOutsideAccess() + case .itemsPersonalAccess: + return DBXTeamLogProtectReportMetricItemsPersonalAccess() + case .itemsPublicLinks: + return DBXTeamLogProtectReportMetricItemsPublicLinks() + case .otherFolders: + return DBXTeamLogProtectReportMetricOtherFolders() + case .otherSharedDrives: + return DBXTeamLogProtectReportMetricOtherSharedDrives() + case .sharedDrivesInternal: + return DBXTeamLogProtectReportMetricSharedDrivesInternal() + case .sharedDrivesOutside: + return DBXTeamLogProtectReportMetricSharedDrivesOutside() + case .sharedDrivesPersonal: + return DBXTeamLogProtectReportMetricSharedDrivesPersonal() + case .other: + return DBXTeamLogProtectReportMetricOther() + } + } @objc public override var description: String { swift.description } -} -/// Recipients Configuration -@objc -public class DBXTeamLogRecipientsConfiguration: NSObject { - /// Recipients setting type. - @objc - public var recipientSettingType: DBXTeamLogAlertRecipientsSettingType? { guard let swift = swift.recipientSettingType else { return nil }; return DBXTeamLogAlertRecipientsSettingType(swift: swift) } - /// A list of user emails to notify. - @objc - public var emails: Array? { swift.emails } - /// A list of groups to notify. @objc - public var groups: Array? { swift.groups } + public var asExternalModifiedOver1Year: DBXTeamLogProtectReportMetricExternalModifiedOver1Year? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1Year + } @objc - public init(recipientSettingType: DBXTeamLogAlertRecipientsSettingType?, emails: Array?, groups: Array?) { - self.swift = TeamLog.RecipientsConfiguration(recipientSettingType: recipientSettingType?.swift, emails: emails, groups: groups) + public var asExternalModifiedOver1YearCompany: DBXTeamLogProtectReportMetricExternalModifiedOver1YearCompany? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1YearCompany } - let swift: TeamLog.RecipientsConfiguration - - public init(swift: TeamLog.RecipientsConfiguration) { - self.swift = swift + @objc + public var asExternalModifiedOver1YearOutside: DBXTeamLogProtectReportMetricExternalModifiedOver1YearOutside? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1YearOutside } + @objc + public var asExternalModifiedOver1YearPersonal: DBXTeamLogProtectReportMetricExternalModifiedOver1YearPersonal? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1YearPersonal + } @objc - public override var description: String { swift.description } -} + public var asExternalModifiedOver1YearPublic: DBXTeamLogProtectReportMetricExternalModifiedOver1YearPublic? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1YearPublic + } -/// Provides the indices of the source asset and the destination asset for a relocate action. -@objc -public class DBXTeamLogRelocateAssetReferencesLogInfo: NSObject { - /// Source asset position in the Assets list. @objc - public var srcAssetIndex: NSNumber { swift.srcAssetIndex as NSNumber } - /// Destination asset position in the Assets list. + public var asExternalModifiedOver2Years: DBXTeamLogProtectReportMetricExternalModifiedOver2Years? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2Years + } + @objc - public var destAssetIndex: NSNumber { swift.destAssetIndex as NSNumber } + public var asExternalModifiedOver2YearsCompany: DBXTeamLogProtectReportMetricExternalModifiedOver2YearsCompany? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2YearsCompany + } @objc - public init(srcAssetIndex: NSNumber, destAssetIndex: NSNumber) { - self.swift = TeamLog.RelocateAssetReferencesLogInfo(srcAssetIndex: srcAssetIndex.uint64Value, destAssetIndex: destAssetIndex.uint64Value) + public var asExternalModifiedOver2YearsOutside: DBXTeamLogProtectReportMetricExternalModifiedOver2YearsOutside? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2YearsOutside } - let swift: TeamLog.RelocateAssetReferencesLogInfo + @objc + public var asExternalModifiedOver2YearsPersonal: DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPersonal + } - public init(swift: TeamLog.RelocateAssetReferencesLogInfo) { - self.swift = swift + @objc + public var asExternalModifiedOver2YearsPublic: DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPublic? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPublic } + @objc + public var asExternalModifiedOver3Years: DBXTeamLogProtectReportMetricExternalModifiedOver3Years? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3Years + } @objc - public override var description: String { swift.description } -} + public var asExternalModifiedOver3YearsCompany: DBXTeamLogProtectReportMetricExternalModifiedOver3YearsCompany? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3YearsCompany + } -/// Policy for deciding who can be added to Replay content -@objc -public class DBXTeamLogReplayAddingPeoplePolicy: NSObject { - let swift: TeamLog.ReplayAddingPeoplePolicy + @objc + public var asExternalModifiedOver3YearsOutside: DBXTeamLogProtectReportMetricExternalModifiedOver3YearsOutside? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3YearsOutside + } - public init(swift: TeamLog.ReplayAddingPeoplePolicy) { - self.swift = swift + @objc + public var asExternalModifiedOver3YearsPersonal: DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPersonal } - public static func factory(swift: TeamLog.ReplayAddingPeoplePolicy) -> DBXTeamLogReplayAddingPeoplePolicy { - switch swift { - case .anyone: - return DBXTeamLogReplayAddingPeoplePolicyAnyone() - case .teamAndAllowlist: - return DBXTeamLogReplayAddingPeoplePolicyTeamAndAllowlist() - case .teamOnly: - return DBXTeamLogReplayAddingPeoplePolicyTeamOnly() - case .other: - return DBXTeamLogReplayAddingPeoplePolicyOther() - } + @objc + public var asExternalModifiedOver3YearsPublic: DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPublic? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPublic } @objc - public override var description: String { swift.description } + public var asExternalModifiedOver5Years: DBXTeamLogProtectReportMetricExternalModifiedOver5Years? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5Years + } @objc - public var asAnyone: DBXTeamLogReplayAddingPeoplePolicyAnyone? { - return self as? DBXTeamLogReplayAddingPeoplePolicyAnyone + public var asExternalModifiedOver5YearsCompany: DBXTeamLogProtectReportMetricExternalModifiedOver5YearsCompany? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5YearsCompany } @objc - public var asTeamAndAllowlist: DBXTeamLogReplayAddingPeoplePolicyTeamAndAllowlist? { - return self as? DBXTeamLogReplayAddingPeoplePolicyTeamAndAllowlist + public var asExternalModifiedOver5YearsOutside: DBXTeamLogProtectReportMetricExternalModifiedOver5YearsOutside? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5YearsOutside } @objc - public var asTeamOnly: DBXTeamLogReplayAddingPeoplePolicyTeamOnly? { - return self as? DBXTeamLogReplayAddingPeoplePolicyTeamOnly + public var asExternalModifiedOver5YearsPersonal: DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPersonal } @objc - public var asOther: DBXTeamLogReplayAddingPeoplePolicyOther? { - return self as? DBXTeamLogReplayAddingPeoplePolicyOther + public var asExternalModifiedOver5YearsPublic: DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPublic? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPublic } -} -/// An unspecified error. -@objc -public class DBXTeamLogReplayAddingPeoplePolicyAnyone: DBXTeamLogReplayAddingPeoplePolicy { @objc - public init() { - let swift = TeamLog.ReplayAddingPeoplePolicy.anyone - super.init(swift: swift) + public var asFoldersCompany: DBXTeamLogProtectReportMetricFoldersCompany? { + return self as? DBXTeamLogProtectReportMetricFoldersCompany } -} -/// An unspecified error. -@objc -public class DBXTeamLogReplayAddingPeoplePolicyTeamAndAllowlist: DBXTeamLogReplayAddingPeoplePolicy { @objc - public init() { - let swift = TeamLog.ReplayAddingPeoplePolicy.teamAndAllowlist - super.init(swift: swift) + public var asFoldersInternal: DBXTeamLogProtectReportMetricFoldersInternal? { + return self as? DBXTeamLogProtectReportMetricFoldersInternal } -} -/// An unspecified error. -@objc -public class DBXTeamLogReplayAddingPeoplePolicyTeamOnly: DBXTeamLogReplayAddingPeoplePolicy { @objc - public init() { - let swift = TeamLog.ReplayAddingPeoplePolicy.teamOnly - super.init(swift: swift) + public var asFoldersOutside: DBXTeamLogProtectReportMetricFoldersOutside? { + return self as? DBXTeamLogProtectReportMetricFoldersOutside } -} -/// An unspecified error. -@objc -public class DBXTeamLogReplayAddingPeoplePolicyOther: DBXTeamLogReplayAddingPeoplePolicy { @objc - public init() { - let swift = TeamLog.ReplayAddingPeoplePolicy.other - super.init(swift: swift) + public var asFoldersPersonal: DBXTeamLogProtectReportMetricFoldersPersonal? { + return self as? DBXTeamLogProtectReportMetricFoldersPersonal } -} -/// Changed the policy for adding people to Replay content. -@objc -public class DBXTeamLogReplayAddingPeoplePolicyChangedDetails: NSObject { - /// To. @objc - public var newValue: DBXTeamLogReplayAddingPeoplePolicy { DBXTeamLogReplayAddingPeoplePolicy(swift: swift.newValue) } - /// From. + public var asFoldersPublic: DBXTeamLogProtectReportMetricFoldersPublic? { + return self as? DBXTeamLogProtectReportMetricFoldersPublic + } + @objc - public var previousValue: DBXTeamLogReplayAddingPeoplePolicy { DBXTeamLogReplayAddingPeoplePolicy(swift: swift.previousValue) } + public var asInternalModifiedOver1Year: DBXTeamLogProtectReportMetricInternalModifiedOver1Year? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1Year + } @objc - public init(newValue: DBXTeamLogReplayAddingPeoplePolicy, previousValue: DBXTeamLogReplayAddingPeoplePolicy) { - self.swift = TeamLog.ReplayAddingPeoplePolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + public var asInternalModifiedOver1YearCompany: DBXTeamLogProtectReportMetricInternalModifiedOver1YearCompany? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1YearCompany } - let swift: TeamLog.ReplayAddingPeoplePolicyChangedDetails + @objc + public var asInternalModifiedOver1YearOutside: DBXTeamLogProtectReportMetricInternalModifiedOver1YearOutside? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1YearOutside + } - public init(swift: TeamLog.ReplayAddingPeoplePolicyChangedDetails) { - self.swift = swift + @objc + public var asInternalModifiedOver1YearPersonal: DBXTeamLogProtectReportMetricInternalModifiedOver1YearPersonal? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1YearPersonal } + @objc + public var asInternalModifiedOver1YearPublic: DBXTeamLogProtectReportMetricInternalModifiedOver1YearPublic? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1YearPublic + } @objc - public override var description: String { swift.description } -} + public var asInternalModifiedOver2Years: DBXTeamLogProtectReportMetricInternalModifiedOver2Years? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2Years + } -/// Objective-C compatible ReplayAddingPeoplePolicyChangedType struct -@objc -public class DBXTeamLogReplayAddingPeoplePolicyChangedType: NSObject { - /// (no description) @objc - public var description_: String { swift.description_ } + public var asInternalModifiedOver2YearsCompany: DBXTeamLogProtectReportMetricInternalModifiedOver2YearsCompany? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2YearsCompany + } @objc - public init(description_: String) { - self.swift = TeamLog.ReplayAddingPeoplePolicyChangedType(description_: description_) + public var asInternalModifiedOver2YearsOutside: DBXTeamLogProtectReportMetricInternalModifiedOver2YearsOutside? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2YearsOutside } - let swift: TeamLog.ReplayAddingPeoplePolicyChangedType + @objc + public var asInternalModifiedOver2YearsPersonal: DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPersonal + } - public init(swift: TeamLog.ReplayAddingPeoplePolicyChangedType) { - self.swift = swift + @objc + public var asInternalModifiedOver2YearsPublic: DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPublic? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPublic } + @objc + public var asInternalModifiedOver3Years: DBXTeamLogProtectReportMetricInternalModifiedOver3Years? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3Years + } @objc - public override var description: String { swift.description } -} + public var asInternalModifiedOver3YearsCompany: DBXTeamLogProtectReportMetricInternalModifiedOver3YearsCompany? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3YearsCompany + } -/// Deleted files in Replay. -@objc -public class DBXTeamLogReplayFileDeleteDetails: NSObject { + @objc + public var asInternalModifiedOver3YearsOutside: DBXTeamLogProtectReportMetricInternalModifiedOver3YearsOutside? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3YearsOutside + } - let swift: TeamLog.ReplayFileDeleteDetails + @objc + public var asInternalModifiedOver3YearsPersonal: DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPersonal + } - public init(swift: TeamLog.ReplayFileDeleteDetails) { - self.swift = swift + @objc + public var asInternalModifiedOver3YearsPublic: DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPublic? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPublic } + @objc + public var asInternalModifiedOver5Years: DBXTeamLogProtectReportMetricInternalModifiedOver5Years? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5Years + } @objc - public override var description: String { swift.description } -} + public var asInternalModifiedOver5YearsCompany: DBXTeamLogProtectReportMetricInternalModifiedOver5YearsCompany? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5YearsCompany + } -/// Objective-C compatible ReplayFileDeleteType struct -@objc -public class DBXTeamLogReplayFileDeleteType: NSObject { - /// (no description) @objc - public var description_: String { swift.description_ } + public var asInternalModifiedOver5YearsOutside: DBXTeamLogProtectReportMetricInternalModifiedOver5YearsOutside? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5YearsOutside + } @objc - public init(description_: String) { - self.swift = TeamLog.ReplayFileDeleteType(description_: description_) + public var asInternalModifiedOver5YearsPersonal: DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPersonal } - let swift: TeamLog.ReplayFileDeleteType + @objc + public var asInternalModifiedOver5YearsPublic: DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPublic? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPublic + } - public init(swift: TeamLog.ReplayFileDeleteType) { - self.swift = swift + @objc + public var asItemsAll: DBXTeamLogProtectReportMetricItemsAll? { + return self as? DBXTeamLogProtectReportMetricItemsAll + } + + @objc + public var asItemsCompanyAccess: DBXTeamLogProtectReportMetricItemsCompanyAccess? { + return self as? DBXTeamLogProtectReportMetricItemsCompanyAccess + } + + @objc + public var asItemsInternallyOwned: DBXTeamLogProtectReportMetricItemsInternallyOwned? { + return self as? DBXTeamLogProtectReportMetricItemsInternallyOwned + } + + @objc + public var asItemsModifiedOver1Year: DBXTeamLogProtectReportMetricItemsModifiedOver1Year? { + return self as? DBXTeamLogProtectReportMetricItemsModifiedOver1Year + } + + @objc + public var asItemsModifiedOver3Years: DBXTeamLogProtectReportMetricItemsModifiedOver3Years? { + return self as? DBXTeamLogProtectReportMetricItemsModifiedOver3Years + } + + @objc + public var asItemsOutsideAccess: DBXTeamLogProtectReportMetricItemsOutsideAccess? { + return self as? DBXTeamLogProtectReportMetricItemsOutsideAccess + } + + @objc + public var asItemsPersonalAccess: DBXTeamLogProtectReportMetricItemsPersonalAccess? { + return self as? DBXTeamLogProtectReportMetricItemsPersonalAccess + } + + @objc + public var asItemsPublicLinks: DBXTeamLogProtectReportMetricItemsPublicLinks? { + return self as? DBXTeamLogProtectReportMetricItemsPublicLinks + } + + @objc + public var asOtherFolders: DBXTeamLogProtectReportMetricOtherFolders? { + return self as? DBXTeamLogProtectReportMetricOtherFolders + } + + @objc + public var asOtherSharedDrives: DBXTeamLogProtectReportMetricOtherSharedDrives? { + return self as? DBXTeamLogProtectReportMetricOtherSharedDrives + } + + @objc + public var asSharedDrivesInternal: DBXTeamLogProtectReportMetricSharedDrivesInternal? { + return self as? DBXTeamLogProtectReportMetricSharedDrivesInternal + } + + @objc + public var asSharedDrivesOutside: DBXTeamLogProtectReportMetricSharedDrivesOutside? { + return self as? DBXTeamLogProtectReportMetricSharedDrivesOutside + } + + @objc + public var asSharedDrivesPersonal: DBXTeamLogProtectReportMetricSharedDrivesPersonal? { + return self as? DBXTeamLogProtectReportMetricSharedDrivesPersonal + } + + @objc + public var asOther: DBXTeamLogProtectReportMetricOther? { + return self as? DBXTeamLogProtectReportMetricOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver1Year: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver1Year + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver1YearCompany: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver1YearCompany + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver1YearOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver1YearOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver1YearPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver1YearPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver1YearPublic: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver1YearPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver2Years: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver2Years + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver2YearsCompany: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver2YearsCompany + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver2YearsOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver2YearsOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver2YearsPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPublic: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver2YearsPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver3Years: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver3Years + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver3YearsCompany: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver3YearsCompany + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver3YearsOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver3YearsOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver3YearsPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPublic: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver3YearsPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver5Years: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver5Years + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver5YearsCompany: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver5YearsCompany + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver5YearsOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver5YearsOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver5YearsPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPublic: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.externalModifiedOver5YearsPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricFoldersCompany: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.foldersCompany + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricFoldersInternal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.foldersInternal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricFoldersOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.foldersOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricFoldersPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.foldersPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricFoldersPublic: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.foldersPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver1Year: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver1Year + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver1YearCompany: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver1YearCompany + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver1YearOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver1YearOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver1YearPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver1YearPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver1YearPublic: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver1YearPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver2Years: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver2Years + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver2YearsCompany: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver2YearsCompany + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver2YearsOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver2YearsOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver2YearsPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPublic: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver2YearsPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver3Years: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver3Years + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver3YearsCompany: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver3YearsCompany + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver3YearsOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver3YearsOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver3YearsPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPublic: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver3YearsPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver5Years: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver5Years + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver5YearsCompany: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver5YearsCompany + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver5YearsOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver5YearsOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver5YearsPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPublic: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.internalModifiedOver5YearsPublic + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricItemsAll: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.itemsAll + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricItemsCompanyAccess: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.itemsCompanyAccess + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricItemsInternallyOwned: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.itemsInternallyOwned + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricItemsModifiedOver1Year: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.itemsModifiedOver1Year + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricItemsModifiedOver3Years: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.itemsModifiedOver3Years + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricItemsOutsideAccess: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.itemsOutsideAccess + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricItemsPersonalAccess: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.itemsPersonalAccess + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricItemsPublicLinks: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.itemsPublicLinks + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricOtherFolders: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.otherFolders + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricOtherSharedDrives: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.otherSharedDrives + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricSharedDrivesInternal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.sharedDrivesInternal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricSharedDrivesOutside: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.sharedDrivesOutside + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricSharedDrivesPersonal: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.sharedDrivesPersonal + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportMetricOther: DBXTeamLogProtectReportMetric { + @objc + public init() { + let swift = TeamLog.ProtectReportMetric.other + super.init(swift: swift) + } +} + +/// The section that a Dropbox Protect report belongs to +@objc +public class DBXTeamLogProtectReportSection: NSObject { + let swift: TeamLog.ProtectReportSection + + public init(swift: TeamLog.ProtectReportSection) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ProtectReportSection) -> DBXTeamLogProtectReportSection { + switch swift { + case .items: + return DBXTeamLogProtectReportSectionItems() + case .overviewOther: + return DBXTeamLogProtectReportSectionOverviewOther() + case .ownedExternally: + return DBXTeamLogProtectReportSectionOwnedExternally() + case .ownedInternally: + return DBXTeamLogProtectReportSectionOwnedInternally() + case .other: + return DBXTeamLogProtectReportSectionOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asItems: DBXTeamLogProtectReportSectionItems? { + return self as? DBXTeamLogProtectReportSectionItems + } + + @objc + public var asOverviewOther: DBXTeamLogProtectReportSectionOverviewOther? { + return self as? DBXTeamLogProtectReportSectionOverviewOther + } + + @objc + public var asOwnedExternally: DBXTeamLogProtectReportSectionOwnedExternally? { + return self as? DBXTeamLogProtectReportSectionOwnedExternally + } + + @objc + public var asOwnedInternally: DBXTeamLogProtectReportSectionOwnedInternally? { + return self as? DBXTeamLogProtectReportSectionOwnedInternally + } + + @objc + public var asOther: DBXTeamLogProtectReportSectionOther? { + return self as? DBXTeamLogProtectReportSectionOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportSectionItems: DBXTeamLogProtectReportSection { + @objc + public init() { + let swift = TeamLog.ProtectReportSection.items + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportSectionOverviewOther: DBXTeamLogProtectReportSection { + @objc + public init() { + let swift = TeamLog.ProtectReportSection.overviewOther + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportSectionOwnedExternally: DBXTeamLogProtectReportSection { + @objc + public init() { + let swift = TeamLog.ProtectReportSection.ownedExternally + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportSectionOwnedInternally: DBXTeamLogProtectReportSection { + @objc + public init() { + let swift = TeamLog.ProtectReportSection.ownedInternally + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportSectionOther: DBXTeamLogProtectReportSection { + @objc + public init() { + let swift = TeamLog.ProtectReportSection.other + super.init(swift: swift) + } +} + +/// Viewed a Dropbox Protect report. +@objc +public class DBXTeamLogProtectReportViewDetails: NSObject { + /// The category of the report that was viewed. + @objc + public var reportCategory: DBXTeamLogProtectReportCategory { DBXTeamLogProtectReportCategory(swift: swift.reportCategory) } + /// The section of the report that was viewed. + @objc + public var reportSection: DBXTeamLogProtectReportSection? { guard let swift = swift.reportSection else { return nil }; return DBXTeamLogProtectReportSection(swift: swift) } + /// The metric of the report that was viewed. + @objc + public var reportMetric: DBXTeamLogProtectReportMetric? { guard let swift = swift.reportMetric else { return nil }; return DBXTeamLogProtectReportMetric(swift: swift) } + + @objc + public init(reportCategory: DBXTeamLogProtectReportCategory, reportSection: DBXTeamLogProtectReportSection?, reportMetric: DBXTeamLogProtectReportMetric?) { + self.swift = TeamLog.ProtectReportViewDetails(reportCategory: reportCategory.swift, reportSection: reportSection?.swift, reportMetric: reportMetric?.swift) + } + + let swift: TeamLog.ProtectReportViewDetails + + public init(swift: TeamLog.ProtectReportViewDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ProtectReportViewType struct +@objc +public class DBXTeamLogProtectReportViewType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ProtectReportViewType(description_: description_) + } + + let swift: TeamLog.ProtectReportViewType + + public init(swift: TeamLog.ProtectReportViewType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Quick action type. +@objc +public class DBXTeamLogQuickActionType: NSObject { + let swift: TeamLog.QuickActionType + + public init(swift: TeamLog.QuickActionType) { + self.swift = swift + } + + public static func factory(swift: TeamLog.QuickActionType) -> DBXTeamLogQuickActionType { + switch swift { + case .deleteSharedLink: + return DBXTeamLogQuickActionTypeDeleteSharedLink() + case .resetPassword: + return DBXTeamLogQuickActionTypeResetPassword() + case .restoreFileOrFolder: + return DBXTeamLogQuickActionTypeRestoreFileOrFolder() + case .unlinkApp: + return DBXTeamLogQuickActionTypeUnlinkApp() + case .unlinkDevice: + return DBXTeamLogQuickActionTypeUnlinkDevice() + case .unlinkSession: + return DBXTeamLogQuickActionTypeUnlinkSession() + case .other: + return DBXTeamLogQuickActionTypeOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asDeleteSharedLink: DBXTeamLogQuickActionTypeDeleteSharedLink? { + return self as? DBXTeamLogQuickActionTypeDeleteSharedLink + } + + @objc + public var asResetPassword: DBXTeamLogQuickActionTypeResetPassword? { + return self as? DBXTeamLogQuickActionTypeResetPassword + } + + @objc + public var asRestoreFileOrFolder: DBXTeamLogQuickActionTypeRestoreFileOrFolder? { + return self as? DBXTeamLogQuickActionTypeRestoreFileOrFolder + } + + @objc + public var asUnlinkApp: DBXTeamLogQuickActionTypeUnlinkApp? { + return self as? DBXTeamLogQuickActionTypeUnlinkApp + } + + @objc + public var asUnlinkDevice: DBXTeamLogQuickActionTypeUnlinkDevice? { + return self as? DBXTeamLogQuickActionTypeUnlinkDevice + } + + @objc + public var asUnlinkSession: DBXTeamLogQuickActionTypeUnlinkSession? { + return self as? DBXTeamLogQuickActionTypeUnlinkSession + } + + @objc + public var asOther: DBXTeamLogQuickActionTypeOther? { + return self as? DBXTeamLogQuickActionTypeOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeDeleteSharedLink: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.deleteSharedLink + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeResetPassword: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.resetPassword + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeRestoreFileOrFolder: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.restoreFileOrFolder + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeUnlinkApp: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.unlinkApp + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeUnlinkDevice: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.unlinkDevice + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeUnlinkSession: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.unlinkSession + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogQuickActionTypeOther: DBXTeamLogQuickActionType { + @objc + public init() { + let swift = TeamLog.QuickActionType.other + super.init(swift: swift) + } +} + +/// Created ransomware report. +@objc +public class DBXTeamLogRansomwareAlertCreateReportDetails: NSObject { + + let swift: TeamLog.RansomwareAlertCreateReportDetails + + public init(swift: TeamLog.RansomwareAlertCreateReportDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Couldn't generate ransomware report. +@objc +public class DBXTeamLogRansomwareAlertCreateReportFailedDetails: NSObject { + /// Failure reason. + @objc + public var failureReason: DBXTeamTeamReportFailureReason { DBXTeamTeamReportFailureReason(swift: swift.failureReason) } + + @objc + public init(failureReason: DBXTeamTeamReportFailureReason) { + self.swift = TeamLog.RansomwareAlertCreateReportFailedDetails(failureReason: failureReason.swift) + } + + let swift: TeamLog.RansomwareAlertCreateReportFailedDetails + + public init(swift: TeamLog.RansomwareAlertCreateReportFailedDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RansomwareAlertCreateReportFailedType struct +@objc +public class DBXTeamLogRansomwareAlertCreateReportFailedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RansomwareAlertCreateReportFailedType(description_: description_) + } + + let swift: TeamLog.RansomwareAlertCreateReportFailedType + + public init(swift: TeamLog.RansomwareAlertCreateReportFailedType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RansomwareAlertCreateReportType struct +@objc +public class DBXTeamLogRansomwareAlertCreateReportType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RansomwareAlertCreateReportType(description_: description_) + } + + let swift: TeamLog.RansomwareAlertCreateReportType + + public init(swift: TeamLog.RansomwareAlertCreateReportType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Completed ransomware restore process. +@objc +public class DBXTeamLogRansomwareRestoreProcessCompletedDetails: NSObject { + /// The status of the restore process. + @objc + public var status: String { swift.status } + /// Restored files count. + @objc + public var restoredFilesCount: NSNumber { swift.restoredFilesCount as NSNumber } + /// Restored files failed count. + @objc + public var restoredFilesFailedCount: NSNumber { swift.restoredFilesFailedCount as NSNumber } + + @objc + public init(status: String, restoredFilesCount: NSNumber, restoredFilesFailedCount: NSNumber) { + self.swift = TeamLog.RansomwareRestoreProcessCompletedDetails(status: status, restoredFilesCount: restoredFilesCount.int64Value, restoredFilesFailedCount: restoredFilesFailedCount.int64Value) + } + + let swift: TeamLog.RansomwareRestoreProcessCompletedDetails + + public init(swift: TeamLog.RansomwareRestoreProcessCompletedDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RansomwareRestoreProcessCompletedType struct +@objc +public class DBXTeamLogRansomwareRestoreProcessCompletedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RansomwareRestoreProcessCompletedType(description_: description_) + } + + let swift: TeamLog.RansomwareRestoreProcessCompletedType + + public init(swift: TeamLog.RansomwareRestoreProcessCompletedType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Started ransomware restore process. +@objc +public class DBXTeamLogRansomwareRestoreProcessStartedDetails: NSObject { + /// Ransomware filename extension. + @objc + public var extension_: String { swift.extension_ } + + @objc + public init(extension_: String) { + self.swift = TeamLog.RansomwareRestoreProcessStartedDetails(extension_: extension_) + } + + let swift: TeamLog.RansomwareRestoreProcessStartedDetails + + public init(swift: TeamLog.RansomwareRestoreProcessStartedDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible RansomwareRestoreProcessStartedType struct +@objc +public class DBXTeamLogRansomwareRestoreProcessStartedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.RansomwareRestoreProcessStartedType(description_: description_) + } + + let swift: TeamLog.RansomwareRestoreProcessStartedType + + public init(swift: TeamLog.RansomwareRestoreProcessStartedType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Recipients Configuration +@objc +public class DBXTeamLogRecipientsConfiguration: NSObject { + /// Recipients setting type. + @objc + public var recipientSettingType: DBXTeamLogAlertRecipientsSettingType? { guard let swift = swift.recipientSettingType else { return nil }; return DBXTeamLogAlertRecipientsSettingType(swift: swift) } + /// A list of user emails to notify. + @objc + public var emails: Array? { swift.emails } + /// A list of groups to notify. + @objc + public var groups: Array? { swift.groups } + + @objc + public init(recipientSettingType: DBXTeamLogAlertRecipientsSettingType?, emails: Array?, groups: Array?) { + self.swift = TeamLog.RecipientsConfiguration(recipientSettingType: recipientSettingType?.swift, emails: emails, groups: groups) + } + + let swift: TeamLog.RecipientsConfiguration + + public init(swift: TeamLog.RecipientsConfiguration) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Provides the indices of the source asset and the destination asset for a relocate action. +@objc +public class DBXTeamLogRelocateAssetReferencesLogInfo: NSObject { + /// Source asset position in the Assets list. + @objc + public var srcAssetIndex: NSNumber { swift.srcAssetIndex as NSNumber } + /// Destination asset position in the Assets list. + @objc + public var destAssetIndex: NSNumber { swift.destAssetIndex as NSNumber } + + @objc + public init(srcAssetIndex: NSNumber, destAssetIndex: NSNumber) { + self.swift = TeamLog.RelocateAssetReferencesLogInfo(srcAssetIndex: srcAssetIndex.uint64Value, destAssetIndex: destAssetIndex.uint64Value) + } + + let swift: TeamLog.RelocateAssetReferencesLogInfo + + public init(swift: TeamLog.RelocateAssetReferencesLogInfo) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Policy for deciding who can be added to Replay content +@objc +public class DBXTeamLogReplayAddingPeoplePolicy: NSObject { + let swift: TeamLog.ReplayAddingPeoplePolicy + + public init(swift: TeamLog.ReplayAddingPeoplePolicy) { + self.swift = swift + } + + public static func factory(swift: TeamLog.ReplayAddingPeoplePolicy) -> DBXTeamLogReplayAddingPeoplePolicy { + switch swift { + case .anyone: + return DBXTeamLogReplayAddingPeoplePolicyAnyone() + case .teamAndAllowlist: + return DBXTeamLogReplayAddingPeoplePolicyTeamAndAllowlist() + case .teamOnly: + return DBXTeamLogReplayAddingPeoplePolicyTeamOnly() + case .other: + return DBXTeamLogReplayAddingPeoplePolicyOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asAnyone: DBXTeamLogReplayAddingPeoplePolicyAnyone? { + return self as? DBXTeamLogReplayAddingPeoplePolicyAnyone + } + + @objc + public var asTeamAndAllowlist: DBXTeamLogReplayAddingPeoplePolicyTeamAndAllowlist? { + return self as? DBXTeamLogReplayAddingPeoplePolicyTeamAndAllowlist + } + + @objc + public var asTeamOnly: DBXTeamLogReplayAddingPeoplePolicyTeamOnly? { + return self as? DBXTeamLogReplayAddingPeoplePolicyTeamOnly + } + + @objc + public var asOther: DBXTeamLogReplayAddingPeoplePolicyOther? { + return self as? DBXTeamLogReplayAddingPeoplePolicyOther + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogReplayAddingPeoplePolicyAnyone: DBXTeamLogReplayAddingPeoplePolicy { + @objc + public init() { + let swift = TeamLog.ReplayAddingPeoplePolicy.anyone + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogReplayAddingPeoplePolicyTeamAndAllowlist: DBXTeamLogReplayAddingPeoplePolicy { + @objc + public init() { + let swift = TeamLog.ReplayAddingPeoplePolicy.teamAndAllowlist + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogReplayAddingPeoplePolicyTeamOnly: DBXTeamLogReplayAddingPeoplePolicy { + @objc + public init() { + let swift = TeamLog.ReplayAddingPeoplePolicy.teamOnly + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogReplayAddingPeoplePolicyOther: DBXTeamLogReplayAddingPeoplePolicy { + @objc + public init() { + let swift = TeamLog.ReplayAddingPeoplePolicy.other + super.init(swift: swift) + } +} + +/// Changed the policy for adding people to Replay content. +@objc +public class DBXTeamLogReplayAddingPeoplePolicyChangedDetails: NSObject { + /// To. + @objc + public var newValue: DBXTeamLogReplayAddingPeoplePolicy { DBXTeamLogReplayAddingPeoplePolicy(swift: swift.newValue) } + /// From. + @objc + public var previousValue: DBXTeamLogReplayAddingPeoplePolicy { DBXTeamLogReplayAddingPeoplePolicy(swift: swift.previousValue) } + + @objc + public init(newValue: DBXTeamLogReplayAddingPeoplePolicy, previousValue: DBXTeamLogReplayAddingPeoplePolicy) { + self.swift = TeamLog.ReplayAddingPeoplePolicyChangedDetails(newValue: newValue.swift, previousValue: previousValue.swift) + } + + let swift: TeamLog.ReplayAddingPeoplePolicyChangedDetails + + public init(swift: TeamLog.ReplayAddingPeoplePolicyChangedDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ReplayAddingPeoplePolicyChangedType struct +@objc +public class DBXTeamLogReplayAddingPeoplePolicyChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ReplayAddingPeoplePolicyChangedType(description_: description_) + } + + let swift: TeamLog.ReplayAddingPeoplePolicyChangedType + + public init(swift: TeamLog.ReplayAddingPeoplePolicyChangedType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Deleted files in Replay. +@objc +public class DBXTeamLogReplayFileDeleteDetails: NSObject { + + let swift: TeamLog.ReplayFileDeleteDetails + + public init(swift: TeamLog.ReplayFileDeleteDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ReplayFileDeleteType struct +@objc +public class DBXTeamLogReplayFileDeleteType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ReplayFileDeleteType(description_: description_) + } + + let swift: TeamLog.ReplayFileDeleteType + + public init(swift: TeamLog.ReplayFileDeleteType) { + self.swift = swift } @@ -78196,6 +80271,110 @@ public class DBXTeamLogTeamExtensionsPolicyChangedType: NSObject { public override var description: String { swift.description } } +/// Changed external sharing controls activation state. +@objc +public class DBXTeamLogTeamExternalSharingControlsActivationStateChangedDetails: NSObject { + /// Previous external sharing controls activation state. + @objc + public var previousActivationState: DBXTeamLogExternalSharingControlsActivationState { DBXTeamLogExternalSharingControlsActivationState(swift: swift.previousActivationState) } + /// New external sharing controls activation state. + @objc + public var newActivationState: DBXTeamLogExternalSharingControlsActivationState { DBXTeamLogExternalSharingControlsActivationState(swift: swift.newActivationState) } + + @objc + public init(previousActivationState: DBXTeamLogExternalSharingControlsActivationState, newActivationState: DBXTeamLogExternalSharingControlsActivationState) { + self.swift = TeamLog.TeamExternalSharingControlsActivationStateChangedDetails(previousActivationState: previousActivationState.swift, newActivationState: newActivationState.swift) + } + + let swift: TeamLog.TeamExternalSharingControlsActivationStateChangedDetails + + public init(swift: TeamLog.TeamExternalSharingControlsActivationStateChangedDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamExternalSharingControlsActivationStateChangedType struct +@objc +public class DBXTeamLogTeamExternalSharingControlsActivationStateChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamExternalSharingControlsActivationStateChangedType(description_: description_) + } + + let swift: TeamLog.TeamExternalSharingControlsActivationStateChangedType + + public init(swift: TeamLog.TeamExternalSharingControlsActivationStateChangedType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Changed approved or blocked entries for external sharing controls. +@objc +public class DBXTeamLogTeamExternalSharingControlsRecipientListsChangedDetails: NSObject { + /// Added approved external sharing recipient entries. + @objc + public var addedApprovedEntries: Array? { swift.addedApprovedEntries } + /// Removed approved external sharing recipient entries. + @objc + public var removedApprovedEntries: Array? { swift.removedApprovedEntries } + /// Added blocked external sharing recipient entries. + @objc + public var addedBlockedEntries: Array? { swift.addedBlockedEntries } + /// Removed blocked external sharing recipient entries. + @objc + public var removedBlockedEntries: Array? { swift.removedBlockedEntries } + + @objc + public init(addedApprovedEntries: Array?, removedApprovedEntries: Array?, addedBlockedEntries: Array?, removedBlockedEntries: Array?) { + self.swift = TeamLog.TeamExternalSharingControlsRecipientListsChangedDetails(addedApprovedEntries: addedApprovedEntries, removedApprovedEntries: removedApprovedEntries, addedBlockedEntries: addedBlockedEntries, removedBlockedEntries: removedBlockedEntries) + } + + let swift: TeamLog.TeamExternalSharingControlsRecipientListsChangedDetails + + public init(swift: TeamLog.TeamExternalSharingControlsRecipientListsChangedDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible TeamExternalSharingControlsRecipientListsChangedType struct +@objc +public class DBXTeamLogTeamExternalSharingControlsRecipientListsChangedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.TeamExternalSharingControlsRecipientListsChangedType(description_: description_) + } + + let swift: TeamLog.TeamExternalSharingControlsRecipientListsChangedType + + public init(swift: TeamLog.TeamExternalSharingControlsRecipientListsChangedType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + /// Changed archival status of team folder. @objc public class DBXTeamLogTeamFolderChangeStatusDetails: NSObject { diff --git a/spec b/spec index f1b5fa6f..1be18244 160000 --- a/spec +++ b/spec @@ -1 +1 @@ -Subproject commit f1b5fa6f96526401bfee0a90171bd5bd19678062 +Subproject commit 1be182440c72ad64971e24bde25d117dccd0e52f diff --git a/stone b/stone index f32aedf7..947f3cad 160000 --- a/stone +++ b/stone @@ -1 +1 @@ -Subproject commit f32aedf70f3152ae91ae0b6226f0906312ba29ea +Subproject commit 947f3cad339d62faafb86278e92556f9b65c6081