From 532257b25c5f40a44ab7fe254ce993661fee73fa Mon Sep 17 00:00:00 2001 From: "dropbox-sdk-updater[bot]" <306210582+dropbox-sdk-updater[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 06:10:49 +0000 Subject: [PATCH] Automated Spec Update 0d994ebe9e86f741b380a75a5267819aeb7eb63e Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> 16dfea0418d5c2f61afd971e5b74bda26ca80eff Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> b45a911a6c8bf71335b4a51798a21dabcee892ca Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> c2df3ee5dccc76a21bfa5b4139bff050cea53de7 Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> b6bb8e88b6cc5898dcc8eff66324908203d95eb4 Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com> --- .../Shared/Generated/Riviera.swift | 637 ++++++ .../Generated/RivieraAppAuthRoutes.swift | 78 + .../Shared/Generated/RivieraRoutes.swift | 78 + .../Shared/Generated/TeamLog.swift | 1180 +++++++++++ .../Shared/Generated/DBXRiviera.swift | 712 +++++++ .../Generated/DBXRivieraAppAuthRoutes.swift | 112 ++ .../Shared/Generated/DBXRivieraRoutes.swift | 358 ++++ .../Shared/Generated/DBXTeamLog.swift | 1734 +++++++++++++++++ spec | 2 +- stone | 2 +- 10 files changed, 4891 insertions(+), 2 deletions(-) diff --git a/Source/SwiftyDropbox/Shared/Generated/Riviera.swift b/Source/SwiftyDropbox/Shared/Generated/Riviera.swift index 0a24301b..4605c545 100644 --- a/Source/SwiftyDropbox/Shared/Generated/Riviera.swift +++ b/Source/SwiftyDropbox/Shared/Generated/Riviera.swift @@ -1279,6 +1279,341 @@ public class Riviera { } } + /// 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? + public init(fileIdOrUrl: Riviera.FileIdOrUrl? = nil) { + self.fileIdOrUrl = fileIdOrUrl + } + + func json() throws -> JSON { + try GetOcrArgsSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetOcrArgsSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetOcrArgs: \(error)" + } + } + } + + public class GetOcrArgsSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: GetOcrArgs) throws -> JSON { + let output = [ + "file_id_or_url": try NullableSerializer(Riviera.FileIdOrUrlSerializer()).serialize(value.fileIdOrUrl), + ] + return .dictionary(output) + } + + 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) + return GetOcrArgs(fileIdOrUrl: fileIdOrUrl) + default: + throw JSONSerializerError.deserializeError(type: GetOcrArgs.self, json: json) + } + } + } + + /// Result type for EventBus async check - must end in "CheckResult" + public enum GetOcrAsyncCheckResult: CustomStringConvertible, JSONRepresentable { + /// An unspecified error. + case inProgress + /// An unspecified error. + case complete(Riviera.GetOcrResult) + /// An unspecified error. + case failed(Riviera.OcrExtractionApiV2Error) + /// An unspecified error. + case other + + func json() throws -> JSON { + try GetOcrAsyncCheckResultSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try GetOcrAsyncCheckResultSerializer().serialize(self)))" + } catch { + return "Failed to generate description for GetOcrAsyncCheckResult: \(error)" + } + } + } + + public class GetOcrAsyncCheckResultSerializer: JSONSerializer { + public init() {} + 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.GetOcrResultSerializer().serialize(arg)) + d[".tag"] = .str("complete") + return .dictionary(d) + case .failed(let arg): + var d = try ["failed": Riviera.OcrExtractionApiV2ErrorSerializer().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 -> GetOcrAsyncCheckResult { + switch json { + case .dictionary(let d): + let tag = try Serialization.getTag(d) + switch tag { + case "in_progress": + return GetOcrAsyncCheckResult.inProgress + case "complete": + let v = try Riviera.GetOcrResultSerializer().deserialize(json) + return GetOcrAsyncCheckResult.complete(v) + case "failed": + let v = try Riviera.OcrExtractionApiV2ErrorSerializer().deserialize(d["failed"] ?? .null) + return GetOcrAsyncCheckResult.failed(v) + case "other": + return GetOcrAsyncCheckResult.other + default: + return GetOcrAsyncCheckResult.other + } + default: + throw JSONSerializerError.deserializeError(type: GetOcrAsyncCheckResult.self, json: json) + } + } + } + + /// 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 GetOcrResultSerializer().serialize(self) + } + + public var description: String { + do { + 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 `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 { @@ -1846,6 +2181,129 @@ public class Riviera { } } + /// 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 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. + case unsupportedFormatError + /// An unspecified error. + case linkDownloadDisabledError + /// An unspecified error. + case sharedLinkPasswordProtected + /// An unspecified error. + case limitExceededError + /// An unspecified error. + 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 OcrExtractionApiV2ErrorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try OcrExtractionApiV2ErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for OcrExtractionApiV2Error: \(error)" + } + } + } + + public class OcrExtractionApiV2ErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: OcrExtractionApiV2Error) 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 -> 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 OcrExtractionApiV2Error.serverError(v) + case "user_error": + let v = try Serialization._StringSerializer.deserialize(d["user_error"] ?? .null) + return OcrExtractionApiV2Error.userError(v) + case "unsupported_format_error": + return OcrExtractionApiV2Error.unsupportedFormatError + case "link_download_disabled_error": + return OcrExtractionApiV2Error.linkDownloadDisabledError + case "shared_link_password_protected": + return OcrExtractionApiV2Error.sharedLinkPasswordProtected + case "limit_exceeded_error": + return OcrExtractionApiV2Error.limitExceededError + case "conversion_failure_error": + return OcrExtractionApiV2Error.conversionFailureError + case "not_found_error": + return OcrExtractionApiV2Error.notFoundError + case "is_a_folder_error": + return OcrExtractionApiV2Error.isAFolderError + case "other": + return OcrExtractionApiV2Error.other + default: + return OcrExtractionApiV2Error.other + } + default: + throw JSONSerializerError.deserializeError(type: OcrExtractionApiV2Error.self, json: json) + } + } + } + /// The kind of MS Office document that produced an `ApiOfficeMetadata` result. public enum OfficeFileType: CustomStringConvertible, JSONRepresentable { /// An unspecified error. @@ -1923,6 +2381,129 @@ public class Riviera { } } + /// 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) + /// An unspecified error. + case unsupportedFormatError + /// An unspecified error. + case linkDownloadDisabledError + /// An unspecified error. + case sharedLinkPasswordProtected + /// An unspecified error. + case limitExceededError + /// An unspecified error. + 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 TextExtractionApiV2ErrorSerializer().serialize(self) + } + + public var description: String { + do { + return "\(SerializeUtil.prepareJSONForSerialization(try TextExtractionApiV2ErrorSerializer().serialize(self)))" + } catch { + return "Failed to generate description for TextExtractionApiV2Error: \(error)" + } + } + } + + public class TextExtractionApiV2ErrorSerializer: JSONSerializer { + public init() {} + public func serialize(_ value: TextExtractionApiV2Error) 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 -> TextExtractionApiV2Error { + 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 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 TextExtractionApiV2Error.other + default: + return TextExtractionApiV2Error.other + } + default: + throw JSONSerializerError.deserializeError(type: TextExtractionApiV2Error.self, json: json) + } + } + } + /// The TimestampLevel union public enum TimestampLevel: CustomStringConvertible, JSONRepresentable { /// An unspecified error. @@ -2123,6 +2704,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..52f1c30f 100644 --- a/Source/SwiftyDropbox/Shared/Generated/RivieraAppAuthRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/RivieraAppAuthRoutes.swift @@ -99,6 +99,84 @@ 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, diff --git a/Source/SwiftyDropbox/Shared/Generated/RivieraRoutes.swift b/Source/SwiftyDropbox/Shared/Generated/RivieraRoutes.swift index 086be160..a6005796 100644 --- a/Source/SwiftyDropbox/Shared/Generated/RivieraRoutes.swift +++ b/Source/SwiftyDropbox/Shared/Generated/RivieraRoutes.swift @@ -99,6 +99,84 @@ 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, diff --git a/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift b/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift index 2b0000bf..fef01521 100644 --- a/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift +++ b/Source/SwiftyDropbox/Shared/Generated/TeamLog.swift @@ -16213,6 +16213,16 @@ public class TeamLog { /// 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) @@ -18055,6 +18065,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") @@ -20289,6 +20319,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) @@ -21898,6 +21943,16 @@ public class TeamLog { 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 @@ -23748,6 +23803,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") @@ -25978,6 +26053,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) @@ -27584,6 +27674,16 @@ public class TeamLog { 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 @@ -29434,6 +29534,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") @@ -31379,6 +31499,16 @@ public class TeamLog { 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": @@ -57059,6 +57189,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. diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRiviera.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRiviera.swift index ec275b1f..f7e1b79c 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRiviera.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRiviera.swift @@ -1067,6 +1067,314 @@ public class DBXRivieraGetMetadataResult: NSObject { public override var description: String { swift.description } } +/// 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 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) + } + + @objc + public init(fileIdOrUrl: DBXRivieraFileIdOrUrl?) { + self.swift = Riviera.GetOcrArgs(fileIdOrUrl: fileIdOrUrl?.swift) + } + + let swift: Riviera.GetOcrArgs + + public init(swift: Riviera.GetOcrArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Result type for EventBus async check - must end in "CheckResult" +@objc +public class DBXRivieraGetOcrAsyncCheckResult: NSObject { + let swift: Riviera.GetOcrAsyncCheckResult + + public init(swift: Riviera.GetOcrAsyncCheckResult) { + self.swift = swift + } + + public static func factory(swift: Riviera.GetOcrAsyncCheckResult) -> DBXRivieraGetOcrAsyncCheckResult { + switch swift { + case .inProgress: + return DBXRivieraGetOcrAsyncCheckResultInProgress() + case .complete(let swiftArg): + let arg = DBXRivieraGetOcrResult(swift: swiftArg) + return DBXRivieraGetOcrAsyncCheckResultComplete(arg) + case .failed(let swiftArg): + let arg = DBXRivieraOcrExtractionApiV2Error(swift: swiftArg) + return DBXRivieraGetOcrAsyncCheckResultFailed(arg) + case .other: + return DBXRivieraGetOcrAsyncCheckResultOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asInProgress: DBXRivieraGetOcrAsyncCheckResultInProgress? { + self as? DBXRivieraGetOcrAsyncCheckResultInProgress + } + + @objc + public var asComplete: DBXRivieraGetOcrAsyncCheckResultComplete? { + self as? DBXRivieraGetOcrAsyncCheckResultComplete + } + + @objc + public var asFailed: DBXRivieraGetOcrAsyncCheckResultFailed? { + self as? DBXRivieraGetOcrAsyncCheckResultFailed + } + + @objc + public var asOther: DBXRivieraGetOcrAsyncCheckResultOther? { + self as? DBXRivieraGetOcrAsyncCheckResultOther + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetOcrAsyncCheckResultInProgress: DBXRivieraGetOcrAsyncCheckResult { + @objc + public init() { + let swift = Riviera.GetOcrAsyncCheckResult.inProgress + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetOcrAsyncCheckResultComplete: DBXRivieraGetOcrAsyncCheckResult { + @objc + public var complete: DBXRivieraGetOcrResult + + @objc + public init(_ arg: DBXRivieraGetOcrResult) { + self.complete = arg + let swift = Riviera.GetOcrAsyncCheckResult.complete(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetOcrAsyncCheckResultFailed: DBXRivieraGetOcrAsyncCheckResult { + @objc + public var failed: DBXRivieraOcrExtractionApiV2Error + + @objc + public init(_ arg: DBXRivieraOcrExtractionApiV2Error) { + self.failed = arg + let swift = Riviera.GetOcrAsyncCheckResult.failed(arg.swift) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraGetOcrAsyncCheckResultOther: DBXRivieraGetOcrAsyncCheckResult { + @objc + public init() { + let swift = Riviera.GetOcrAsyncCheckResult.other + super.init(swift: swift) + } +} + +/// Objective-C compatible GetOcrResult struct +@objc +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 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 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) + } + + @objc + public init(fileIdOrUrl: DBXRivieraFileIdOrUrl?) { + self.swift = Riviera.GetTextArgs(fileIdOrUrl: fileIdOrUrl?.swift) + } + + let swift: Riviera.GetTextArgs + + public init(swift: Riviera.GetTextArgs) { + self.swift = swift + } + + @objc + public override var description: String { swift.description } +} + +/// Result type for EventBus async check - must end in "CheckResult" +@objc +public class DBXRivieraGetTextAsyncCheckResult: NSObject { + let swift: Riviera.GetTextAsyncCheckResult + + 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 `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. @objc @@ -1782,6 +2090,208 @@ public class DBXRivieraMetadataTypeOther: DBXRivieraMetadataType { } } +/// 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.OcrExtractionApiV2Error) -> DBXRivieraOcrExtractionApiV2Error { + switch swift { + case .serverError(let swiftArg): + let arg = swiftArg + return DBXRivieraOcrExtractionApiV2ErrorServerError(arg) + case .userError(let swiftArg): + let arg = swiftArg + return DBXRivieraOcrExtractionApiV2ErrorUserError(arg) + case .unsupportedFormatError: + return DBXRivieraOcrExtractionApiV2ErrorUnsupportedFormatError() + case .linkDownloadDisabledError: + return DBXRivieraOcrExtractionApiV2ErrorLinkDownloadDisabledError() + case .sharedLinkPasswordProtected: + return DBXRivieraOcrExtractionApiV2ErrorSharedLinkPasswordProtected() + case .limitExceededError: + return DBXRivieraOcrExtractionApiV2ErrorLimitExceededError() + case .conversionFailureError: + return DBXRivieraOcrExtractionApiV2ErrorConversionFailureError() + case .notFoundError: + return DBXRivieraOcrExtractionApiV2ErrorNotFoundError() + case .isAFolderError: + return DBXRivieraOcrExtractionApiV2ErrorIsAFolderError() + case .other: + return DBXRivieraOcrExtractionApiV2ErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asServerError: DBXRivieraOcrExtractionApiV2ErrorServerError? { + self as? DBXRivieraOcrExtractionApiV2ErrorServerError + } + + @objc + public var asUserError: DBXRivieraOcrExtractionApiV2ErrorUserError? { + self as? DBXRivieraOcrExtractionApiV2ErrorUserError + } + + @objc + public var asUnsupportedFormatError: DBXRivieraOcrExtractionApiV2ErrorUnsupportedFormatError? { + self as? DBXRivieraOcrExtractionApiV2ErrorUnsupportedFormatError + } + + @objc + public var asLinkDownloadDisabledError: DBXRivieraOcrExtractionApiV2ErrorLinkDownloadDisabledError? { + self as? DBXRivieraOcrExtractionApiV2ErrorLinkDownloadDisabledError + } + + @objc + public var asSharedLinkPasswordProtected: DBXRivieraOcrExtractionApiV2ErrorSharedLinkPasswordProtected? { + self as? DBXRivieraOcrExtractionApiV2ErrorSharedLinkPasswordProtected + } + + @objc + public var asLimitExceededError: DBXRivieraOcrExtractionApiV2ErrorLimitExceededError? { + self as? DBXRivieraOcrExtractionApiV2ErrorLimitExceededError + } + + @objc + public var asConversionFailureError: DBXRivieraOcrExtractionApiV2ErrorConversionFailureError? { + self as? DBXRivieraOcrExtractionApiV2ErrorConversionFailureError + } + + @objc + public var asNotFoundError: DBXRivieraOcrExtractionApiV2ErrorNotFoundError? { + self as? DBXRivieraOcrExtractionApiV2ErrorNotFoundError + } + + @objc + public var asIsAFolderError: DBXRivieraOcrExtractionApiV2ErrorIsAFolderError? { + self as? DBXRivieraOcrExtractionApiV2ErrorIsAFolderError + } + + @objc + 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 DBXRivieraOcrExtractionApiV2ErrorServerError: DBXRivieraOcrExtractionApiV2Error { + @objc + public var serverError: String + + @objc + public init(_ arg: String) { + self.serverError = arg + let swift = Riviera.OcrExtractionApiV2Error.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 DBXRivieraOcrExtractionApiV2ErrorUserError: DBXRivieraOcrExtractionApiV2Error { + @objc + public var userError: String + + @objc + public init(_ arg: String) { + self.userError = arg + let swift = Riviera.OcrExtractionApiV2Error.userError(arg) + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraOcrExtractionApiV2ErrorUnsupportedFormatError: DBXRivieraOcrExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.OcrExtractionApiV2Error.unsupportedFormatError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraOcrExtractionApiV2ErrorLinkDownloadDisabledError: DBXRivieraOcrExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.OcrExtractionApiV2Error.linkDownloadDisabledError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraOcrExtractionApiV2ErrorSharedLinkPasswordProtected: DBXRivieraOcrExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.OcrExtractionApiV2Error.sharedLinkPasswordProtected + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraOcrExtractionApiV2ErrorLimitExceededError: DBXRivieraOcrExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.OcrExtractionApiV2Error.limitExceededError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraOcrExtractionApiV2ErrorConversionFailureError: DBXRivieraOcrExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.OcrExtractionApiV2Error.conversionFailureError + super.init(swift: swift) + } +} + +/// The referenced file does not exist or is not accessible. +@objc +public class DBXRivieraOcrExtractionApiV2ErrorNotFoundError: DBXRivieraOcrExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.OcrExtractionApiV2Error.notFoundError + super.init(swift: swift) + } +} + +/// The target is a folder, not a file. +@objc +public class DBXRivieraOcrExtractionApiV2ErrorIsAFolderError: DBXRivieraOcrExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.OcrExtractionApiV2Error.isAFolderError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraOcrExtractionApiV2ErrorOther: DBXRivieraOcrExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.OcrExtractionApiV2Error.other + super.init(swift: swift) + } +} + /// The kind of MS Office document that produced an `ApiOfficeMetadata` result. @objc public class DBXRivieraOfficeFileType: NSObject { @@ -1885,6 +2395,208 @@ public class DBXRivieraOfficeFileTypeOther: DBXRivieraOfficeFileType { } } +/// 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 DBXRivieraTextExtractionApiV2Error: NSObject { + let swift: Riviera.TextExtractionApiV2Error + + public init(swift: Riviera.TextExtractionApiV2Error) { + self.swift = swift + } + + public static func factory(swift: Riviera.TextExtractionApiV2Error) -> DBXRivieraTextExtractionApiV2Error { + switch swift { + 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 DBXRivieraTextExtractionApiV2ErrorOther() + } + } + + @objc + public override var description: String { swift.description } + + @objc + public var asServerError: DBXRivieraTextExtractionApiV2ErrorServerError? { + self as? DBXRivieraTextExtractionApiV2ErrorServerError + } + + @objc + public var asUserError: DBXRivieraTextExtractionApiV2ErrorUserError? { + self as? DBXRivieraTextExtractionApiV2ErrorUserError + } + + @objc + public var asUnsupportedFormatError: DBXRivieraTextExtractionApiV2ErrorUnsupportedFormatError? { + self as? DBXRivieraTextExtractionApiV2ErrorUnsupportedFormatError + } + + @objc + public var asLinkDownloadDisabledError: DBXRivieraTextExtractionApiV2ErrorLinkDownloadDisabledError? { + self as? DBXRivieraTextExtractionApiV2ErrorLinkDownloadDisabledError + } + + @objc + 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 unexpected, typically transient, server-side failure. The string is a human-readable message; retrying +/// with backoff may succeed. +@objc +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) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraTextExtractionApiV2ErrorUnsupportedFormatError: DBXRivieraTextExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.TextExtractionApiV2Error.unsupportedFormatError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraTextExtractionApiV2ErrorLinkDownloadDisabledError: DBXRivieraTextExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.TextExtractionApiV2Error.linkDownloadDisabledError + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraTextExtractionApiV2ErrorSharedLinkPasswordProtected: DBXRivieraTextExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.TextExtractionApiV2Error.sharedLinkPasswordProtected + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXRivieraTextExtractionApiV2ErrorLimitExceededError: DBXRivieraTextExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.TextExtractionApiV2Error.limitExceededError + super.init(swift: swift) + } +} + +/// An unspecified error. +@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 DBXRivieraTextExtractionApiV2ErrorOther: DBXRivieraTextExtractionApiV2Error { + @objc + public init() { + let swift = Riviera.TextExtractionApiV2Error.other + super.init(swift: swift) + } +} + /// Objective-C compatible TimestampLevel union @objc public class DBXRivieraTimestampLevel: NSObject { diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraAppAuthRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraAppAuthRoutes.swift index d2c78481..f87ac9fb 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraAppAuthRoutes.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraAppAuthRoutes.swift @@ -128,6 +128,118 @@ 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, diff --git a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraRoutes.swift b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraRoutes.swift index 93a5c9d7..ec86e28e 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraRoutes.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXRivieraRoutes.swift @@ -128,6 +128,118 @@ 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, @@ -446,6 +558,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..68c85e88 100644 --- a/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift +++ b/Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift @@ -12591,6 +12591,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) @@ -15050,6 +15065,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 @@ -20756,6 +20796,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 { @@ -26420,6 +26530,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) @@ -28876,6 +29001,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 @@ -34577,6 +34727,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 { @@ -39951,6 +40171,16 @@ public class DBXTeamLogEventTypeArg: NSObject { 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: @@ -42066,6 +42296,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 @@ -46627,6 +46882,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 { @@ -66984,6 +67289,1435 @@ public class DBXTeamLogProtectInternalDomainsChangedType: NSObject { public override var description: String { swift.description } } +/// Activated a Dropbox Protect policy. +@objc +public class DBXTeamLogProtectPolicyActivatedDetails: NSObject { + /// Policy ID. + @objc + public var policyId: String { swift.policyId } + + @objc + public init(policyId: String) { + self.swift = TeamLog.ProtectPolicyActivatedDetails(policyId: policyId) + } + + let swift: TeamLog.ProtectPolicyActivatedDetails + + public init(swift: TeamLog.ProtectPolicyActivatedDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ProtectPolicyActivatedType struct +@objc +public class DBXTeamLogProtectPolicyActivatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ProtectPolicyActivatedType(description_: description_) + } + + let swift: TeamLog.ProtectPolicyActivatedType + + public init(swift: TeamLog.ProtectPolicyActivatedType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Deactivated a Dropbox Protect policy. +@objc +public class DBXTeamLogProtectPolicyDeactivatedDetails: NSObject { + /// Policy ID. + @objc + public var policyId: String { swift.policyId } + + @objc + public init(policyId: String) { + self.swift = TeamLog.ProtectPolicyDeactivatedDetails(policyId: policyId) + } + + let swift: TeamLog.ProtectPolicyDeactivatedDetails + + public init(swift: TeamLog.ProtectPolicyDeactivatedDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ProtectPolicyDeactivatedType struct +@objc +public class DBXTeamLogProtectPolicyDeactivatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ProtectPolicyDeactivatedType(description_: description_) + } + + let swift: TeamLog.ProtectPolicyDeactivatedType + + public init(swift: TeamLog.ProtectPolicyDeactivatedType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Scheduled a Dropbox Protect policy. +@objc +public class DBXTeamLogProtectPolicyScheduledDetails: NSObject { + /// Policy ID. + @objc + public var policyId: String { swift.policyId } + + @objc + public init(policyId: String) { + self.swift = TeamLog.ProtectPolicyScheduledDetails(policyId: policyId) + } + + let swift: TeamLog.ProtectPolicyScheduledDetails + + public init(swift: TeamLog.ProtectPolicyScheduledDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ProtectPolicyScheduledType struct +@objc +public class DBXTeamLogProtectPolicyScheduledType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ProtectPolicyScheduledType(description_: description_) + } + + let swift: TeamLog.ProtectPolicyScheduledType + + public init(swift: TeamLog.ProtectPolicyScheduledType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Updated a Dropbox Protect policy. +@objc +public class DBXTeamLogProtectPolicyUpdatedDetails: NSObject { + /// Policy ID. + @objc + public var policyId: String { swift.policyId } + + @objc + public init(policyId: String) { + self.swift = TeamLog.ProtectPolicyUpdatedDetails(policyId: policyId) + } + + let swift: TeamLog.ProtectPolicyUpdatedDetails + + public init(swift: TeamLog.ProtectPolicyUpdatedDetails) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// Objective-C compatible ProtectPolicyUpdatedType struct +@objc +public class DBXTeamLogProtectPolicyUpdatedType: NSObject { + /// (no description) + @objc + public var description_: String { swift.description_ } + + @objc + public init(description_: String) { + self.swift = TeamLog.ProtectPolicyUpdatedType(description_: description_) + } + + let swift: TeamLog.ProtectPolicyUpdatedType + + public init(swift: TeamLog.ProtectPolicyUpdatedType) { + self.swift = swift + } + + + @objc + public override var description: String { swift.description } +} + +/// The category that a Dropbox Protect report belongs to +@objc +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 override var description: String { swift.description } + + @objc + public var asOverview: DBXTeamLogProtectReportCategoryOverview? { + return self as? DBXTeamLogProtectReportCategoryOverview + } + + @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 init() { + let swift = TeamLog.ProtectReportCategory.overview + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportCategoryStaleAccess: DBXTeamLogProtectReportCategory { + @objc + public init() { + let swift = TeamLog.ProtectReportCategory.staleAccess + super.init(swift: swift) + } +} + +/// An unspecified error. +@objc +public class DBXTeamLogProtectReportCategoryOther: DBXTeamLogProtectReportCategory { + @objc + public init() { + let swift = TeamLog.ProtectReportCategory.other + super.init(swift: swift) + } +} + +/// The metric that a Dropbox Protect report corresponds to +@objc +public class DBXTeamLogProtectReportMetric: NSObject { + let swift: TeamLog.ProtectReportMetric + + 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 } + + @objc + public var asExternalModifiedOver1Year: DBXTeamLogProtectReportMetricExternalModifiedOver1Year? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1Year + } + + @objc + public var asExternalModifiedOver1YearCompany: DBXTeamLogProtectReportMetricExternalModifiedOver1YearCompany? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1YearCompany + } + + @objc + public var asExternalModifiedOver1YearOutside: DBXTeamLogProtectReportMetricExternalModifiedOver1YearOutside? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1YearOutside + } + + @objc + public var asExternalModifiedOver1YearPersonal: DBXTeamLogProtectReportMetricExternalModifiedOver1YearPersonal? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1YearPersonal + } + + @objc + public var asExternalModifiedOver1YearPublic: DBXTeamLogProtectReportMetricExternalModifiedOver1YearPublic? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver1YearPublic + } + + @objc + public var asExternalModifiedOver2Years: DBXTeamLogProtectReportMetricExternalModifiedOver2Years? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2Years + } + + @objc + public var asExternalModifiedOver2YearsCompany: DBXTeamLogProtectReportMetricExternalModifiedOver2YearsCompany? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2YearsCompany + } + + @objc + public var asExternalModifiedOver2YearsOutside: DBXTeamLogProtectReportMetricExternalModifiedOver2YearsOutside? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2YearsOutside + } + + @objc + public var asExternalModifiedOver2YearsPersonal: DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPersonal + } + + @objc + public var asExternalModifiedOver2YearsPublic: DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPublic? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver2YearsPublic + } + + @objc + public var asExternalModifiedOver3Years: DBXTeamLogProtectReportMetricExternalModifiedOver3Years? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3Years + } + + @objc + public var asExternalModifiedOver3YearsCompany: DBXTeamLogProtectReportMetricExternalModifiedOver3YearsCompany? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3YearsCompany + } + + @objc + public var asExternalModifiedOver3YearsOutside: DBXTeamLogProtectReportMetricExternalModifiedOver3YearsOutside? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3YearsOutside + } + + @objc + public var asExternalModifiedOver3YearsPersonal: DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPersonal + } + + @objc + public var asExternalModifiedOver3YearsPublic: DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPublic? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver3YearsPublic + } + + @objc + public var asExternalModifiedOver5Years: DBXTeamLogProtectReportMetricExternalModifiedOver5Years? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5Years + } + + @objc + public var asExternalModifiedOver5YearsCompany: DBXTeamLogProtectReportMetricExternalModifiedOver5YearsCompany? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5YearsCompany + } + + @objc + public var asExternalModifiedOver5YearsOutside: DBXTeamLogProtectReportMetricExternalModifiedOver5YearsOutside? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5YearsOutside + } + + @objc + public var asExternalModifiedOver5YearsPersonal: DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPersonal + } + + @objc + public var asExternalModifiedOver5YearsPublic: DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPublic? { + return self as? DBXTeamLogProtectReportMetricExternalModifiedOver5YearsPublic + } + + @objc + public var asFoldersCompany: DBXTeamLogProtectReportMetricFoldersCompany? { + return self as? DBXTeamLogProtectReportMetricFoldersCompany + } + + @objc + public var asFoldersInternal: DBXTeamLogProtectReportMetricFoldersInternal? { + return self as? DBXTeamLogProtectReportMetricFoldersInternal + } + + @objc + public var asFoldersOutside: DBXTeamLogProtectReportMetricFoldersOutside? { + return self as? DBXTeamLogProtectReportMetricFoldersOutside + } + + @objc + public var asFoldersPersonal: DBXTeamLogProtectReportMetricFoldersPersonal? { + return self as? DBXTeamLogProtectReportMetricFoldersPersonal + } + + @objc + public var asFoldersPublic: DBXTeamLogProtectReportMetricFoldersPublic? { + return self as? DBXTeamLogProtectReportMetricFoldersPublic + } + + @objc + public var asInternalModifiedOver1Year: DBXTeamLogProtectReportMetricInternalModifiedOver1Year? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1Year + } + + @objc + public var asInternalModifiedOver1YearCompany: DBXTeamLogProtectReportMetricInternalModifiedOver1YearCompany? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1YearCompany + } + + @objc + public var asInternalModifiedOver1YearOutside: DBXTeamLogProtectReportMetricInternalModifiedOver1YearOutside? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1YearOutside + } + + @objc + public var asInternalModifiedOver1YearPersonal: DBXTeamLogProtectReportMetricInternalModifiedOver1YearPersonal? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1YearPersonal + } + + @objc + public var asInternalModifiedOver1YearPublic: DBXTeamLogProtectReportMetricInternalModifiedOver1YearPublic? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver1YearPublic + } + + @objc + public var asInternalModifiedOver2Years: DBXTeamLogProtectReportMetricInternalModifiedOver2Years? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2Years + } + + @objc + public var asInternalModifiedOver2YearsCompany: DBXTeamLogProtectReportMetricInternalModifiedOver2YearsCompany? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2YearsCompany + } + + @objc + public var asInternalModifiedOver2YearsOutside: DBXTeamLogProtectReportMetricInternalModifiedOver2YearsOutside? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2YearsOutside + } + + @objc + public var asInternalModifiedOver2YearsPersonal: DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPersonal + } + + @objc + public var asInternalModifiedOver2YearsPublic: DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPublic? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver2YearsPublic + } + + @objc + public var asInternalModifiedOver3Years: DBXTeamLogProtectReportMetricInternalModifiedOver3Years? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3Years + } + + @objc + public var asInternalModifiedOver3YearsCompany: DBXTeamLogProtectReportMetricInternalModifiedOver3YearsCompany? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3YearsCompany + } + + @objc + public var asInternalModifiedOver3YearsOutside: DBXTeamLogProtectReportMetricInternalModifiedOver3YearsOutside? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3YearsOutside + } + + @objc + public var asInternalModifiedOver3YearsPersonal: DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPersonal + } + + @objc + public var asInternalModifiedOver3YearsPublic: DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPublic? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver3YearsPublic + } + + @objc + public var asInternalModifiedOver5Years: DBXTeamLogProtectReportMetricInternalModifiedOver5Years? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5Years + } + + @objc + public var asInternalModifiedOver5YearsCompany: DBXTeamLogProtectReportMetricInternalModifiedOver5YearsCompany? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5YearsCompany + } + + @objc + public var asInternalModifiedOver5YearsOutside: DBXTeamLogProtectReportMetricInternalModifiedOver5YearsOutside? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5YearsOutside + } + + @objc + public var asInternalModifiedOver5YearsPersonal: DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPersonal? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPersonal + } + + @objc + public var asInternalModifiedOver5YearsPublic: DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPublic? { + return self as? DBXTeamLogProtectReportMetricInternalModifiedOver5YearsPublic + } + + @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 { diff --git a/spec b/spec index f1b5fa6f..0d994ebe 160000 --- a/spec +++ b/spec @@ -1 +1 @@ -Subproject commit f1b5fa6f96526401bfee0a90171bd5bd19678062 +Subproject commit 0d994ebe9e86f741b380a75a5267819aeb7eb63e diff --git a/stone b/stone index f32aedf7..947f3cad 160000 --- a/stone +++ b/stone @@ -1 +1 @@ -Subproject commit f32aedf70f3152ae91ae0b6226f0906312ba29ea +Subproject commit 947f3cad339d62faafb86278e92556f9b65c6081